# GraphQL Kotlin: Server and Client Libraries

> GraphQL Kotlin is a collection of Kotlin libraries built on graphql-java for running GraphQL servers and clients. Its modules cover code-first schema generation, Apollo Federation, execution instrumentation, build plugins, and common HTTP client integrations.

**ExpediaGroup/graphql-kotlin** — Libraries for running GraphQL in Kotlin

- Repository: https://github.com/ExpediaGroup/graphql-kotlin
- Website: https://opensource.expediagroup.com/graphql-kotlin/
- Stars: 1,804 · Forks: 382
- Language: Kotlin
- License: Apache-2.0
- Published: 2026-10-16 · Updated: 2026-10-16 · Language: en
- Canonical page: https://hysenlabs.com/projects/expediagroup-graphql-kotlin

## GraphQL Kotlin’s Server and Client Scope

GraphQL Kotlin addresses teams that need GraphQL in Kotlin applications without assembling every server, client, schema, and build integration independently. It is a collection of stand-alone libraries built on top of graphql-java, so the project can be used for client code, server execution, schema generation, or a combination of those concerns. The README identifies the most common cases as running a server and generating a type-safe client.

The project is organized around modules rather than one application framework. The `clients` directory contains lightweight GraphQL Kotlin HTTP clients based on Ktor HTTP client and Spring WebClient. The `servers` directory contains common and library-specific modules for running a GraphQL server. This separation allows an application to adopt a client without taking on server dependencies, or to choose a server integration according to its runtime.

The repository also contains `examples`, including client, federation, and server examples, plus integration and build infrastructure. Those examples provide references for implementation patterns, but the README does not claim that they cover every production deployment arrangement.

## Schema Generation and Federation Support

The `generator` module provides a code-first schema generator and extensions to build Apollo Federation schemas. In a code-first approach, Kotlin types and resolver declarations are part of the source of the GraphQL schema instead of maintaining a separate schema definition as the primary model. This is a meaningful feature for Kotlin teams because schema changes can remain close to the application code that implements the operations.

Federation support is a separate concern from ordinary schema generation. The repository names extensions for building Apollo Federation schemas, and the `examples` directory includes a federation example. The README does not specify the supported federation version, subgraph configuration, entity annotations, or gateway deployment requirements, so those details cannot be assumed from the module name alone.

The project also includes `plugins` for Gradle and Maven. These plugins place schema work inside JVM build pipelines, which can help teams automate generation and integrate it with compilation. The README does not document task names, plugin configuration, or generated-code destinations. The individual module documentation is therefore necessary before configuring a build.

## Execution Instrumentation and Request Flow

At request time, GraphQL operations are handled by the server modules, while the `executions` module contains custom instrumentations for GraphQL operations. Instrumentation is the relevant extension point for observing or affecting operation execution. The repository description confirms that such custom instrumentations exist, but the README does not enumerate their lifecycle hooks, ordering guarantees, or configuration options.

The project sits above graphql-java rather than replacing it. GraphQL Kotlin adds Kotlin-facing modules and integrations around graphql-java. Applications that depend on a graphql-java extension should verify compatibility with the selected GraphQL Kotlin server module instead of assuming that every integration is included.

The available client integrations are also bounded by the repository layout. The README names Ktor HTTP client and Spring WebClient as foundations for the lightweight clients. A project requiring a different transport, a browser-specific client, or a non-JVM runtime would need to inspect the client module documentation before committing to this library.

## Building GraphQL Kotlin Locally

The repository does not provide a complete application install command in the README excerpt. It directs users to the documentation site for server and client setup, and it links to the `examples` directory for locally runnable examples. For contributors, the documented local build command is:

```shell script
./gradlew clean build
```

This command cleans and builds the repository with the Gradle wrapper. The reader should use the checked-in wrapper rather than assuming that a separate Gradle installation is available. The README refers to `CONTRIBUTING.md` for the full contribution workflow, so it does not establish which checks must pass for every downstream application change.

For an application, the README sends readers to separate server and client documentation sections rather than providing dependency coordinates or framework configuration here. The repository includes `examples/server/`, `examples/client/`, and `examples/federation/`. A first use can start by selecting the example closest to the intended integration, then checking the module documentation for the exact setup. No unverified package name, port, version, or environment variable should be added to the configuration.

## GraphQL Kotlin Compared with graphql-java

The clearest alternative is graphql-java by itself. GraphQL Kotlin explicitly builds on graphql-java. GraphQL Kotlin adds Kotlin-oriented libraries for code-first schema generation, clients, server integrations, federation, execution instrumentation, and Gradle and Maven tooling.

That distinction affects adoption. A team already using graphql-java may need GraphQL Kotlin only when it wants the Kotlin modules or code-first workflow. A Kotlin team that wants generated schemas, a Kotlin client abstraction, or a module-based server setup may find those pieces easier to assemble from this project. Conversely, GraphQL Kotlin is not documented as a complete replacement for every graphql-java plugin or API, so extension compatibility requires checking.

The client choice is narrower than the project name might suggest. GraphQL Kotlin documents clients based on Ktor HTTP client and Spring WebClient. A team requiring another HTTP stack should compare the module implementation with its transport requirements before selecting it.

## Upgrade Scope, Maintenance, and License

GraphQL Kotlin has a broad dependency surface because it includes clients, servers, generators, federation support, execution tools, plugins, integrations, and examples. An application that uses several modules must track their versions together. The README does not provide a compatibility matrix, migration policy, supported runtime matrix, or instructions for upgrading between major versions. Module-specific documentation and release notes are required before changing production dependencies.

The repository is not archived, and the last push was on 2026-10-13. The listed releases include `11.0.0` on 2026-10-07, followed by `11.0.0-alpha.3` and `11.0.0-alpha.2` in September 2026. These dates show recent repository activity and recent releases, but the README does not explain whether applications should upgrade directly to the final release. The release sequence makes version review particularly important.

The library is licensed under Apache License, Version 2.0. That license applies to the project source and distribution. An application still needs to consider its own dependencies, notices, and deployment obligations. This identifies the stated license and does not constitute legal advice.

## Conclusion

GraphQL Kotlin fits Kotlin teams that want GraphQL server or client capabilities while retaining a module-based ecosystem around graphql-java. It is less suitable for projects committed to a different HTTP stack or framework without checking the relevant module documentation first. Before adoption, verify module versions, framework configuration, generated schema behavior, deployment requirements, and the Apache-2.0 licensing implications for the application.

## FAQ

### What is GraphQL Kotlin used for?

GraphQL Kotlin is a collection of libraries built on graphql-java for running GraphQL clients and servers in Kotlin. Its modules cover clients, servers, schema generation, federation, execution instrumentation, and Gradle and Maven plugins.

### Does GraphQL Kotlin generate schemas from Kotlin code?

Yes. The repository describes the `generator` module as a code-first schema generator with extensions for building Apollo Federation schemas. The README excerpt does not provide the complete setup instructions.

### How do I build GraphQL Kotlin locally?

The README gives `./gradlew clean build` as the local Gradle build command. It also points contributors to `CONTRIBUTING.md` for the full contribution workflow.

## Sources

- [ExpediaGroup/graphql-kotlin on GitHub](https://github.com/ExpediaGroup/graphql-kotlin)
- [License: Apache-2.0](https://github.com/ExpediaGroup/graphql-kotlin/blob/master/LICENSE)
- [Project website](https://opensource.expediagroup.com/graphql-kotlin/)
- [README](https://github.com/ExpediaGroup/graphql-kotlin/blob/master/README.md)
- [Releases](https://github.com/ExpediaGroup/graphql-kotlin/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/expediagroup-graphql-kotlin
