The Spring Boot starter configures most parts by it self. You just have to configure your GraphQL schemas.
dependencies {
implementation("com.auritylab.graphql-kotlin-toolkit:spring-boot-starter:0.5.0")
}
<dependency>
<groupId>com.auritylab.graphql-kotlin-toolkit</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>0.5.0</version>
</dependency>
After adding the dependencies you need to tell the integration where to search for your schemas.
All you have to do is to add a Bean of type GQLSchemaSupplier
.
Using schema files which are located in your resources folder:
@Configuration
class GraphQLConfiguration {
@Bean
fun schemaSupplier() = GQLSchemaSupplier.ofResourceFiles(
"graphql/schema.graphqls"
// Other schema files
)
}