graphql-kotlin
website·Indexed 41 days ago
https://opensource.expediagroup.com/graphql-kotlin/docs/A library for implementing GraphQL servers in Kotlin, featuring a schema generator that uses reflection to automatically create GraphQL schemas from Kotlin code. It includes support for Spring Boot, Maven plugins for downloading Schema SDL via introspection, and tools for handling custom scalars, directives, and unions. Documentation covers versions 3.x.x, 4.x.x, and 6.x.x.
What's inside graphql-kotlin
- The GraphQL Kotlin Maven Plugin allows developers to generate a lightweight GraphQL HTTP client and generate GraphQL schemas directly from source code. Note that this plugin depends on the Kotlin compiler plugin because it generates Kotlin source code that must be compiled.
Overview of GraphQL Kotlin Maven Plugin
The GraphQL Kotlin Maven Plugin allows developers to generate a lightweight GraphQL HTTP client and generate GraphQL schemas directly from source code. Note that this plugin depends on the Kotlin compiler plugin because it generates Kotlin source code that must be compiled.Overview of GraphQL Kotlin Client features
GraphQL Kotlin provides lightweight type-safe GraphQL HTTP clients with reference implementations for Ktor and Spring WebClient. Key features include:
- Support for query, mutation, and batch operations.
- Automatic generation of type-safe Kotlin models compatible with
kotlinx.serializationandJackson. - Custom scalar support (defaults to String).
- Support for default enum values to handle unknown server values.
- Native coroutine support.
- Documentation generated from the underlying GraphQL schema.
Overview of GraphQL Kotlin Client features
GraphQL Kotlin provides lightweight, type-safe GraphQL HTTP clients with reference implementations for Ktor and Spring WebClient. It generates type-safe data models at build time using Gradle or Maven plugins. Key features include:
- Support for query, mutation, and batch operations.
- Automatic generation of Kotlin models supporting
kotlinx.serializationandJackson. - Custom scalar support (defaults to String).
- Support for default enum values to handle unknown server values.
- Native coroutine support.
- Documentation generated from the underlying GraphQL schema.
Overview of Automatic Persisted Queries (APQ)
Automatic Persisted Queries (APQ) improve GraphQL network performance by allowing clients to send a unique identifier (SHA-256 hash) instead of the full query string. The server caches the parsed and validated query document (AST) associated with this hash. If the server has the query cached, the request payload is significantly smaller, reducing bandwidth and improving load times.Overview of GraphQL Kotlin Maven Plugin
Thegraphql-kotlin-maven-pluginprovides functionality to generate a lightweight GraphQL HTTP client and generate GraphQL schemas directly from source code. Note that this plugin depends on the Kotlin compiler plugin because it generates Kotlin source code that must be compiled.# Get detailed information about the plugin and its goals mvn help:describe -Dplugin=com.expediagroup:graphql-kotlin-maven-plugin -DdetailOverview of Automatic Persisted Queries (APQ)
Automatic Persisted Queries (APQ) improve GraphQL network performance by reducing the size of HTTP requests. Instead of sending a full query string, clients send a unique SHA-256 hash identifier. The server caches the parsed and validated query document (AST) associated with this hash. If the server doesn't have the hash, the client sends the full query once, and the server persists it for subsequent requests.Overview of GraphQL Kotlin Client
GraphQL Kotlin provides lightweight, type-safe GraphQL HTTP clients with reference implementations for Ktor and Spring WebClient. It supports query and mutation operations, batch operations, and native coroutines. The library automatically generates type-safe Kotlin models supportingkotlinx.serializationandJacksonformats. Custom scalars default to String but are configurable, and default enum values are supported to handle unknown server values.Overview of GraphQL Kotlin Client features
GraphQL Kotlin provides lightweight, type-safe GraphQL HTTP clients with reference implementations for Ktor and Spring WebClient. Key features include:
- Support for query, mutation, and batch operations.
- Automatic generation of type-safe Kotlin models compatible with
kotlinx.serializationandJackson. - Native coroutine support.
- Custom scalar support (defaults to String).
- Support for default enum values to handle unknown server values.
- Build-time code generation via Gradle and Maven plugins.
Overview of GraphQL Kotlin Client features
GraphQL Kotlin provides lightweight, type-safe GraphQL HTTP clients with reference implementations for Ktor and Spring WebClient. Key features include:
- Support for query, mutation, and batch operations.
- Automatic generation of type-safe Kotlin models supporting
kotlinx.serializationandJackson. - Native coroutine support.
- Custom scalar support (defaults to String).
- Support for default enum values to handle unknown server values.
- Documentation generated from the underlying GraphQL schema.
Overview of GraphQL Kotlin type-safe clients
GraphQL Kotlin provides lightweight type-safe GraphQL HTTP clients with reference implementations for Ktor and Spring WebClient. The library supports query and mutation operations, batch operations, and native coroutines. Type-safe data models are generated at build time via Gradle or Maven plugins, supporting bothkotlinx.serializationandJacksonformats. Custom scalars default to String but are configurable, and default enum values are supported to handle unknown server values.Overview of GraphQL Kotlin Client
GraphQL Kotlin provides lightweight, type-safe GraphQL HTTP clients with reference implementations for Ktor and Spring WebClient. It uses Gradle and Maven plugins to generate type-safe Kotlin data models at build time based on a GraphQL schema. Key features include support for queries, mutations, batch operations, coroutines, and automatic generation of models supportingkotlinx.serializationandJackson.