Skip to content

Commit f9ff75a

Browse files
authored
update migration guide for v3 (#6288)
1 parent d70de83 commit f9ff75a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/source/migration/3.0.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ val response = apolloClient.query(request)
499499
Watchers now default to a `CacheOnly` refetchPolicy instead `CACHE_FIRST`. To keep behaviour unchanged, set a `refetchPolicy` on your watchers:
500500

501501
```kotlin
502+
// Replace
502503
val response = apolloClient.query(query)
503504
.watcher()
504505
.toFlow()
@@ -509,6 +510,18 @@ val response = apolloClient.query(query)
509510
.watch()
510511
```
511512

513+
Watchers are now only watching field keys such as `User:42.name` and not object keys such as `User:42`. This is so that query only get refetch when fields they actually watch change, not when the object changes.
514+
515+
```kotlin
516+
// Replace
517+
apolloClient.apolloStore.publish("User:42")
518+
519+
// With
520+
apolloClient.apolloStore.publish("User:42.name")
521+
522+
```
523+
524+
512525
#### `CacheKeyResolver`
513526

514527
The `CacheKeyResolver` API has been split in two different APIs:

0 commit comments

Comments
 (0)