Skip to content

Releases: ExpediaGroup/graphql-kotlin

7.0.1

21 Sep 18:22
742b49f
Compare
Choose a tag to compare

Patch Changes

Other Changes

7.0.0

18 Sep 22:47
11c24e8
Compare
Choose a tag to compare

🎉 GraphQL Kotlin 7.0.0!

After over a hundred PRs and numerous pre-releases, we are pleased to announce the 7.0.0 release!

Major Changes and Features

Ktor GraphQL Server Plugin

Ktor is a lightweight web framework from Jetbrains. Its built in Kotlin using Coroutines and follows a functional configuration style where we have to explicitly configure our server with the features that we want to use.
Starting with GraphQL Kotlin v7, we now provide an official Ktor Server Plugin to simplify your GraphQL Ktor server development!

class HelloWorldQuery : Query {
    fun hello(): String = "Hello World!"
}

fun Application.graphQLModule() {
    install(GraphQL) {
        schema {
            packages = listOf("com.example")
            queries = listOf(
                HelloWorldQuery()
            )
        }
    }
    install(Routing) {
        graphQLPostRoute()
    }
}

Check out documentation for details.

GraphQL WS Subscription Support

Ktor and Spring GraphQL servers now provide out-of-box support for GraphQL subscriptions using GraphQL WS protocol.

Spring support for Apollo subscription transport ws was deprecated and will be removed in future releases.

GraalVM support

GraalVM is a high performance JDK distribution from Oracle that supports Ahead-of-Time (AOT) compilation. AOT allows you to build highly optimized native images that have milisecond startup times with immediate peak performance without the overhead of running JVM.

GraphQL Kotlin v7 provides out-of-box support for creating native GraalVM Ktor and Spring GraphQL servers. Maven and Gradle plugins were updated to provide new goal/task to auto-generate GraalVM reachability metadata.

Check out plugin documentation (Gradle | Maven) for more details or watch my
Supercharge your GraphQL with Ktor and GraalVM (KotlinConf 2023) talk for a live demo!

Drop support for GraphQLContext interface

graphql-java v17 introduced new GraphQL context mechanism which standardized how context should be utilized. Prior to v17, context could be of any object and it was up to the developers to decide how it should look like. This old "any" object context mechanism is currently deprecated and will be removed in future versions of graphql-java. "New" GraphQLContext standardizes the approach and is a simple wrapper around a map.

With GraphQL Kotlin v7 we dropped the support for old context mechanism and generic GraphQLContext interface is no longer available. Standardized context map is the only supported mechanism. See documentation for details.

Include GraphiQL IDE

GraphiQL is the official GraphQL IDE backed by the GraphQL Foundation and is now the default IDE included with all graphql-kotlin-server implementations.

GraphQL Playground is still available in graphql-kotlin-spring-server through explicit opt-in mechanism. Playground integration was deprecated and will be removed in future releases.

Apollo Federation v2.5 Support

Library now defaults to Apollo Federation v2 and users have to explicitly opt-out into Federation v1 schemas. To avoid potential conflicts on imported elements, Federation logic was also updated to support namespacing and renaming of the imported types.

By default, graphql-kotlin will continue to apply @link directive using latest supported federation specification but will only auto-import federation specific directives up to version 2.3 and only if they are present (i.e. applied to an element) in the schema. All new fed v2.4+ won't be included in the auto-imports and instead will be namespaced with the spec name, e.g. @federation__authenticated.

Users can provide custom @link information by providing a schema object with @LinkDirective information, e.g.

@LinkDirective(url = "https://specs.apollo.dev/federation/v2.3", `as`: "fed", import = [LinkImport(name = "@key", `as` = "@myKey"), LinkImport(name = "@requires")])
class MyCustomLinkSchema

Will generate following schema

schema @link(as: "fed", import : [{name : "@key", as : "@myKey"}, "@requires"], url : "https://specs.apollo.dev/federation/v2.3"){
  query: Query
}

// directive imported with custom name
"Space separated list of primary keys needed to access federated object"
directive @myKey(fields: fed__FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE

// directive imported with same name
"Specifies required input field set from the base type for a resolver"
directive @requires(fields: fed__FieldSet!) on FIELD_DEFINITION

// type imported with custom namespace
"Federation type representing set of fields"
scalar fed__FieldSet

Java 17 and Kotlin 1.8 Baseline

We were previously targeting Java 8 byte code to match graphql-java target. Java 8 was released over 9 years ago and with Java 21 LTS just around the corner, many libraries started to move towards relying on newer versions of Java. With graphql-java finally moving to Java 11 target and Spring Boot v3 requiring Java 17, we also updated our compilation target to Java 17.

While Kotlin currently does not benefit directly from new Java features, your applications will benefit tremendously from multidue of security and performance improvements in new JVM versions.

All Changes

Full Changelog: c65f2a1...11c24e8

Major Changes

Minor Changes

Patch Changes

Read more

6.5.6

14 Sep 16:33
194328a
Compare
Choose a tag to compare

What's Changed

Full Changelog: 6.5.5...6.5.6

7.0.0-alpha.7

12 Sep 22:47
8cc8169
Compare
Choose a tag to compare
7.0.0-alpha.7 Pre-release
Pre-release

Major Changes

Minor Changes

Patch Changes

  • fix: apply a thread safe lock over dataloaders (#1838) @samuelAndalon
  • chore: update dependencies to the latest (#1835) @dariuszkuc
  • Keep response content type to application/json as default instead of application/graphql-response+json (#1832) @gumimin
  • Ktor Server: set "graphql-transport-ws" as default protocol to graphQLSubscriptionsRoute (#1804) @thevietto
  • fix(batching): avoid calculating document ast height in advance (#1800) @samuelAndalon
  • fix: avoid calling the DFE supplier in batching instrumentations (#1797) @samuelAndalon
  • fix: honor LightDataFetcher on by level batching logic (#1795) @samuelAndalon

Other Changes

New Contributors

Full Changelog: 7.0.0-alpha.6...7.0.0-alpha.7

6.5.5

12 Sep 18:11
13c91fb
Compare
Choose a tag to compare

What's Changed

Full Changelog: 6.5.3...6.5.5

6.5.4

12 Sep 16:51
13c91fb
Compare
Choose a tag to compare

DID NOT RELEASE DO NOT USE - USE 6.5.5 INSTEAD

What's Changed

Full Changelog: 6.5.3...6.5.4

6.5.3

19 Jun 01:58
5341525
Compare
Choose a tag to compare

What's Changed

Full Changelog: 6.5.2...6.5.3

6.5.2

06 Jun 21:52
4ca522a
Compare
Choose a tag to compare

What's Changed

Full Changelog: 6.5.1...6.5.2

6.5.1

06 Jun 18:20
5d3a9cb
Compare
Choose a tag to compare

What's Changed

Full Changelog: 6.5.0...6.5.1

7.0.0-alpha.6

03 Jun 23:01
ecdb854
Compare
Choose a tag to compare
7.0.0-alpha.6 Pre-release
Pre-release

Minor Changes

  • feat(server): pass graphQLContext to KotlinDataLoaderRegistryFactory by @samuelAndalon in #1785
  • feat(server): Add subscriptions support to ktor server by @thevietto in #1774
  • feat(plugin): GraalVM native image support for Spring server by @dariuszkuc in #1769
  • feat(plugin): new generate-graalvm-metadata Maven goal by @dariuszkuc in #1759
  • feat(dataloader): FederatedTypePromiseResolver to settle all promises regardless of errors by @samuelAndalon in #1753

Patch Changes

Other Changes

New Contributors

Full Changelog: 7.0.0-alpha.5...7.0.0-alpha.6