Interface SchemaProvider


  • @ProviderType
    public interface SchemaProvider
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @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 selectors
    • Method Detail

      • getSchema

        @Nullable
        @Nullable String getSchema​(@NotNull
                                   @NotNull org.apache.sling.api.resource.Resource r,
                                   @Nullable
                                   @Nullable String[] selectors)
                            throws IOException
        Get a GraphQL Schema definition for the given resource and optional selectors
        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