In order to expose your queries, mutations and/or subscriptions in the GraphQL schema you need to create beans that
implement corresponding marker interface and they will be automatically picked up by
will result in a Spring Boot reactive GraphQL web application with following schema.
Spring will automatically autowire dependent beans to our Spring query beans. 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
NOTE: if you are using custom data fetcher make sure that you extend
SpringDataFetcherinstead of a base
You can use Spring beans to wire different objects together at runtime. Instead of autowiring specific beans as properties, you can also dynamically resolve beans by using bean factories. There is an example of how to set this up in the example app in the TopLevelBeanFactoryQuery.kt.
We have examples of these techniques implemented in Spring boot in the example app.