diff --git a/docs/source/migration/3.0.mdx b/docs/source/migration/3.0.mdx index e419ff6c311..9c15b741866 100644 --- a/docs/source/migration/3.0.mdx +++ b/docs/source/migration/3.0.mdx @@ -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() @@ -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: