v3.14.0
Breaking Changes📦 apollo-clientView on GitHub →
⚠ 1 breaking✨ 1 features🐛 1 fixes⚡ 8 deprecations🔧 12 symbols
Summary
This minor release adds extensive deprecation warnings for APIs removed in Apollo Client 4.0 and introduces `preloadQuery.toPromise` as the new way to await preloaded queries, along with a fix for field‑policy merging.
⚠️ Breaking Changes
- Removed `queryRef.toPromise()`; callers must replace it with `preloadQuery.toPromise(queryRef)`.
Migration Steps
- Replace all calls to `queryRef.toPromise()` with `preloadQuery.toPromise(queryRef)`.
- Review and update any usage of deprecated React Apollo APIs; consult deprecation warnings.
- Remove usage of `addTypename` in `InMemoryCache` and `MockedProvider` or switch to the new configuration.
- Stop using `canonizeResults`; migrate to the recommended alternatives.
- If you rely on `cache.gc()` resetting `addTypenameTransform` and `fragments` caches, ensure `resetResultCache` is set to `true` to retain previous behavior.
- Address any warnings about using `standby` fetch policy with `client.query`.
✨ New Features
- Added `preloadQuery.toPromise(queryRef)` as the new API for awaiting a preloaded query.
🐛 Bug Fixes
- Fixed field policies so they no longer overwrite or merge into supertype field policies.
🔧 Affected Symbols
queryRef.toPromisepreloadQuery.toPromiseApolloClientInMemoryCache.addTypenameMockedProvider.addTypenamecanonizeResultsclient.queryobservableQuery.refetchclient.mutateclient.subscribecache.gcfield policies⚡ Deprecations
- Deprecated remaining APIs changed in Apollo Client 4.0 (various methods and options).
- Deprecated options and methods for all React APIs.
- Deprecated properties returned from any query API (`client.query`, `observableQuery.refetch`, etc.), `client.mutate`, and `client.subscribe` that are no longer available in Apollo Client 4.0.
- `queryRef.toPromise()` is deprecated and has been removed; use `preloadQuery.toPromise` instead.
- Deprecated `ApolloClient` options and methods.
- Deprecated `addTypename` option in `InMemoryCache` and `MockedProvider`.
- Deprecated `canonizeResults`.
- Deprecated use of `standby` fetch policy with `client.query` (now only warns).