Interface GraphQlSource.SchemaResourceBuilder
- All Superinterfaces:
GraphQlSource.Builder<GraphQlSource.SchemaResourceBuilder>
- Enclosing interface:
- GraphQlSource
public static interface GraphQlSource.SchemaResourceBuilder
extends GraphQlSource.Builder<GraphQlSource.SchemaResourceBuilder>
GraphQlSource
builder that relies on parsing schema definition
files and uses a RuntimeWiring
to create the underlying
GraphQLSchema
.-
Method Summary
Modifier and TypeMethodDescriptionconfigureRuntimeWiring
(RuntimeWiringConfigurer configurer) Configure the underlyingRuntimeWiring.Builder
to register data fetchers, custom scalar types, type resolvers, and more.configureTypeDefinitions
(TypeDefinitionConfigurer configurer) Customize theTypeDefinitionRegistry
created from parsed schema files, adding or changing schema type definitions before theGraphQLSchema
is created and validated.defaultTypeResolver
(TypeResolver typeResolver) Configure the defaultTypeResolver
to use for GraphQL interface and union types that don't have such a registration afterapplying
RuntimeWiringConfigurer
s.schemaFactory
(BiFunction<TypeDefinitionRegistry, RuntimeWiring, GraphQLSchema> schemaFactory) Configure a function to create theGraphQLSchema
from the givenTypeDefinitionRegistry
andRuntimeWiring
.schemaResources
(Resource... resources) Methods inherited from interface org.springframework.graphql.execution.GraphQlSource.Builder
build, configureGraphQl, exceptionResolvers, instrumentation, subscriptionExceptionResolvers, typeVisitors, typeVisitorsToTransformSchema
-
Method Details
-
schemaResources
- Parameters:
resources
- resources with GraphQL schema definitions- Returns:
- the current builder
-
configureTypeDefinitions
Customize theTypeDefinitionRegistry
created from parsed schema files, adding or changing schema type definitions before theGraphQLSchema
is created and validated.- Parameters:
configurer
- the configurer to apply- Returns:
- the current builder
- Since:
- 1.2
-
configureRuntimeWiring
Configure the underlyingRuntimeWiring.Builder
to register data fetchers, custom scalar types, type resolvers, and more.- Parameters:
configurer
- the configurer to apply- Returns:
- the current builder
-
defaultTypeResolver
Configure the defaultTypeResolver
to use for GraphQL interface and union types that don't have such a registration afterapplying
RuntimeWiringConfigurer
s.By default this is set to
ClassNameTypeResolver
.- Parameters:
typeResolver
- theTypeResolver
to use- Returns:
- the current builder
-
schemaFactory
GraphQlSource.SchemaResourceBuilder schemaFactory(BiFunction<TypeDefinitionRegistry, RuntimeWiring, GraphQLSchema> schemaFactory) Configure a function to create theGraphQLSchema
from the givenTypeDefinitionRegistry
andRuntimeWiring
. This may be used for federation to create a combined schema.By default, the schema is created with
SchemaGenerator.makeExecutableSchema(graphql.schema.idl.TypeDefinitionRegistry, graphql.schema.idl.RuntimeWiring)
.- Parameters:
schemaFactory
- the function to create the schema- Returns:
- the current builder
-