You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+52-4Lines changed: 52 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,54 @@ Change Log
2
2
==========
3
3
4
4
# Next version
5
+
# Version 5.0.0-alpha.0
6
+
7
+
This is the first alpha release of version 5.0.0. Previous `DeprecationLevel.WARNING` are turned into `DeprecationLevel.ERROR`. Previous `DeprecationLevel.ERROR` are removed.
8
+
9
+
For details about how to migrate, read the [migration guide draft](https://www.apollographql.com/docs/kotlin/v5/migration/5.0). This migration guide is still work in progress. Feedbacks are welcome as you try the new version!
*[breaking] Remove PackageNameGenerator and OperationOutputGenerator, replaced by compiler plugins ([#6494](https://github.com/apollographql/apollo-kotlin/pull/6494))
15
+
*[breaking] Move internal testing code to an unpublished module ([#6449](https://github.com/apollographql/apollo-kotlin/pull/6449))
16
+
*[upgrade] Bump ktor to 3.1.2 ([#6465](https://github.com/apollographql/apollo-kotlin/pull/6465))
17
+
*[breaking] Update deprecations for v5 ([#6496](https://github.com/apollographql/apollo-kotlin/pull/6496))
18
+
*[new] Move IJ plugin to its own repository ([#6574](https://github.com/apollographql/apollo-kotlin/pull/6574))
19
+
*[new] Switch publication to the central portal ([#6581](https://github.com/apollographql/apollo-kotlin/pull/6581))
20
+
21
+
Gradle
22
+
*[fix] Do not generate the version as const ([#6563](https://github.com/apollographql/apollo-kotlin/pull/6563))
23
+
*[new] Switch the gradle plugin to gratatouille ([#6524](https://github.com/apollographql/apollo-kotlin/pull/6524))
*[new] Introspection: add a hint that more details are available in the exception cause. ([#6590](https://github.com/apollographql/apollo-kotlin/pull/6590))
26
+
27
+
**Compiler**:
28
+
29
+
*[new] Add schema-transform API ([#6450](https://github.com/apollographql/apollo-kotlin/pull/6450))
30
+
*[new] Allow to generate Data Builders outside the main source set ([#6485](https://github.com/apollographql/apollo-kotlin/pull/6485))
31
+
*[breaking] Using @nonnull is now an error ([#6499](https://github.com/apollographql/apollo-kotlin/pull/6499))
32
+
*[fix] Ignore scalars/enums in checkCapitalizedFields ([#6502](https://github.com/apollographql/apollo-kotlin/pull/6502))
33
+
*[fix] Call DocumentTransform.transform after adding required fields ([#6510](https://github.com/apollographql/apollo-kotlin/pull/6510))
34
+
*[fix] Add key fields to selections even when they're already selected with an alias ([#6503](https://github.com/apollographql/apollo-kotlin/pull/6503))
35
+
*[fix] Transform the GraphQL documents before running validation ([#6511](https://github.com/apollographql/apollo-kotlin/pull/6511))
36
+
*[new] Add key fields of possible types of interfaces and fragments ([#6515](https://github.com/apollographql/apollo-kotlin/pull/6515))
37
+
*[new] Allow to register multiple Apollo Compiler plugins ([#6523](https://github.com/apollographql/apollo-kotlin/pull/6523))
38
+
39
+
**Runtime**:
40
+
41
+
*[new] Add cacheInterceptor() and autoPersistedQueriesInterceptor() ([#6455](https://github.com/apollographql/apollo-kotlin/pull/6455))
42
+
*[new] Add `ApolloCall.ignoreUnknownKeys` and `ApolloClient.Builder.ignoreUnknownKeys` ([#6473](https://github.com/apollographql/apollo-kotlin/pull/6473))
43
+
*[fix] fix the batch size not respected issue ([#6528](https://github.com/apollographql/apollo-kotlin/pull/6528))
44
+
*[fix] Fix losing response headers when using batch request ([#6538](https://github.com/apollographql/apollo-kotlin/pull/6538))
Copy file name to clipboardExpand all lines: docs/source/migration/5.0.mdx
+75-8Lines changed: 75 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,82 @@ subtitle: Step-by-step guide on migrating from Apollo Kotlin 4
4
4
description: Learn how to migrate from version 4 with key changes, new features, and tools designed for improved stability and maintainability. Follow step-by-step guidance and make a seamless transition
5
5
---
6
6
7
-
⚠️ This is a work in progress ⚠️
7
+
Apollo Kotlin 5 is mostly binary compatible with Apollo Kotlin 4 with a few exceptions:
8
8
9
-
Behaviour changes:
9
+
- Symbols that were `DeprecationLevel.ERROR` in v4 are now removed.
10
+
-`apollo-compiler` has breaking changes and is generally still considered unstable with the exception of persisted queries compiler plugins:
11
+
-`ApolloCompilerPlugin.beforeCompilationStep()`, `ApolloCompilerRegistry.registerOperationIdsGenerator()` and dependent symbols are stable and will go through the usual deprecation cycle if they ever need to change.
12
+
- The APIs used by the data builders generated sources (`buildData`, `ObjectBuilder`, `CustomScalarAdapters.PASSTHROUGH`...) have changed. This is not an issue unless you called those APIs directly or distributed data builders code in a library. In that last case, your consumers will have to update to Apollo Kotlin 5.
13
+
- A few symbols were not supposed to be exposed and have been removed:
We tried hard to minimize the impact of the binary changes so that running code compiled for v4 will run with v5. But the occasional incompatibility may happen. In that case, the incompatible libraries will need to compile against v5 and make a new release.
13
19
14
-
Removed APIs
20
+
## Removed `Service.operationOutputGenerator` and `Service.operationIdGenerator`
While running your `OperationOutputGenerator` directly in your build script classpath was convenient, it required the compiler code to run completely in the global buildscript classpath. This created numerous issues such as incompatible dependencies and/or unneeded build invalidations.
23
+
24
+
To mitigate the impact of incompatible dependencies, Apollo Kotlin 4 used to shadow and relocate all its dependencies, which came with additional issues: increased build times, weird stack traces and larger plugin size.
25
+
26
+
Apollo Kotlin v5 instead runs its compiler in isolated classloaders, meaning generating the ids now needs to happen in that same classloader.
27
+
28
+
To do so, use `ApolloCompilerPlugin`:
29
+
30
+
```kotlin
31
+
classMyPlugin : ApolloCompilerPlugin {
32
+
overridefunbeforeCompilationStep(
33
+
environment:ApolloCompilerPluginEnvironment,
34
+
registry:ApolloCompilerRegistry,
35
+
) {
36
+
registry.registerOperationIdsGenerator {
37
+
it.map { OperationId(it.source.md5(), it.name) }
38
+
}
39
+
}
40
+
}
41
+
```
42
+
43
+
Read more in the [persisted queries](https://www.apollographql.com/docs/kotlin/v5/advanced/persisted-queries) and [compiler plugins](https://www.apollographql.com/docs/kotlin/v5/advanced/compiler-plugins) pages.
44
+
45
+
46
+
47
+
## Removed ApolloIdlingResource
48
+
49
+
Apollo Kotlin 5 removes `ApolloIdlingResource`. `IdlingResource` usage has been slowly decreasing and there are now better alternatives to do your testing.
50
+
51
+
For a good overview of alternative solutions, we recommend [this article from Jose Alcérreca](https://medium.com/androiddevelopers/alternatives-to-idling-resources-in-compose-tests-8ae71f9fc473).
52
+
53
+
## Using `@nonnull` is now an error
54
+
55
+
Apollo Kotlin 4 had a `@nonnull` client directive to force generating fields as non-null.
56
+
57
+
Since `@nonnull`, we've worked hard with the [nullability working group](https://github.com/graphql/nullability-wg/) to improve the handling of null types in GraphQL.
58
+
59
+
As part of this effort, it was recognized that the nullability information belongs to the schema. Fields that are only nullable for error reasons can now be marked with `@semanticNonNull`:
0 commit comments