Class RankedSchemaProviders
- java.lang.Object
-
- org.apache.sling.graphql.core.schema.RankedSchemaProviders
-
- All Implemented Interfaces:
SchemaProvider
public class RankedSchemaProviders extends Object implements SchemaProvider
Uses multiple registered SchemaProvider services to get a schema, using the first one that returns non-null.
-
-
Constructor Summary
Constructors Constructor Description RankedSchemaProviders()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindSchemaProvider(SchemaProvider service, Map<String,Object> props)
@Nullable String
getSchema(@NotNull org.apache.sling.api.resource.Resource r, @Nullable String[] selectors)
Get a GraphQL Schema definition for the given resource and optional selectorsprotected void
unbindSchemaProvider(SchemaProvider service, Map<String,Object> props)
-
-
-
Method Detail
-
getSchema
@Nullable public @Nullable String getSchema(@NotNull @NotNull org.apache.sling.api.resource.Resource r, @Nullable @Nullable String[] selectors) throws IOException
Description copied from interface:SchemaProvider
Get a GraphQL Schema definition for the given resource and optional selectors- Specified by:
getSchema
in 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
-
bindSchemaProvider
protected void bindSchemaProvider(SchemaProvider service, Map<String,Object> props)
-
unbindSchemaProvider
protected void unbindSchemaProvider(SchemaProvider service, Map<String,Object> props)
-
-