graphql-kotlin-spring-server provides a Spring specific implementation of GraphQLContextFactory and the context.
SpringGraphQLContext- Implements the Spring
ServerRequestand federation tracing
SpringGraphQLContextFactory- Generates a
If you are using
graphql-kotlin-spring-server, you should extend
SpringGraphQLContextFactory to maintain support with all the other features.
Once your application is configured to build your custom
MyGraphQLContext, you can then specify it as function argument.
While executing the query, the corresponding GraphQL context will be read from the environment and automatically injected to the function input arguments.
This argument will not appear in the GraphQL schema.
For more details, see the Contextual Data Documentation.
If you need federation tracing support, you can set the appropiate configuration properties.
SpringGraphQLContext implements the required federation methods for tracing, so as long as you extend this context class you will maintain feature support.