apollographql/apollo-client (@apollo/client)
### [`v3.11.10`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#31110)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.9...v3.11.10)
##### Patch Changes
- [#12093](https://redirect.github.com/apollographql/apollo-client/pull/12093) [`1765668`](https://redirect.github.com/apollographql/apollo-client/commit/1765668b7d495ef8a581f697bf9e4b7460455f13) Thanks [@mgmolisani](https://redirect.github.com/mgmolisani)! - Fixed a bug when evaluating the devtools flag with the new syntax `devtools.enabled` that could result to `true` when explicitly set to `false`.
### [`v3.11.9`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3119)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.8...v3.11.9)
##### Patch Changes
- [#12110](https://redirect.github.com/apollographql/apollo-client/pull/12110) [`a3f95c6`](https://redirect.github.com/apollographql/apollo-client/commit/a3f95c6f7623060bbf68b418b0ab268fabc0c9b6) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix an issue where errors returned from a `fetchMore` call from a Suspense hook would cause a Suspense boundary to be shown indefinitely.
### [`v3.11.8`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3118)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.7...v3.11.8)
##### Patch Changes
- [#12054](https://redirect.github.com/apollographql/apollo-client/pull/12054) [`35cf186`](https://redirect.github.com/apollographql/apollo-client/commit/35cf186ed9237e41735f150e0cbf4edd995ab0d9) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Fixed a bug where incorrect object access in some Safari extensions could cause a crash.
### [`v3.11.7`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3117)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.6...v3.11.7)
##### Patch Changes
- [#12052](https://redirect.github.com/apollographql/apollo-client/pull/12052) [`e471cef`](https://redirect.github.com/apollographql/apollo-client/commit/e471cef875eadef04f8ee18ef431ee70e7b9bcab) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fixes a regression from where passing an invalid identifier to `from` in `useFragment` would result in the warning `TypeError: Cannot read properties of undefined (reading '__typename')`.
### [`v3.11.6`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3116)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.5...v3.11.6)
##### Patch Changes
- [#12049](https://redirect.github.com/apollographql/apollo-client/pull/12049) [`9c26892`](https://redirect.github.com/apollographql/apollo-client/commit/9c268927b1f8e5921b9440a53c9979a37f594e75) Thanks [@phryneas](https://redirect.github.com/phryneas) and [@maciesielka](https://redirect.github.com/maciesielka)! - Fix a bug where `useFragment` did not re-render as expected
- [#12044](https://redirect.github.com/apollographql/apollo-client/pull/12044) [`04462a2`](https://redirect.github.com/apollographql/apollo-client/commit/04462a274ad39b392142385a2f052abbf3014749) Thanks [@DoctorJohn](https://redirect.github.com/DoctorJohn)! - Cache the `useSubscription` hook's `restart` function definition between re-renders.
### [`v3.11.5`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3115)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.4...v3.11.5)
##### Patch Changes
- [#12027](https://redirect.github.com/apollographql/apollo-client/pull/12027) [`eb3e21b`](https://redirect.github.com/apollographql/apollo-client/commit/eb3e21b9f7fa6a3161705c2c7270129c17b65095) Thanks [@JavaScriptBach](https://redirect.github.com/JavaScriptBach)! - Type `MutationResult.reset` as an arrow function
- [#12020](https://redirect.github.com/apollographql/apollo-client/pull/12020) [`82d8cb4`](https://redirect.github.com/apollographql/apollo-client/commit/82d8cb4255be497748829f12eb25ac87c11ee5e4) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Better conform to Rules of React by avoiding write of ref in render for `useFragment`.
### [`v3.11.4`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3114)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.3...v3.11.4)
##### Patch Changes
- [#11994](https://redirect.github.com/apollographql/apollo-client/pull/11994) [`41b17e5`](https://redirect.github.com/apollographql/apollo-client/commit/41b17e5950f4db5ef9e32ded5bb327b3bf19e6e8) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Update the `Modifier` function type to allow `cache.modify` to return deeply partial data.
- [#11989](https://redirect.github.com/apollographql/apollo-client/pull/11989) [`e609156`](https://redirect.github.com/apollographql/apollo-client/commit/e609156c4989def88ae1a28b2e0f0378077a5528) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Fix a potential crash when calling `clearStore` while a query was running.
Previously, calling `client.clearStore()` while a query was running had one of these results:
- `useQuery` would stay in a `loading: true` state.
- `useLazyQuery` would stay in a `loading: true` state, but also crash with a `"Cannot read property 'data' of undefined"` error.
Now, in both cases, the hook will enter an error state with a `networkError`, and the promise returned by the `useLazyQuery` `execute` function will return a result in an error state.
- [#11994](https://redirect.github.com/apollographql/apollo-client/pull/11994) [`41b17e5`](https://redirect.github.com/apollographql/apollo-client/commit/41b17e5950f4db5ef9e32ded5bb327b3bf19e6e8) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Prevent accidental distribution on `cache.modify` field modifiers when a field is a union type array.
### [`v3.11.3`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3113)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.2...v3.11.3)
##### Patch Changes
- [#11984](https://redirect.github.com/apollographql/apollo-client/pull/11984) [`5db1659`](https://redirect.github.com/apollographql/apollo-client/commit/5db1659dc07e3de697894fc1c6f00a151d068291) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix an issue where multiple fetches with results that returned errors would sometimes set the `data` property with an `errorPolicy` of `none`.
- [#11974](https://redirect.github.com/apollographql/apollo-client/pull/11974) [`c95848e`](https://redirect.github.com/apollographql/apollo-client/commit/c95848e859fb7ce0b3b9439ac71dff880f991450) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix an issue where `fetchMore` would write its result data to the cache when using it with a `no-cache` fetch policy.
- [#11974](https://redirect.github.com/apollographql/apollo-client/pull/11974) [`c95848e`](https://redirect.github.com/apollographql/apollo-client/commit/c95848e859fb7ce0b3b9439ac71dff880f991450) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix an issue where executing `fetchMore` with a `no-cache` fetch policy could sometimes result in multiple network requests.
- [#11974](https://redirect.github.com/apollographql/apollo-client/pull/11974) [`c95848e`](https://redirect.github.com/apollographql/apollo-client/commit/c95848e859fb7ce0b3b9439ac71dff880f991450) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! -
##### Potentially disruptive change
When calling `fetchMore` with a query that has a `no-cache` fetch policy, `fetchMore` will now throw if an `updateQuery` function is not provided. This provides a mechanism to merge the results from the `fetchMore` call with the query's previous result.
### [`v3.11.2`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3112)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.1...v3.11.2)
##### Patch Changes
- [#11980](https://redirect.github.com/apollographql/apollo-client/pull/11980) [`38c0a2c`](https://redirect.github.com/apollographql/apollo-client/commit/38c0a2c43dd28677ee240754cd389c8a08c05738) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix missing `getServerSnapshot` error when using `useSubscription` on the server.
### [`v3.11.1`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3111)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.0...v3.11.1)
##### Patch Changes
- [#11969](https://redirect.github.com/apollographql/apollo-client/pull/11969) [`061cab6`](https://redirect.github.com/apollographql/apollo-client/commit/061cab6627abd4ec81f83c40c1d281c418627c93) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Remove check for `window.__APOLLO_CLIENT__` when determining whether to connect to Apollo Client Devtools when `connectToDevtools` or `devtools.enabled` is not specified. This now simply checks to see if the application is in development mode.
- [#11971](https://redirect.github.com/apollographql/apollo-client/pull/11971) [`ecf77f6`](https://redirect.github.com/apollographql/apollo-client/commit/ecf77f6f5b5ccf64cfba51e838e96549fb6c92fe) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Prevent the `setTimeout` for suggesting devtools from running in non-browser environments.
### [`v3.11.0`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3110)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.10.8...v3.11.0)
##### Potentially Breaking Fixes
- [#11789](https://redirect.github.com/apollographql/apollo-client/pull/11789) [`5793301`](https://redirect.github.com/apollographql/apollo-client/commit/579330147d6bd6f7167a35413a33746103e375cb) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Changes usages of the `GraphQLError` type to `GraphQLFormattedError`.
This was a type bug - these errors were never `GraphQLError` instances
to begin with, and the `GraphQLError` class has additional properties that can
never be correctly rehydrated from a GraphQL result.
The correct type to use here is `GraphQLFormattedError`.
Similarly, please ensure to use the type `FormattedExecutionResult`
instead of `ExecutionResult` - the non-"Formatted" versions of these types
are for use on the server only, but don't get transported over the network.
- [#11626](https://redirect.github.com/apollographql/apollo-client/pull/11626) [`228429a`](https://redirect.github.com/apollographql/apollo-client/commit/228429a1d36eae691473b24fb641ec3cd84c8a3d) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Call `nextFetchPolicy` with "variables-changed" even if there is a `fetchPolicy` specified.
Previously this would only be called when the current `fetchPolicy` was equal to the `fetchPolicy` option or the option was not specified. If you use `nextFetchPolicy` as a function, expect to see this function called more often.
Due to this bug, this also meant that the `fetchPolicy` might be reset to the initial `fetchPolicy`, even when you specified a `nextFetchPolicy` function. If you previously relied on this behavior, you will need to update your `nextFetchPolicy` callback function to implement this resetting behavior.
As an example, if your code looked like the following:
```js
useQuery(QUERY, {
nextFetchPolicy(currentFetchPolicy, info) {
// your logic here
}
);
```
Update your function to the following to reimplement the resetting behavior:
```js
useQuery(QUERY, {
nextFetchPolicy(currentFetchPolicy, info) {
if (info.reason === 'variables-changed') {
return info.initialFetchPolicy;
}
// your logic here
}
);
```
##### Minor Changes
- [#11923](https://redirect.github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://redirect.github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useQueryRefHandlers`.
- [#11854](https://redirect.github.com/apollographql/apollo-client/pull/11854) [`3812800`](https://redirect.github.com/apollographql/apollo-client/commit/3812800c6e4e5e3e64f473543babdba35ce100c2) Thanks [@jcostello-atlassian](https://redirect.github.com/jcostello-atlassian)! - Support extensions in useSubscription
- [#11923](https://redirect.github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://redirect.github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useLoadableQuery`.
- [#11863](https://redirect.github.com/apollographql/apollo-client/pull/11863) [`98e44f7`](https://redirect.github.com/apollographql/apollo-client/commit/98e44f74cb7c7e93a81bdc7492c9218bf4a2dcd4) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Reimplement `useSubscription` to fix rules of React violations.
- [#11869](https://redirect.github.com/apollographql/apollo-client/pull/11869) [`a69327c`](https://redirect.github.com/apollographql/apollo-client/commit/a69327cce1b36e8855258e9b19427511e0af8748) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Rewrite big parts of `useQuery` and `useLazyQuery` to be more compliant with the Rules of React and React Compiler
- [#11936](https://redirect.github.com/apollographql/apollo-client/pull/11936) [`1b23337`](https://redirect.github.com/apollographql/apollo-client/commit/1b23337e5a9eec4ce3ed69531ca4f4afe8e897a6) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Add the ability to specify a name for the client instance for use with Apollo Client Devtools. This is useful when instantiating multiple clients to identify the client instance more easily. This deprecates the `connectToDevtools` option in favor of a new `devtools` configuration.
```ts
new ApolloClient({
devtools: {
enabled: true,
name: "Test Client",
},
});
```
This option is backwards-compatible with `connectToDevtools` and will be used in the absense of a `devtools` option.
- [#11923](https://redirect.github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://redirect.github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useBackgroundQuery`.
- [#11930](https://redirect.github.com/apollographql/apollo-client/pull/11930) [`a768575`](https://redirect.github.com/apollographql/apollo-client/commit/a768575ac1454587208aad63abc811b6a966fe72) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Deprecates experimental schema testing utilities introduced in 3.10 in favor of recommending [`@apollo/graphql-testing-library`](https://redirect.github.com/apollographql/graphql-testing-library).
##### Patch Changes
- [#11951](https://redirect.github.com/apollographql/apollo-client/pull/11951) [`0de03af`](https://redirect.github.com/apollographql/apollo-client/commit/0de03af912a76c4e0111f21b4f90a073317b63b6) Thanks [@phryneas](https://redirect.github.com/phryneas)! - add React 19 RC to `peerDependencies`
- [#11927](https://redirect.github.com/apollographql/apollo-client/pull/11927) [`2941824`](https://redirect.github.com/apollographql/apollo-client/commit/2941824dd66cdd20eee5f2293373ad7a9cf991a4) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Add `restart` function to `useSubscription`.
- [#11949](https://redirect.github.com/apollographql/apollo-client/pull/11949) [`4528918`](https://redirect.github.com/apollographql/apollo-client/commit/45289186bcaaa33dfe904913eb6df31e2541c219) Thanks [@alessbell](https://redirect.github.com/alessbell)! - Remove deprecated `watchFragment` option, `canonizeResults`
- [#11937](https://redirect.github.com/apollographql/apollo-client/pull/11937) [`78332be`](https://redirect.github.com/apollographql/apollo-client/commit/78332be32a9af0da33eb3e4100e7a76c3eac2496) Thanks [@phryneas](https://redirect.github.com/phryneas)! - `createSchemaFetch`: simulate serialized errors instead of an `ApolloError` instance
- [#11902](https://redirect.github.com/apollographql/apollo-client/pull/11902) [`96422ce`](https://redirect.github.com/apollographql/apollo-client/commit/96422ce95b923b560321a88acd2eec35cf2a1c18) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Add `cause` field to `ApolloError`.
- [#11806](https://redirect.github.com/apollographql/apollo-client/pull/11806) [`8df6013`](https://redirect.github.com/apollographql/apollo-client/commit/8df6013b6b45452ec058fab3e068b5b6d6c493f7) Thanks [@phryneas](https://redirect.github.com/phryneas)! - MockLink: add query default variables if not specified in mock request
- [#11926](https://redirect.github.com/apollographql/apollo-client/pull/11926) [`3dd6432`](https://redirect.github.com/apollographql/apollo-client/commit/3dd64324dc5156450cead27f8141ea93315ffe65) Thanks [@phryneas](https://redirect.github.com/phryneas)! - `watchFragment`: forward additional options to `diffOptions`
- [#11946](https://redirect.github.com/apollographql/apollo-client/pull/11946) [`7d833b8`](https://redirect.github.com/apollographql/apollo-client/commit/7d833b80119a991e6d2eb58f2c71074d697b8e63) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix issue where mutations were not accessible by Apollo Client Devtools in 3.11.0-rc.0.
- [#11944](https://redirect.github.com/apollographql/apollo-client/pull/11944) [`8f3d7eb`](https://redirect.github.com/apollographql/apollo-client/commit/8f3d7eb3bc2e0c2d79c5b1856655abe829390742) Thanks [@sneyderdev](https://redirect.github.com/sneyderdev)! - Allow `IgnoreModifier` to be returned from a `optimisticResponse` function when inferring from a `TypedDocumentNode` when used with a generic argument.
- [#11954](https://redirect.github.com/apollographql/apollo-client/pull/11954) [`4a6e86a`](https://redirect.github.com/apollographql/apollo-client/commit/4a6e86aeaf6685abf0dd23110784848c8b085735) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Document (and deprecate) the previously undocumented `errors` property on the `useQuery` `QueryResult` type.
- [#11719](https://redirect.github.com/apollographql/apollo-client/pull/11719) [`09a6677`](https://redirect.github.com/apollographql/apollo-client/commit/09a6677ec1a0cffedeecb2cbac5cd3a3c8aa0fa1) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Allow wrapping `createQueryPreloader`
- [#11921](https://redirect.github.com/apollographql/apollo-client/pull/11921) [`70406bf`](https://redirect.github.com/apollographql/apollo-client/commit/70406bfd2b9a645d781638569853d9b435e047df) Thanks [@phryneas](https://redirect.github.com/phryneas)! - add `ignoreResults` option to `useSubscription`
### [`v3.10.8`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3108)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.10.7...v3.10.8)
##### Patch Changes
- [#11911](https://redirect.github.com/apollographql/apollo-client/pull/11911) [`1f0460a`](https://redirect.github.com/apollographql/apollo-client/commit/1f0460a60fc613e8d6f218a74ded69e81e960791) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Allow `undefined` to be returned from a `cache.modify` modifier function when a generic type argument is used.
### [`v3.10.7`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3107)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.10.6...v3.10.7)
##### Patch Changes
- [#11901](https://redirect.github.com/apollographql/apollo-client/pull/11901) [`10a8c0a`](https://redirect.github.com/apollographql/apollo-client/commit/10a8c0a8f6f3e13ec3c67bf53cc11a948b60e6d9) Thanks [@phryneas](https://redirect.github.com/phryneas)! - update `canUseLayoutEffect` check to also allow for layout effects in React Native
- [#11861](https://redirect.github.com/apollographql/apollo-client/pull/11861) [`1aed0e8`](https://redirect.github.com/apollographql/apollo-client/commit/1aed0e82fcc432380a56d4a446f414ce8b1a7a90) Thanks [@henryqdineen](https://redirect.github.com/henryqdineen)! - Defend against non-serializable params in `invariantWrappers`
- [#11905](https://redirect.github.com/apollographql/apollo-client/pull/11905) [`29755da`](https://redirect.github.com/apollographql/apollo-client/commit/29755da8797dc94613a23fe050ddd6ef9ffab607) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Add `.d.cts` files for cjs bundles
- [#11906](https://redirect.github.com/apollographql/apollo-client/pull/11906) [`d104759`](https://redirect.github.com/apollographql/apollo-client/commit/d104759cfb4be31e2ffbe166531a9b11861ade99) Thanks [@phryneas](https://redirect.github.com/phryneas)! - chore: update TypeScript to 5.5
### [`v3.10.6`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3106)
[Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.10.5...v3.10.6)
##### Patch Changes
- [#11900](https://redirect.github.com/apollographql/apollo-client/pull/11900) [`f745558`](https://red
Configuration
š Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
š¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
ā» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
š» Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
3.7.17
->3.11.10
2.2.0
->2.2.4
4.0.1
->4.5.0
1.9.5
->1.9.7
1.0.0
->1.2.0
7.60.0
->7.120.0
14.0.0
->14.3.1
14.4.3
->14.5.2
5.2.7
->5.2.11
0.14.0
->0.14.4
29.5.3
->29.5.14
2.1.4
->2.1.7
18.17.0
->18.19.64
18.2.15
->18.3.12
18.2.7
->18.3.1
2.0.1
->2.0.4
0.23.10
->0.23.13
18.0.0
->18.3.0
5.1.26
->5.1.34
7.3.52
->7.3.58
1.4.0
->1.7.7
1.11.9
->1.11.13
8.45.0
->8.57.1
8.8.0
->8.10.0
7.33.0
->7.37.2
4.6.0
->4.6.2
16.7.1
->16.9.0
29.6.1
->29.7.0
29.6.1
->29.7.0
4.1.1
->4.1.3
4.1.1
->4.1.3
1.2.3
->1.3.5
13.4.12
->13.5.7
18.2.0
->18.3.1
18.2.0
->18.3.1
7.45.2
->7.53.2
8.1.1
->8.1.3
6.14.2
->6.28.0
^0.29.0
->^0.30.0
18.2.0
->18.3.1
29.1.1
->29.2.5
10.9.1
->10.9.2
5.1.6
->5.6.3
Release Notes
apollographql/apollo-client (@apollo/client)
### [`v3.11.10`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#31110) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.9...v3.11.10) ##### Patch Changes - [#12093](https://redirect.github.com/apollographql/apollo-client/pull/12093) [`1765668`](https://redirect.github.com/apollographql/apollo-client/commit/1765668b7d495ef8a581f697bf9e4b7460455f13) Thanks [@mgmolisani](https://redirect.github.com/mgmolisani)! - Fixed a bug when evaluating the devtools flag with the new syntax `devtools.enabled` that could result to `true` when explicitly set to `false`. ### [`v3.11.9`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3119) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.8...v3.11.9) ##### Patch Changes - [#12110](https://redirect.github.com/apollographql/apollo-client/pull/12110) [`a3f95c6`](https://redirect.github.com/apollographql/apollo-client/commit/a3f95c6f7623060bbf68b418b0ab268fabc0c9b6) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix an issue where errors returned from a `fetchMore` call from a Suspense hook would cause a Suspense boundary to be shown indefinitely. ### [`v3.11.8`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3118) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.7...v3.11.8) ##### Patch Changes - [#12054](https://redirect.github.com/apollographql/apollo-client/pull/12054) [`35cf186`](https://redirect.github.com/apollographql/apollo-client/commit/35cf186ed9237e41735f150e0cbf4edd995ab0d9) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Fixed a bug where incorrect object access in some Safari extensions could cause a crash. ### [`v3.11.7`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3117) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.6...v3.11.7) ##### Patch Changes - [#12052](https://redirect.github.com/apollographql/apollo-client/pull/12052) [`e471cef`](https://redirect.github.com/apollographql/apollo-client/commit/e471cef875eadef04f8ee18ef431ee70e7b9bcab) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fixes a regression from where passing an invalid identifier to `from` in `useFragment` would result in the warning `TypeError: Cannot read properties of undefined (reading '__typename')`. ### [`v3.11.6`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3116) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.5...v3.11.6) ##### Patch Changes - [#12049](https://redirect.github.com/apollographql/apollo-client/pull/12049) [`9c26892`](https://redirect.github.com/apollographql/apollo-client/commit/9c268927b1f8e5921b9440a53c9979a37f594e75) Thanks [@phryneas](https://redirect.github.com/phryneas) and [@maciesielka](https://redirect.github.com/maciesielka)! - Fix a bug where `useFragment` did not re-render as expected - [#12044](https://redirect.github.com/apollographql/apollo-client/pull/12044) [`04462a2`](https://redirect.github.com/apollographql/apollo-client/commit/04462a274ad39b392142385a2f052abbf3014749) Thanks [@DoctorJohn](https://redirect.github.com/DoctorJohn)! - Cache the `useSubscription` hook's `restart` function definition between re-renders. ### [`v3.11.5`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3115) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.4...v3.11.5) ##### Patch Changes - [#12027](https://redirect.github.com/apollographql/apollo-client/pull/12027) [`eb3e21b`](https://redirect.github.com/apollographql/apollo-client/commit/eb3e21b9f7fa6a3161705c2c7270129c17b65095) Thanks [@JavaScriptBach](https://redirect.github.com/JavaScriptBach)! - Type `MutationResult.reset` as an arrow function - [#12020](https://redirect.github.com/apollographql/apollo-client/pull/12020) [`82d8cb4`](https://redirect.github.com/apollographql/apollo-client/commit/82d8cb4255be497748829f12eb25ac87c11ee5e4) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Better conform to Rules of React by avoiding write of ref in render for `useFragment`. ### [`v3.11.4`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3114) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.3...v3.11.4) ##### Patch Changes - [#11994](https://redirect.github.com/apollographql/apollo-client/pull/11994) [`41b17e5`](https://redirect.github.com/apollographql/apollo-client/commit/41b17e5950f4db5ef9e32ded5bb327b3bf19e6e8) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Update the `Modifier` function type to allow `cache.modify` to return deeply partial data. - [#11989](https://redirect.github.com/apollographql/apollo-client/pull/11989) [`e609156`](https://redirect.github.com/apollographql/apollo-client/commit/e609156c4989def88ae1a28b2e0f0378077a5528) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Fix a potential crash when calling `clearStore` while a query was running. Previously, calling `client.clearStore()` while a query was running had one of these results: - `useQuery` would stay in a `loading: true` state. - `useLazyQuery` would stay in a `loading: true` state, but also crash with a `"Cannot read property 'data' of undefined"` error. Now, in both cases, the hook will enter an error state with a `networkError`, and the promise returned by the `useLazyQuery` `execute` function will return a result in an error state. - [#11994](https://redirect.github.com/apollographql/apollo-client/pull/11994) [`41b17e5`](https://redirect.github.com/apollographql/apollo-client/commit/41b17e5950f4db5ef9e32ded5bb327b3bf19e6e8) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Prevent accidental distribution on `cache.modify` field modifiers when a field is a union type array. ### [`v3.11.3`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3113) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.2...v3.11.3) ##### Patch Changes - [#11984](https://redirect.github.com/apollographql/apollo-client/pull/11984) [`5db1659`](https://redirect.github.com/apollographql/apollo-client/commit/5db1659dc07e3de697894fc1c6f00a151d068291) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix an issue where multiple fetches with results that returned errors would sometimes set the `data` property with an `errorPolicy` of `none`. - [#11974](https://redirect.github.com/apollographql/apollo-client/pull/11974) [`c95848e`](https://redirect.github.com/apollographql/apollo-client/commit/c95848e859fb7ce0b3b9439ac71dff880f991450) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix an issue where `fetchMore` would write its result data to the cache when using it with a `no-cache` fetch policy. - [#11974](https://redirect.github.com/apollographql/apollo-client/pull/11974) [`c95848e`](https://redirect.github.com/apollographql/apollo-client/commit/c95848e859fb7ce0b3b9439ac71dff880f991450) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix an issue where executing `fetchMore` with a `no-cache` fetch policy could sometimes result in multiple network requests. - [#11974](https://redirect.github.com/apollographql/apollo-client/pull/11974) [`c95848e`](https://redirect.github.com/apollographql/apollo-client/commit/c95848e859fb7ce0b3b9439ac71dff880f991450) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - ##### Potentially disruptive change When calling `fetchMore` with a query that has a `no-cache` fetch policy, `fetchMore` will now throw if an `updateQuery` function is not provided. This provides a mechanism to merge the results from the `fetchMore` call with the query's previous result. ### [`v3.11.2`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3112) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.1...v3.11.2) ##### Patch Changes - [#11980](https://redirect.github.com/apollographql/apollo-client/pull/11980) [`38c0a2c`](https://redirect.github.com/apollographql/apollo-client/commit/38c0a2c43dd28677ee240754cd389c8a08c05738) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix missing `getServerSnapshot` error when using `useSubscription` on the server. ### [`v3.11.1`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3111) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.11.0...v3.11.1) ##### Patch Changes - [#11969](https://redirect.github.com/apollographql/apollo-client/pull/11969) [`061cab6`](https://redirect.github.com/apollographql/apollo-client/commit/061cab6627abd4ec81f83c40c1d281c418627c93) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Remove check for `window.__APOLLO_CLIENT__` when determining whether to connect to Apollo Client Devtools when `connectToDevtools` or `devtools.enabled` is not specified. This now simply checks to see if the application is in development mode. - [#11971](https://redirect.github.com/apollographql/apollo-client/pull/11971) [`ecf77f6`](https://redirect.github.com/apollographql/apollo-client/commit/ecf77f6f5b5ccf64cfba51e838e96549fb6c92fe) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Prevent the `setTimeout` for suggesting devtools from running in non-browser environments. ### [`v3.11.0`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3110) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.10.8...v3.11.0) ##### Potentially Breaking Fixes - [#11789](https://redirect.github.com/apollographql/apollo-client/pull/11789) [`5793301`](https://redirect.github.com/apollographql/apollo-client/commit/579330147d6bd6f7167a35413a33746103e375cb) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Changes usages of the `GraphQLError` type to `GraphQLFormattedError`. This was a type bug - these errors were never `GraphQLError` instances to begin with, and the `GraphQLError` class has additional properties that can never be correctly rehydrated from a GraphQL result. The correct type to use here is `GraphQLFormattedError`. Similarly, please ensure to use the type `FormattedExecutionResult` instead of `ExecutionResult` - the non-"Formatted" versions of these types are for use on the server only, but don't get transported over the network. - [#11626](https://redirect.github.com/apollographql/apollo-client/pull/11626) [`228429a`](https://redirect.github.com/apollographql/apollo-client/commit/228429a1d36eae691473b24fb641ec3cd84c8a3d) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Call `nextFetchPolicy` with "variables-changed" even if there is a `fetchPolicy` specified. Previously this would only be called when the current `fetchPolicy` was equal to the `fetchPolicy` option or the option was not specified. If you use `nextFetchPolicy` as a function, expect to see this function called more often. Due to this bug, this also meant that the `fetchPolicy` might be reset to the initial `fetchPolicy`, even when you specified a `nextFetchPolicy` function. If you previously relied on this behavior, you will need to update your `nextFetchPolicy` callback function to implement this resetting behavior. As an example, if your code looked like the following: ```js useQuery(QUERY, { nextFetchPolicy(currentFetchPolicy, info) { // your logic here } ); ``` Update your function to the following to reimplement the resetting behavior: ```js useQuery(QUERY, { nextFetchPolicy(currentFetchPolicy, info) { if (info.reason === 'variables-changed') { return info.initialFetchPolicy; } // your logic here } ); ``` ##### Minor Changes - [#11923](https://redirect.github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://redirect.github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useQueryRefHandlers`. - [#11854](https://redirect.github.com/apollographql/apollo-client/pull/11854) [`3812800`](https://redirect.github.com/apollographql/apollo-client/commit/3812800c6e4e5e3e64f473543babdba35ce100c2) Thanks [@jcostello-atlassian](https://redirect.github.com/jcostello-atlassian)! - Support extensions in useSubscription - [#11923](https://redirect.github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://redirect.github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useLoadableQuery`. - [#11863](https://redirect.github.com/apollographql/apollo-client/pull/11863) [`98e44f7`](https://redirect.github.com/apollographql/apollo-client/commit/98e44f74cb7c7e93a81bdc7492c9218bf4a2dcd4) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Reimplement `useSubscription` to fix rules of React violations. - [#11869](https://redirect.github.com/apollographql/apollo-client/pull/11869) [`a69327c`](https://redirect.github.com/apollographql/apollo-client/commit/a69327cce1b36e8855258e9b19427511e0af8748) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Rewrite big parts of `useQuery` and `useLazyQuery` to be more compliant with the Rules of React and React Compiler - [#11936](https://redirect.github.com/apollographql/apollo-client/pull/11936) [`1b23337`](https://redirect.github.com/apollographql/apollo-client/commit/1b23337e5a9eec4ce3ed69531ca4f4afe8e897a6) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Add the ability to specify a name for the client instance for use with Apollo Client Devtools. This is useful when instantiating multiple clients to identify the client instance more easily. This deprecates the `connectToDevtools` option in favor of a new `devtools` configuration. ```ts new ApolloClient({ devtools: { enabled: true, name: "Test Client", }, }); ``` This option is backwards-compatible with `connectToDevtools` and will be used in the absense of a `devtools` option. - [#11923](https://redirect.github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://redirect.github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useBackgroundQuery`. - [#11930](https://redirect.github.com/apollographql/apollo-client/pull/11930) [`a768575`](https://redirect.github.com/apollographql/apollo-client/commit/a768575ac1454587208aad63abc811b6a966fe72) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Deprecates experimental schema testing utilities introduced in 3.10 in favor of recommending [`@apollo/graphql-testing-library`](https://redirect.github.com/apollographql/graphql-testing-library). ##### Patch Changes - [#11951](https://redirect.github.com/apollographql/apollo-client/pull/11951) [`0de03af`](https://redirect.github.com/apollographql/apollo-client/commit/0de03af912a76c4e0111f21b4f90a073317b63b6) Thanks [@phryneas](https://redirect.github.com/phryneas)! - add React 19 RC to `peerDependencies` - [#11927](https://redirect.github.com/apollographql/apollo-client/pull/11927) [`2941824`](https://redirect.github.com/apollographql/apollo-client/commit/2941824dd66cdd20eee5f2293373ad7a9cf991a4) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Add `restart` function to `useSubscription`. - [#11949](https://redirect.github.com/apollographql/apollo-client/pull/11949) [`4528918`](https://redirect.github.com/apollographql/apollo-client/commit/45289186bcaaa33dfe904913eb6df31e2541c219) Thanks [@alessbell](https://redirect.github.com/alessbell)! - Remove deprecated `watchFragment` option, `canonizeResults` - [#11937](https://redirect.github.com/apollographql/apollo-client/pull/11937) [`78332be`](https://redirect.github.com/apollographql/apollo-client/commit/78332be32a9af0da33eb3e4100e7a76c3eac2496) Thanks [@phryneas](https://redirect.github.com/phryneas)! - `createSchemaFetch`: simulate serialized errors instead of an `ApolloError` instance - [#11902](https://redirect.github.com/apollographql/apollo-client/pull/11902) [`96422ce`](https://redirect.github.com/apollographql/apollo-client/commit/96422ce95b923b560321a88acd2eec35cf2a1c18) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Add `cause` field to `ApolloError`. - [#11806](https://redirect.github.com/apollographql/apollo-client/pull/11806) [`8df6013`](https://redirect.github.com/apollographql/apollo-client/commit/8df6013b6b45452ec058fab3e068b5b6d6c493f7) Thanks [@phryneas](https://redirect.github.com/phryneas)! - MockLink: add query default variables if not specified in mock request - [#11926](https://redirect.github.com/apollographql/apollo-client/pull/11926) [`3dd6432`](https://redirect.github.com/apollographql/apollo-client/commit/3dd64324dc5156450cead27f8141ea93315ffe65) Thanks [@phryneas](https://redirect.github.com/phryneas)! - `watchFragment`: forward additional options to `diffOptions` - [#11946](https://redirect.github.com/apollographql/apollo-client/pull/11946) [`7d833b8`](https://redirect.github.com/apollographql/apollo-client/commit/7d833b80119a991e6d2eb58f2c71074d697b8e63) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Fix issue where mutations were not accessible by Apollo Client Devtools in 3.11.0-rc.0. - [#11944](https://redirect.github.com/apollographql/apollo-client/pull/11944) [`8f3d7eb`](https://redirect.github.com/apollographql/apollo-client/commit/8f3d7eb3bc2e0c2d79c5b1856655abe829390742) Thanks [@sneyderdev](https://redirect.github.com/sneyderdev)! - Allow `IgnoreModifier` to be returned from a `optimisticResponse` function when inferring from a `TypedDocumentNode` when used with a generic argument. - [#11954](https://redirect.github.com/apollographql/apollo-client/pull/11954) [`4a6e86a`](https://redirect.github.com/apollographql/apollo-client/commit/4a6e86aeaf6685abf0dd23110784848c8b085735) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Document (and deprecate) the previously undocumented `errors` property on the `useQuery` `QueryResult` type. - [#11719](https://redirect.github.com/apollographql/apollo-client/pull/11719) [`09a6677`](https://redirect.github.com/apollographql/apollo-client/commit/09a6677ec1a0cffedeecb2cbac5cd3a3c8aa0fa1) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Allow wrapping `createQueryPreloader` - [#11921](https://redirect.github.com/apollographql/apollo-client/pull/11921) [`70406bf`](https://redirect.github.com/apollographql/apollo-client/commit/70406bfd2b9a645d781638569853d9b435e047df) Thanks [@phryneas](https://redirect.github.com/phryneas)! - add `ignoreResults` option to `useSubscription` ### [`v3.10.8`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3108) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.10.7...v3.10.8) ##### Patch Changes - [#11911](https://redirect.github.com/apollographql/apollo-client/pull/11911) [`1f0460a`](https://redirect.github.com/apollographql/apollo-client/commit/1f0460a60fc613e8d6f218a74ded69e81e960791) Thanks [@jerelmiller](https://redirect.github.com/jerelmiller)! - Allow `undefined` to be returned from a `cache.modify` modifier function when a generic type argument is used. ### [`v3.10.7`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3107) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.10.6...v3.10.7) ##### Patch Changes - [#11901](https://redirect.github.com/apollographql/apollo-client/pull/11901) [`10a8c0a`](https://redirect.github.com/apollographql/apollo-client/commit/10a8c0a8f6f3e13ec3c67bf53cc11a948b60e6d9) Thanks [@phryneas](https://redirect.github.com/phryneas)! - update `canUseLayoutEffect` check to also allow for layout effects in React Native - [#11861](https://redirect.github.com/apollographql/apollo-client/pull/11861) [`1aed0e8`](https://redirect.github.com/apollographql/apollo-client/commit/1aed0e82fcc432380a56d4a446f414ce8b1a7a90) Thanks [@henryqdineen](https://redirect.github.com/henryqdineen)! - Defend against non-serializable params in `invariantWrappers` - [#11905](https://redirect.github.com/apollographql/apollo-client/pull/11905) [`29755da`](https://redirect.github.com/apollographql/apollo-client/commit/29755da8797dc94613a23fe050ddd6ef9ffab607) Thanks [@phryneas](https://redirect.github.com/phryneas)! - Add `.d.cts` files for cjs bundles - [#11906](https://redirect.github.com/apollographql/apollo-client/pull/11906) [`d104759`](https://redirect.github.com/apollographql/apollo-client/commit/d104759cfb4be31e2ffbe166531a9b11861ade99) Thanks [@phryneas](https://redirect.github.com/phryneas)! - chore: update TypeScript to 5.5 ### [`v3.10.6`](https://redirect.github.com/apollographql/apollo-client/blob/HEAD/CHANGELOG.md#3106) [Compare Source](https://redirect.github.com/apollographql/apollo-client/compare/v3.10.5...v3.10.6) ##### Patch Changes - [#11900](https://redirect.github.com/apollographql/apollo-client/pull/11900) [`f745558`](https://redConfiguration
š Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
š¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
ā» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
š» Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.