Class 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 Detail

      • RankedSchemaProviders

        public RankedSchemaProviders()
    • 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 interface SchemaProvider
        Parameters:
        r - The Resource to which the schema applies
        selectors - 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