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 a
GraphQLObjectType- Since:
- 3.1
- Author:
- joseross
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateField(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 typevoidcreateType(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 Details
-
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- theGraphQLObjectTypefor the root querycodeRegistry- theGraphQLCodeRegistryto addDataFetcherfor new fieldsdataFetcher- theDataFetcherto use for the new fieldssiteTypes- all content-type related types
-
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
-