A collection of example apps that use graphql-kotlin libraries to test and demonstrate usages can be found in the examples module.
graphql-kotlin-client can be generated using the Maven and Gradle plugins in
graphql-kotlin-plugins. For examples see the examples/client folder.
Spring Server Example
One way to run a GraphQL server is with Spring Boot. A sample Spring
Boot app that uses Spring
Webflux together with
graphql-kotlin-schema-generator and graphql-playground is provided as
a examples/spring. All the examples used
in this documentation should be available in the sample app.
In order to run it you can run Application.kt directly from your IDE. Alternatively you can also use the Spring Boot plugin from the command line.
Once the app has started you can explore the example schema by opening Playground endpoint at http://localhost:8080/playground.
There is also an example of Apollo Federation with two Spring Boot apps using
graphql-kotlin-federation and an Apollo Gateway app in Nodejs that exposes a single federated schema in examples/federation
project. Please refer to the README files for details on how to run each application.
The spark example provides a demonstration of delivering a GraphQL service via the Spark HTTP framework. This example also demonstrates how to include
DataLoaders in your query execution. This example can be found at examples/spark