Package org.craftercms.engine.graphql
Interface GraphQLTypeFactory
-
- All Known Implementing Classes:
GraphQLTypeFactoryImpl
public interface GraphQLTypeFactory
Creates all the required objects to represent a content-type in aGraphQLObjectType
- 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 typevoid
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-typerootGraphQLType
- theGraphQLObjectType
for the root querycodeRegistry
- theGraphQLCodeRegistry
to addDataFetcher
for new fieldssiteTypes
- all content-type related typesdataFetcher
- theDataFetcher
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-typecontentTypeField
- the XML node for the content-type fieldparentGraphQLTypeName
- the field's parent GraphQL type nameparentGraphQLType
- the field's parentGraphQLObjectType
-
-