Skip to content

Commit

Permalink
update migration guide for v3 (#6288)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin authored Nov 28, 2024
1 parent d70de83 commit f9ff75a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/source/migration/3.0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ val response = apolloClient.query(request)
Watchers now default to a `CacheOnly` refetchPolicy instead `CACHE_FIRST`. To keep behaviour unchanged, set a `refetchPolicy` on your watchers:

```kotlin
// Replace
val response = apolloClient.query(query)
.watcher()
.toFlow()
Expand All @@ -509,6 +510,18 @@ val response = apolloClient.query(query)
.watch()
```

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.

```kotlin
// Replace
apolloClient.apolloStore.publish("User:42")

// With
apolloClient.apolloStore.publish("User:42.name")

```


#### `CacheKeyResolver`

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

0 comments on commit f9ff75a

Please sign in to comment.