In order to expose your queries, mutations, and subscriptions in the GraphQL schema create beans that
implement the corresponding marker interface and they will be automatically picked up by
will result in a Spring Boot reactive GraphQL web application with following schema.
Since the top level objects are Spring components, Spring will automatically autowire dependent beans as normal. Refer to Spring Documentation for details.
graphql-kotlin-spring-server provides Spring-aware data fetcher that automatically autowires Spring beans when they are
specified as function arguments.
@Autowired arguments should be explicitly excluded from the GraphQL schema by also
If you are using custom data fetcher make sure that you extend
SpringDataFetcher instead of the base
FunctionDataFetcher to keep this functionallity.
We have examples of these techniques implemented in Spring boot in the example app.