Interface GraphQLTypeFactory

  • All Known Implementing Classes:
    GraphQLTypeFactoryImpl

    public interface GraphQLTypeFactory
    Creates all the required objects to represent a content-type in a GraphQLObjectType
    Since:
    3.1
    Author:
    joseross
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void createField​(org.dom4j.Document contentTypeDefinition, org.dom4j.Node contentTypeField, String parentGraphQLTypeName, graphql.schema.GraphQLObjectType.Builder parentGraphQLType)
      Creates a GraphQL field for the given content-type field and adds it to the given GraphQL type
      void createType​(org.craftercms.core.service.Item contentTypeDefinition, graphql.schema.GraphQLObjectType.Builder rootGraphQLType, graphql.schema.GraphQLCodeRegistry.Builder codeRegistry, graphql.schema.DataFetcher<?> dataFetcher, Map<String,​graphql.schema.GraphQLObjectType.Builder> siteTypes)
      Creates a GraphQL type for the given content-type and adds a field in the root type
    • Method Detail

      • createType

        void createType​(org.craftercms.core.service.Item contentTypeDefinition,
                        graphql.schema.GraphQLObjectType.Builder rootGraphQLType,
                        graphql.schema.GraphQLCodeRegistry.Builder codeRegistry,
                        graphql.schema.DataFetcher<?> dataFetcher,
                        Map<String,​graphql.schema.GraphQLObjectType.Builder> siteTypes)
        Creates a GraphQL type for the given content-type and adds a field in the root type
        Parameters:
        contentTypeDefinition - the XML definition of the content-type
        rootGraphQLType - the GraphQLObjectType for the root query
        codeRegistry - the GraphQLCodeRegistry to add DataFetcher for new fields
        siteTypes - all content-type related types
        dataFetcher - the DataFetcher to use for the new fields
      • createField

        void createField​(org.dom4j.Document contentTypeDefinition,
                         org.dom4j.Node contentTypeField,
                         String parentGraphQLTypeName,
                         graphql.schema.GraphQLObjectType.Builder parentGraphQLType)
        Creates a GraphQL field for the given content-type field and adds it to the given GraphQL type
        Parameters:
        contentTypeDefinition - the XML definition of the content-type
        contentTypeField - the XML node for the content-type field
        parentGraphQLTypeName - the field's parent GraphQL type name
        parentGraphQLType - the field's parent GraphQLObjectType