Skip to main content
Version: 3.x.x

Examples

A collection of example apps that use graphql-kotlin libraries to test and demonstrate usages can be found in the examples module.

Client Example#

A 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.

./gradlew bootRun

Once the app has started you can explore the example schema by opening Playground endpoint at http:.

Federation Example#

There is also an example of Apollo Federation with two Spring Boot apps using `` 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.

Spark Example#

The spark example provides a demonstration of delivering a GraphQL service via the Spark HTTP framework. This example also demonstrates how to include `` in your query execution. This example can be found at examples/spark

Last updated on by jgorman-exp