Class DefaultSchemaProvider
- java.lang.Object
-
- org.apache.sling.graphql.core.schema.DefaultSchemaProvider
-
- All Implemented Interfaces:
SchemaProvider
public class DefaultSchemaProvider extends Object implements SchemaProvider
Provides a Resource-specific GraphQL Schema, as text
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_SCHEMAstatic StringSCHEMA_EXTENSIONstatic intSERVICE_RANKING
-
Constructor Summary
Constructors Constructor Description DefaultSchemaProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetSchema(org.apache.sling.api.resource.Resource r, String[] selectors)Get a GraphQL Schema definition for the given resource and optional selectors
-
-
-
Field Detail
-
SERVICE_RANKING
public static final int SERVICE_RANKING
- See Also:
- Constant Field Values
-
SCHEMA_EXTENSION
public static final String SCHEMA_EXTENSION
- See Also:
- Constant Field Values
-
DEFAULT_SCHEMA
public static final String DEFAULT_SCHEMA
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSchema
public String getSchema(org.apache.sling.api.resource.Resource r, String[] selectors) throws IOException
Description copied from interface:SchemaProviderGet a GraphQL Schema definition for the given resource and optional selectors- Specified by:
getSchemain interfaceSchemaProvider- Parameters:
r- The Resource to which the schema appliesselectors- Optional set of Request Selectors that can influence the schema selection- Returns:
- a GraphQL schema that can be annotated to define the data fetchers to use, see this module's documentation. Can return null if a schema cannot be provided, in which case a different provider should be used.
- Throws:
IOException- if the schema cannot be retrieved
-
-