Graphql Kotlin Versions Save

Libraries for running GraphQL in Kotlin

6.8.0

4 weeks ago

What's Changed

Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/6.7.0...6.8.0

7.1.1

4 weeks ago

What's Changed

Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/7.1.0...7.1.1

7.1.0

1 month ago

Minor Changes

  • feat(federation): federation v2.6 support (#1928) @dariuszkuc
  • feat: allow additional parser options in the gradle and maven plugins (#1925) @mgilbey

Patch Changes

  • fix(federation): fix @authenticated directive name (#1927) @dariuszkuc
  • fix: allow maven and gradle plugins to have new parser options values configurable (#1930) @mgilbey
  • Handle subscription init timeout gracefully (#1915) @pdambrauskas
  • fix: create MessageDigest when needed (#1906) @samuelAndalon
  • fix: move federation validations to didBuildSchema hook (#1883) @dariuszkuc

Other Changes

  • chore: update to latest dependencies (#1950) @dariuszkuc
  • feat(batching): Exclude operations that failed pre-executions (#1942) @samuelAndalon
  • feat(servers): move execution out of reactor netty threads (#1943) @samuelAndalon
  • Handle exception on subscription initialization (#1940) @pdambrauskas
  • feat: kotlinx serialization for GraphQLServerRequest (#1937) @samuelAndalon
  • chore(docs): update website to Docuraurus V3 (#1929) @dariuszkuc
  • Update Ktor to 2.3.7 (#1916) @scottkennedy
  • feat: pass ExecutionInput to getOrElse method (#1918) @samuelAndalon
  • Fixed link to GraphQL documentation (#1900) @simboel
  • [Documentation] Fixed error in GraalVM native image docs (#1897) @simboel

6.7.0

1 month ago

What's Changed

Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/6.6.0...6.7.0

6.6.0

3 months ago

What's Changed

Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/6.5.7...6.6.0

6.5.7

4 months ago

What's Changed

Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/6.5.6...6.5.7

7.0.2

6 months ago

Patch Changes

  • Rewrite CompletableFutureExtension.allSettled to not use CompletableFuture.supplyAsync (#1872) @roookeee
  • fix(federation): skip fieldset validation when it includes type reference (#1861) @dariuszkuc
  • fix(federation): update federated hooks to support flow (#1864) @dariuszkuc

Other Changes

  • chore: update to latest Gradle and Maven versions (#1875) @dariuszkuc
  • chore: Update plugin goals in documentation (#1871) @eocantu
  • fix: Ktor Subscriptions wrong url #1863 (#1865) @charlee-dev

7.0.1

7 months ago

Patch Changes

  • open class KtorGraphQLRequestParser (#1856) @JajaComp
  • chore: update graphiql 3.0.6 (#1855) @samuelAndalon

Other Changes

  • chore: bump min node version to 18 (#1849) @dariuszkuc
  • chore: update docusaurus to point to v7 docs as latest (#1848) @dariuszkuc

7.0.0

7 months ago

🎉 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: https://github.com/ExpediaGroup/graphql-kotlin/compare/c65f2a1...11c24e8

Major Changes

  • BREAKING(feat(federation)): full @link support (#1816) @dariuszkuc
  • update to Kotlin 1.8 (#1822) @dariuszkuc
  • BREAKING(generator): use new willBuildSchema/didBuildSchema (#1817) @dariuszkuc
  • BREAKING CHANGE(generator): make dependency on ClassGraph optional (#1733) @dariuszkuc
  • BREAKING CHANGE(generator): update functionDataFetcherFactory to accept KClass (#1732) @dariuszkuc
  • feat: add and use graphiql as default for browser IDE (#1623) @samuelAndalon
  • update to SpringBoot 3 and Java 17 (#1638) @dariuszkuc
  • [federation] default to Federation v2 (#1585) @dariuszkuc
  • feat: remove usage of GraphQLContext interface (#1580) @samuelAndalon
  • feat: CompletableFuture in FederatedTypeResolver, standardize entities resolver with other subgraph implementations (#1514) @samuelAndalon

Minor Changes

  • feat: support Apollo Federation 2.5 (#1839) @dariuszkuc
  • feat(generator): introduce new didGenerateDirective hook (#1818) @dariuszkuc
  • feat(server): generic GraphQL WS subscription support (#1810) @dariuszkuc
  • support subdirectories in maven/gradle client plugins (#1809) @robp94
  • add automatic persisted queries implementation to client (#1802) @gumimin
  • feat(server): pass graphQLContext to KotlinDataLoaderRegistryFactory (1785) @samuelAndalon
  • feat(server): Add subscriptions support to ktor server (#1774) @thevietto
  • feat(plugin): GraalVM native image support for Spring server (#1769) by @dariuszkuc
  • feat(plugin): new generate-graalvm-metadata Maven goal (#1759) @dariuszkuc
  • feat(dataloader): FederatedTypePromiseResolver to settle all promises regardless of errors (#1753) @samuelAndalon
  • feat(plugin): new GraalVm metadata Gradle task (#1743) @dariuszkuc
  • feat: new GraalVM reflect metadata generator (#1739) @dariuszkuc
  • add ktor server plugin module (#1667 #1688) @dariuszkuc
  • federation: add support for Apollo Federation subgraph spec v2.3 (#1661) @dariuszkuc
  • feat: add missing async leafs use case to sync exhaustion (#1612) @samuelAndalon
  • feat: add graphiql explorer plugin (#1624) @samuelAndalon
  • feat: add explorer and exporter plugins (#1626) @samuelAndalon
  • plugin: allow configuring streamed response for introspection task/mojo (#1639) @dariuszkuc
  • feat: config property to print schema (#1641) @samuelAndalon
  • [federation] add support for Fed 2.1 (#1591) @dariuszkuc
  • Configure client generate parser options (#1586) @mgilbey
  • [client] update Jackson client to always annotate input fields (#1579) @dariuszkuc
  • feat: graphQL errors per federated type element in batch (#1568) @samuelAndalon
  • feat: DataFetchingEnvironment extensions to access to entries in GraphQLContext (#1552) @samuelAndalon

Patch Changes

  • dependency updates
    • chore: update dependencies to the latest (#1780 #1835) @dariuszkuc
    • build(deps): bump junit from 5.9.1 to 5.9.2 (#1716) @dependabot
    • feat: update graphql-java version (#1749) @samuelAndalon
    • update spring-boot to 2.7.5 (#1582) @tapaderster
    • Upgrade Ktor version to latest (#1714) @Nillkki
    • chore: update federation-jvm version to 2.2.0 (#1634) @samuelAndalon
    • [build] update to kotlin 1.7.21 (#1572 #1627) @samuelAndalon
  • feat: handle thread safe issue for getCurrentFutures (https://github.com/ExpediaGroup/graphql-kotlin/pull/1843) @younseunghyun
  • fix: apply a thread safe lock over dataloaders (#1838) @samuelAndalon
  • 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
  • fix(federation): relaxes @requires and @external constraints (#1778) @dariuszkuc
  • fix(dataloader): grab kotlinDataLoaderRegistry from environment (#1767) @samuelAndalon
  • fix(client): Improve alias handling in client generation (#1763) @WIStudent
  • fix(plugin): fix generated GraalVM metadata for property fields (#1757) @dariuszkuc
  • fix(server): Absolute urls for graphiql subscriptions (#1755) @jaaqo
  • fix(server): pin GraphiQL versions (#1735) @dariuszkuc
  • [ktor server] simplify KtorGraphQLRequestParser (#1704) @dariuszkuc
  • add support for application/graphql-response+json content type (#1699 #1832) @gumimin
  • fix(ktor-server): move plugin install to routing context (#1684) @lucsoft
  • fix(gradle-plugin): compileKotlin does not exist in Multiplatform (#1681) @nothendev
  • [federation] fix fed2 link imports (#1595) @dariuszkuc
  • [federation] remove unnecessary extends on Fed 2 Query (#1590) @dariuszkuc
  • [federation] fix @link definition and doc cleanup (#1588) @dariuszkuc
  • [build] update other references of springboot version (#1584) @samuelAndalon
  • [federation] cleanup validation rules (#1581) @dariuszkuc
  • ISSUE-1566: Relax federated type validation rules (#1571) @hchen
  • [federation] deprecate @extends directive (#1562) @dariuszkuc
  • [federation] fix override directive definition (#1555) @dariuszkuc
  • [federation] rename _FieldSet to FieldSet in Federation v2 (#1547) @dariuszkuc

Other Changes

  • documentation updates
    • Update data-loader page to fix typo (#1813) @T45K
    • Update arguments docs with DFE link (#1794) @smyrick
    • docs: cleanup tasks/mojos usage documentation (#1766) @dariuszkuc
    • docs: documentation for new GraalVm plugin tasks/goal (#1764) @dariuszkuc
    • chore: update examples README to point to graphiql (#1762) @samuelAndalon
    • docs: fix typo in generator-config.md (#1722) @tenstad
    • docs: update @composeDirective usage documentation (#1696) @dariuszkuc
    • docs: update v6 docs with fed2.3 info (#1686) @dariuszkuc
    • chore: add example how to use data loaders with suspendable functions (#1678) @samuelAndalon
    • [docs] custom scalars & optional/nullable types (#1574) @brycatch
    • [docs] update current version label to 7.x.x (#1551) @samuelAndalon
    • misc doc cleanup/updates (#1603 #1605 #1616 #1619 #1620 #1621 #1622 #1629 #1646)
  • build updates
    • fix: add explicit dependency between kapt and dokka (#1842) @dariuszkuc
    • fix federation composition integration (#1805) @dariuszkuc
    • build: update to gradle8 (#1726) @dariuszkuc
    • chore: disable flaky test by (#1789) @samuelAndalon
    • chore: add GraalVM integration tests to the CI workflow (#1745) @dariuszkuc
    • chore(build): gradle script cleanups (#1740) @dariuszkuc
    • chore: remove gradle duplicates from composite builds (#1721) @dariuszkuc
    • build: set permissions to deploy GH pages (#1724) @dariuszkuc
    • build: set permissions for release drafter (#1727) @dariuszkuc
    • chore: update actions/cache to v3 (#1707) @dariuszkuc
    • build: update PR fed check to use pull-requests permissions instead of issues (#1706) @dariuszkuc
    • build: fix fed action permissions (#1703) @dariuszkuc
    • build: refactor fed integration workflows to use pull_request event (#1701) @dariuszkuc
    • fix federation integration workflows (#1687) @dariuszkuc
    • migrate build to version catalog (#1630) @dariuszkuc
    • [build] add Apollo Federation Subgraph Compatibility tests (#1628 #1632 #1637) @dariuszkuc
    • build: migrate to use buildSrc and convention plugins (#1633) @dariuszkuc
    • build: use typesafe project accessors (#1635) @dariuszkuc
    • Bump Gradle to 7.6 (#1648) @martinbonnin
    • migrate Gradle plugin IT to a composite build (#1654 #1656 #1657 #1658 #1659)
    • [build] use reusable workflows to simplify actions (#1598) @dariuszkuc
    • [examples] Remove unrecognized JVM option (#1577) @smyrick
  • chore: update docusaurus to latest (#1836) @dariuszkuc
  • fix Ktor server DataLoader example usage (#1786) @dariuszkuc
  • GraalVM example integration (#1742) @dariuszkuc
  • feat: update graphiql packages cdn (#1737) @samuelAndalon
  • introduce graphql-over-http spec compliance tests (#1715) @dariuszkuc
  • Fix typo in NestedQueries.kt (#1689) @martinbonnin
  • chore: update to latest docusaurus version (#1668) @dariuszkuc
  • docs: arguments spelling mistake (#1669) @andydenk
  • fix: update federation PR workflows to check out correct codebase (#1671) @dariuszkuc
  • [federation] update federation example and enable tests (#1599) @dariuszkuc
  • chore: update instrumentation documentation (#1559) @samuelAndalon
  • start 7.x.x development (#1550) @samuelAndalon

New Contributors

6.5.6

8 months ago

What's Changed

Full Changelog: https://github.com/ExpediaGroup/graphql-kotlin/compare/6.5.5...6.5.6