Class AbstractGraphQlSourceBuilder<B extends GraphQlSource.Builder<B>>
java.lang.Object
org.springframework.graphql.execution.AbstractGraphQlSourceBuilder<B>
- Type Parameters:
- B- the builder type
- All Implemented Interfaces:
- GraphQlSource.Builder<B>
public abstract class AbstractGraphQlSourceBuilder<B extends GraphQlSource.Builder<B>>
extends Object
implements GraphQlSource.Builder<B>
Implementation of 
GraphQlSource.Builder that leaves it to subclasses
 to initialize GraphQLSchema.- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev, Brian Clozel
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidapplyGraphQlConfigurers(graphql.GraphQL.Builder builder) Protected method to apply theconfigured graphQlConfigurer's.build()Build theGraphQlSourceinstance.configureGraphQl(Consumer<graphql.GraphQL.Builder> configurer) Configure consumers to be given access to theGraphQL.Builderused to buildGraphQL.exceptionResolvers(List<DataFetcherExceptionResolver> resolvers) AddDataFetcherExceptionResolver's that are invoked when aDataFetcherraises an exception.Configure a factory to use to create theGraphQlSourceinstance to return from theGraphQlSource.Builder.build()method.protected abstract graphql.schema.GraphQLSchemaSubclasses must implement this method to provide theGraphQLSchemainstance.instrumentation(List<graphql.execution.instrumentation.Instrumentation> instrumentations) ProvideInstrumentationcomponents to instrument the execution of GraphQL queries.AddSubscriptionExceptionResolvers that are invoked when a GraphQL subscriptionPublisherends with error, and given a chance to resolve the exception to one or more GraphQL errors to be sent to the client.typeVisitors(List<graphql.schema.GraphQLTypeVisitor> typeVisitors) AddGraphQLTypeVisitors to visit all element of the createdGraphQLSchemaand make changes to theGraphQLCodeRegistry.typeVisitorsToTransformSchema(List<graphql.schema.GraphQLTypeVisitor> typeVisitorsToTransformSchema) Alternative toGraphQlSource.Builder.typeVisitors(List)for visitors that also need to make schema changes.
- 
Constructor Details- 
AbstractGraphQlSourceBuilderpublic AbstractGraphQlSourceBuilder()
 
- 
- 
Method Details- 
exceptionResolversDescription copied from interface:GraphQlSource.BuilderAddDataFetcherExceptionResolver's that are invoked when aDataFetcherraises an exception. Resolvers are invoked in sequence until one emits a list.- Specified by:
- exceptionResolversin interface- GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
- Parameters:
- resolvers- the resolvers to add
- Returns:
- the current builder
 
- 
subscriptionExceptionResolversDescription copied from interface:GraphQlSource.BuilderAddSubscriptionExceptionResolvers that are invoked when a GraphQL subscriptionPublisherends with error, and given a chance to resolve the exception to one or more GraphQL errors to be sent to the client. Resolvers are invoked in sequence until one emits a list.- Specified by:
- subscriptionExceptionResolversin interface- GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
- Parameters:
- resolvers- the subscription exception resolver
- Returns:
- the current builder
 
- 
typeVisitorsDescription copied from interface:GraphQlSource.BuilderAddGraphQLTypeVisitors to visit all element of the createdGraphQLSchemaand make changes to theGraphQLCodeRegistry.Note: Visitors are applied via SchemaTraverserand cannot change the schema.- Specified by:
- typeVisitorsin interface- GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
- Parameters:
- typeVisitors- the type visitors
- Returns:
- the current builder
- See Also:
 
- 
typeVisitorsToTransformSchemapublic B typeVisitorsToTransformSchema(List<graphql.schema.GraphQLTypeVisitor> typeVisitorsToTransformSchema) Description copied from interface:GraphQlSource.BuilderAlternative toGraphQlSource.Builder.typeVisitors(List)for visitors that also need to make schema changes.Note: Visitors are applied via SchemaTransformer, and therefore can change the schema. However, this is more expensive than usingSchemaTraverser, so generally preferGraphQlSource.Builder.typeVisitors(List)if it's not necessary to change the schema.- Specified by:
- typeVisitorsToTransformSchemain interface- GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
- Parameters:
- typeVisitorsToTransformSchema- the type visitors to register
- Returns:
- the current builder
- See Also:
 
- 
instrumentationDescription copied from interface:GraphQlSource.BuilderProvideInstrumentationcomponents to instrument the execution of GraphQL queries.- Specified by:
- instrumentationin interface- GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
- Parameters:
- instrumentations- the instrumentation components
- Returns:
- the current builder
- See Also:
 
- 
configureGraphQlDescription copied from interface:GraphQlSource.BuilderConfigure consumers to be given access to theGraphQL.Builderused to buildGraphQL.- Specified by:
- configureGraphQlin interface- GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
- Parameters:
- configurer- the configurer
- Returns:
- the current builder
 
- 
graphQlSourceFactoryDescription copied from interface:GraphQlSource.BuilderConfigure a factory to use to create theGraphQlSourceinstance to return from theGraphQlSource.Builder.build()method.By default, the instance is a simple container of GraphQLandGraphQLSchema. Applications can use this to create a different implementation that applies additional per-request logic.- Specified by:
- graphQlSourceFactoryin interface- GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
- Parameters:
- factory- the factory to use
- Returns:
- the current builder
 
- 
buildDescription copied from interface:GraphQlSource.BuilderBuild theGraphQlSourceinstance.- Specified by:
- buildin interface- GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
 
- 
initGraphQlSchemaprotected abstract graphql.schema.GraphQLSchema initGraphQlSchema()Subclasses must implement this method to provide theGraphQLSchemainstance.
- 
applyGraphQlConfigurersprotected void applyGraphQlConfigurers(graphql.GraphQL.Builder builder) Protected method to apply theconfigured graphQlConfigurer's. Subclasses can use this to customizeGraphQL.Builderfurther.- Parameters:
- builder- the builder to be customized
- Since:
- 1.2.5
 
 
-