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
Generate connectionTypes and embeddedFields in Cache object. (#230)
* Generate connectionTypes and embeddedFields in Cache object.
* Make TypePolicy and EmbeddedFields inline value classes.
* Doc: remove mention of `paginationArgs` (deprecated) and use `FieldKeyGenerator` instead
* Revert bad .md change
* Formatting
* Fix test
* Fix tests
* Update Changelog
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,11 @@
2
2
3
3
PUT_CHANGELOG_HERE
4
4
5
+
- Pagination API tweaks (#230)
6
+
- Configuring connection fields with `@typePolicy(connectionFields: "...")` is deprecated. Instead, apply `@connection` to the connection types.
7
+
- Configuring pagination arguments with `@fieldPolicy(forField: "...", paginationArgs: "...")` is deprecated. Instead, configure a `FieldKeyGenerator` on your cache.
8
+
- The API of `EmbeddedFieldsProvider` has been tweaked to allow determining if fields should be embedded field by field, rather than all at once based on the type.
Copy file name to clipboardExpand all lines: Writerside/topics/pagination/pagination-other.md
+45-12Lines changed: 45 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,36 @@ with more configuration needed.
5
5
6
6
#### Pagination arguments
7
7
8
-
The `@fieldPolicy` directive has a `paginationArgs` argument that can be used to specify the arguments that should be omitted from the fieldkey.
8
+
Arguments that should be omitted from the field key can be specified programmatically by configuring your cache with a [`FieldKeyGenerator`](https://apollographql.github.io/apollo-kotlin-normalized-cache/kdoc/normalized-cache/com.apollographql.cache.normalized.api/-field-key-generator/index.html?query=interface%20FieldKeyGenerator) implementation:
9
9
10
-
Going back to [the example](pagination-home.md) with `usersPage`:
Copy file name to clipboardExpand all lines: normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/ApolloCacheCompilerPlugin.kt
Copy file name to clipboardExpand all lines: normalized-cache-apollo-compiler-plugin/src/main/kotlin/com/apollographql/cache/apollocompilerplugin/internal/CacheSchemaCodeGenerator.kt
0 commit comments