Automatically Created Beans
graphql-kotlin-spring-server
automatically creates all the necessary beans to start GraphQL web server. Many of the beans are conditionally created and default behavior
can be customized by providing custom beans in your application context. See sections below for the information about all automatically created beans.
Schema Generation
Bean | Description |
---|---|
FederatedSchemaGeneratorHooks | Schema generator hooks used to build federated schema. Created only if federation is enabled. |
FederatedSchemaGeneratorConfig | Federated schema generator configuration information. You can customize the configuration by providing TopLevelNames , FederatedSchemaGeneratorHooks and KotlinDataFetcherFactoryProvider beans.Created instead of default SchemaGeneratorConfig if federation is enabled. |
FederatedTypeRegistry | Default type registry without any resolvers. See Federated Type Resolution for more details. Created only if federation is enabled. You should register your custom type registry bean whenever implementing federated GraphQL schema with extended types. |
GraphQLSchema | GraphQL schema generated based on the schema generator configuration and Query , Mutation and Subscription objects available in the application context. |
KotlinDataFetcherFactoryProvider | Factory used during schema construction to obtain DataFetcherFactory that should be used for target function (using Spring aware SpringDataFetcher ) and property resolution. |
SchemaGeneratorConfig | Schema generator configuration information, see Schema Generator Configuration for details. Can be customized by providing TopLevelNames , SchemaGeneratorHooks and KotlinDataFetcherFactoryProvider beans. |
Execution
Bean | Description |
---|---|
ContextWebFilter | Default web filter that populates GraphQL context in the reactor subscriber context. |
DataFetcherExceptionHandler | GraphQL exception handler used from the various execution strategies, defaults to KotlinDataFetcherExceptionHandler. |
DataLoaderRegistryFactory | Factory used to create DataLoaderRegistry instance per query execution. See graphql-java documentation for more details. |
GraphQL | GraphQL query execution engine generated using GraphQLSchema with default async execution strategies. GraphQL engine can be customized by optionally providing a list of Instrumentation beans (which can be ordered by implementing Spring Ordered interface), ExecutionIdProvider and PreparsedDocumentProvider in the application context. |
GraphQLContextFactory | Factory used by context WebFilter to generate GraphQL context based on the incoming request. GraphQL context can be any object. Defaults to empty GraphQLContext. |
QueryHandler | Handler invoked from GraphQL query route that executes the incoming request, defaults to SimpleQueryHandler. |
SubscriptionHandler | Web socket handler for executing GraphQL subscriptions, defaults to SimpleSubscriptionHandler. Created only if Subscription bean is available in the context. |
WebSocketHandlerAdapter | See Spring documentation. Created only if Subscription bean is available in the context. |
The following beans are currently automatically created and cannot be disabled:
- Default routes for GraphQL queries/mutations and SDL endpoint
- Default route for Prisma Labs Playground, created only if playground is enabled
- Default
ApolloSubscriptionProtocolHandler
for handling GraphQL subscriptions, created only ifSubscription
bean is available in the context - Default
SubscriptionWebSocketHandler
that utilizes above subscription protocol handler, created only ifSubscription
bean is available in the context - Default subscription handler mapping, created only if
Subscription
bean is available in the context