Skip to main content
Version: 7.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 by using the provided Maven or Gradle. Example integration using Maven and Gradle plugins can be found under the examples/client folder.

Federation Example

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.

Server Examples

Example integrations of graphql-kotlin-schema-generator with number of popular application frameworks can be found under examples/server folder.

These examples also demonstrates how to include DataLoaders in your query execution.

Ktor Server Example

Ktor is an asynchronous framework for creating microservices, web applications, and more. Example integration can be found at examples/server/ktor-server

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 graphiql is provided as a examples/server/spring-server. All the examples used in this documentation should be available in this 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:.