Releases: ExpediaGroup/graphql-kotlin
8.0.0-alpha.1
What's Changed
- chore: start v8 development by @dariuszkuc in #1951
- fix: move exception handling into ktor statuspages by @curtiscook in #1936
- Fix links in documentation and add some additional info for DataFetchingEnvironment selectionSet by @mitjade in #1948
- chore: fix build by @dariuszkuc in #1953
- Support built-in
ID
type serialization inGraphQLServerRequest
by @T45K in #1952 - feat: ability to specify
@GraphQLName
on input types w/o suffix by @dariuszkuc in #1960 - Fix typo of
ktor-overview
website page by @T45K in #1968 - graphql java 22 update by @samuelAndalon in #1967
New Contributors
- @curtiscook made their first contribution in #1936
- @mitjade made their first contribution in #1948
Full Changelog: 7.1.1...8.0.0-alpha.1
7.1.1
What's Changed
- Support built-in
ID
type serialization inGraphQLServerRequest
by @samuelAndalon in #1958 - feat: ability to specify
@GraphQLName
on input types w/o suffix (#1960) by @samuelAndalon in #1962
Full Changelog: 7.1.0...7.1.1
6.8.0
What's Changed
- Support built-in
ID
type serialization inGraphQLServerRequest
by @samuelAndalon in #1959 - feat: ability to specify
@GraphQLName
on input types w/o suffix (#1… by @samuelAndalon in #1963
Full Changelog: 6.7.0...6.8.0
7.1.0
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
What's Changed
- feat: kotlinx serialization for GraphQLServerRequest -- cherry pick (#1937) by @samuelAndalon in #1944
- feat: execute graphQLRequest out of reactor netty threads ( cherry pick #1943) by @samuelAndalon in #1945
- feat(batching): Exclude operations that failed pre-executions (#1942) by @samuelAndalon in #1946
Full Changelog: 6.6.0...6.7.0
6.6.0
What's Changed
- feat: pass ExecutionInput to getOrElse method (#1918) by @samuelAndalon in #1919
Full Changelog: 6.5.7...6.6.0
6.5.7
What's Changed
- fix: create MessageDigest when needed by @samuelAndalon in #1908
Full Changelog: 6.5.6...6.5.7
7.0.2
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
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
🎉 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
- 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 (#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 batch...