public static interface GraphQlSource.Builder
GraphQlSource.| Modifier and Type | Method and Description |
|---|---|
GraphQlSource |
build()
Build the
GraphQlSource. |
GraphQlSource.Builder |
configureGraphQl(java.util.function.Consumer<graphql.GraphQL.Builder> configurer)
Configure consumers to be given access to the
GraphQL.Builder used to
build GraphQL. |
GraphQlSource.Builder |
configureRuntimeWiring(RuntimeWiringConfigurer configurer)
Add a component that is given access to the
RuntimeWiring.Builder
used to register DataFetchers, custom scalar
types, type resolvers, and more. |
GraphQlSource.Builder |
defaultTypeResolver(graphql.schema.TypeResolver typeResolver)
Configure the default
TypeResolver to use for GraphQL Interface
and Union types that don't already have such a registration after all
RuntimeWiringConfigurer's
have been applied. |
GraphQlSource.Builder |
exceptionResolvers(java.util.List<DataFetcherExceptionResolver> resolvers)
Add
DataFetcherExceptionResolver's to use for resolving exceptions from
DataFetcher's. |
GraphQlSource.Builder |
instrumentation(java.util.List<graphql.execution.instrumentation.Instrumentation> instrumentations)
Provide
Instrumentation components to instrument the execution of
GraphQL queries. |
GraphQlSource.Builder |
schemaFactory(java.util.function.BiFunction<graphql.schema.idl.TypeDefinitionRegistry,graphql.schema.idl.RuntimeWiring,graphql.schema.GraphQLSchema> schemaFactory)
Configure a function to create the
GraphQLSchema instance from the
given TypeDefinitionRegistry and RuntimeWiring. |
GraphQlSource.Builder |
schemaResources(org.springframework.core.io.Resource... resources)
Add ".graphqls" schema resources to be
merged into the type registry. |
GraphQlSource.Builder |
typeVisitors(java.util.List<graphql.schema.GraphQLTypeVisitor> typeVisitors)
Add
GraphQLTypeVisitors to visit all element of the created
GraphQLSchema. |
GraphQlSource.Builder schemaResources(org.springframework.core.io.Resource... resources)
merged into the type registry.resources - resources for the GraphQL schemaSchemaParser.parse(File)GraphQlSource.Builder configureRuntimeWiring(RuntimeWiringConfigurer configurer)
RuntimeWiring.Builder
used to register DataFetchers, custom scalar
types, type resolvers, and more.configurer - the configurer to applySchemaGenerator.makeExecutableSchema(TypeDefinitionRegistry, RuntimeWiring)GraphQlSource.Builder defaultTypeResolver(graphql.schema.TypeResolver typeResolver)
TypeResolver to use for GraphQL Interface
and Union types that don't already have such a registration after all
RuntimeWiringConfigurer's
have been applied.
A GraphQL TypeResolver is used to determine the GraphQL Object
type of values returned from DataFetcher's of GraphQL Interface or
Union fields.
By default this is set to ClassNameTypeResolver, which
tries to match the simple class name of the Object value to a GraphQL
Object type, and it also tries the same for supertypes (base classes
and interfaces). See the Javadoc of ClassNameTypeResolver for
further ways to customize matching a Java class to a GraphQL Object type.
typeResolver - the TypeResolver to useClassNameTypeResolverGraphQlSource.Builder exceptionResolvers(java.util.List<DataFetcherExceptionResolver> resolvers)
DataFetcherExceptionResolver's to use for resolving exceptions from
DataFetcher's.resolvers - the resolvers to addGraphQlSource.Builder typeVisitors(java.util.List<graphql.schema.GraphQLTypeVisitor> typeVisitors)
GraphQLTypeVisitors to visit all element of the created
GraphQLSchema.
Note: Visitors are applied via
SchemaTraverser and cannot change the schema.
typeVisitors - the type visitorsSchemaTransformer.transformSchema(GraphQLSchema,
GraphQLTypeVisitor)GraphQlSource.Builder instrumentation(java.util.List<graphql.execution.instrumentation.Instrumentation> instrumentations)
Instrumentation components to instrument the execution of
GraphQL queries.instrumentations - the instrumentation componentsGraphQL.Builder.instrumentation(Instrumentation)GraphQlSource.Builder schemaFactory(java.util.function.BiFunction<graphql.schema.idl.TypeDefinitionRegistry,graphql.schema.idl.RuntimeWiring,graphql.schema.GraphQLSchema> schemaFactory)
GraphQLSchema instance from the
given TypeDefinitionRegistry and RuntimeWiring. This may
be useful for federation to create a combined schema.
By default, the schema is created with
SchemaGenerator.makeExecutableSchema(graphql.schema.idl.TypeDefinitionRegistry, graphql.schema.idl.RuntimeWiring).
schemaFactory - the function to create the schemaGraphQlSource.Builder configureGraphQl(java.util.function.Consumer<graphql.GraphQL.Builder> configurer)
GraphQL.Builder used to
build GraphQL.configurer - the configurerGraphQlSource build()
GraphQlSource.