Interface GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
- All Known Subinterfaces:
GraphQlSource.SchemaResourceBuilder
- Enclosing interface:
- GraphQlSource
public static interface GraphQlSource.Builder<B extends GraphQlSource.Builder<B>>
Common configuration options for all
GraphQlSource builders,
independent of how GraphQLSchema is created.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theGraphQlSourceinstance.configureGraphQl(Consumer<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.instrumentation(List<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<GraphQLTypeVisitor> typeVisitors) AddGraphQLTypeVisitors to visit all element of the createdGraphQLSchemaand make changes to theGraphQLCodeRegistry.typeVisitorsToTransformSchema(List<GraphQLTypeVisitor> typeVisitors) Alternative totypeVisitors(List)for visitors that also need to make schema changes.
-
Method Details
-
exceptionResolvers
AddDataFetcherExceptionResolver's that are invoked when aDataFetcherraises an exception. Resolvers are invoked in sequence until one emits a list.- Parameters:
resolvers- the resolvers to add- Returns:
- the current builder
-
subscriptionExceptionResolvers
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. Resolvers are invoked in sequence until one emits a list.- Parameters:
resolvers- the subscription exception resolver- Returns:
- the current builder
- Since:
- 1.0.1
-
typeVisitors
AddGraphQLTypeVisitors to visit all element of the createdGraphQLSchemaand make changes to theGraphQLCodeRegistry.Note: Visitors are applied via
SchemaTraverserand cannot change the schema.- Parameters:
typeVisitors- the type visitors- Returns:
- the current builder
- See Also:
-
typeVisitorsToTransformSchema
Alternative totypeVisitors(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 prefertypeVisitors(List)if it's not necessary to change the schema.- Parameters:
typeVisitors- the type visitors to register- Returns:
- the current builder
- Since:
- 1.1.0
- See Also:
-
instrumentation
ProvideInstrumentationcomponents to instrument the execution of GraphQL queries.- Parameters:
instrumentations- the instrumentation components- Returns:
- the current builder
- See Also:
-
configureGraphQl
Configure consumers to be given access to theGraphQL.Builderused to buildGraphQL.- Parameters:
configurer- the configurer- Returns:
- the current builder
-
build
GraphQlSource build()Build theGraphQlSourceinstance.
-