Class DefaultSchemaProvider

  • All Implemented Interfaces:
    SchemaProvider

    public class DefaultSchemaProvider
    extends Object
    implements SchemaProvider
    Provides a Resource-specific GraphQL Schema, as text
    • Constructor Detail

      • DefaultSchemaProvider

        public DefaultSchemaProvider()
    • Method Detail

      • getSchema

        public String getSchema​(org.apache.sling.api.resource.Resource r,
                                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