@apollo/client 4.0.5 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/__cjs/core/ApolloClient.d.cts +6 -2
- package/__cjs/core/ObservableQuery.cjs +6 -2
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/link/subscriptions/index.cjs +2 -1
- package/__cjs/link/subscriptions/index.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +3 -1
- package/__cjs/react/hooks/useReactiveVar.cjs +2 -1
- package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
- package/__cjs/react/hooks/useReactiveVar.d.cts +2 -1
- package/__cjs/react/types/types.documentation.d.cts +3 -15
- package/__cjs/version.cjs +1 -1
- package/core/ApolloClient.d.ts +6 -2
- package/core/ObservableQuery.js +6 -2
- package/core/ObservableQuery.js.map +1 -1
- package/link/subscriptions/index.js +2 -1
- package/link/subscriptions/index.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useMutation.d.ts +3 -1
- package/react/hooks/useReactiveVar.d.ts +2 -1
- package/react/hooks/useReactiveVar.js +2 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks-compiled/useMutation.d.ts +3 -1
- package/react/hooks-compiled/useReactiveVar.d.ts +2 -1
- package/react/hooks-compiled/useReactiveVar.js +2 -1
- package/react/hooks-compiled/useReactiveVar.js.map +1 -1
- package/react/types/types.documentation.d.ts +3 -15
- package/react/types/types.documentation.js.map +1 -1
- package/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @apollo/client
|
|
2
2
|
|
|
3
|
+
## 4.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#12950](https://github.com/apollographql/apollo-client/pull/12950) [`5b4f36a`](https://github.com/apollographql/apollo-client/commit/5b4f36a2b249d15e2e8165bd32d9b2fca7e70217) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Don't send `operationType` in the payload sent by `GraphQLWsLink`.
|
|
8
|
+
|
|
9
|
+
## 4.0.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#12937](https://github.com/apollographql/apollo-client/pull/12937) [`3b0d89b`](https://github.com/apollographql/apollo-client/commit/3b0d89bc9dde3eaee9ddf0aec387da43fe71abc0) Thanks [@phryneas](https://github.com/phryneas)! - Fix a problem with `fetchMore` where the loading state wouldn't reset if the result wouldn't result in a data update.
|
|
14
|
+
|
|
3
15
|
## 4.0.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -206,7 +206,9 @@ export declare namespace ApolloClient {
|
|
|
206
206
|
} & VariablesOption<NoInfer<TVariables>>;
|
|
207
207
|
interface MutateResult<TData = unknown> {
|
|
208
208
|
/**
|
|
209
|
-
* The data returned from your mutation. Can be `undefined` if `
|
|
209
|
+
* The data returned from your mutation. Can be `undefined` if the `errorPolicy`
|
|
210
|
+
* is `all` or `ignore` and the server returns a GraphQL response with `errors`
|
|
211
|
+
* but not `data` or a network error is returned.
|
|
210
212
|
*/
|
|
211
213
|
data: TData | undefined;
|
|
212
214
|
/**
|
|
@@ -357,7 +359,9 @@ export declare namespace ApolloClient {
|
|
|
357
359
|
} & VariablesOption<NoInfer<TVariables>>;
|
|
358
360
|
interface SubscribeResult<TData = unknown> {
|
|
359
361
|
/**
|
|
360
|
-
* The data returned from your mutation. Can be `undefined` if `
|
|
362
|
+
* The data returned from your mutation. Can be `undefined` if the `errorPolicy`
|
|
363
|
+
* is `all` or `ignore` and the server returns a GraphQL response with `errors`
|
|
364
|
+
* but not `data` or a network error is returned.
|
|
361
365
|
*/
|
|
362
366
|
data: TData | undefined;
|
|
363
367
|
/**
|
|
@@ -447,6 +447,9 @@ class ObservableQuery {
|
|
|
447
447
|
// appropriate
|
|
448
448
|
finalize();
|
|
449
449
|
if (isCached) {
|
|
450
|
+
// Separately getting a diff here before the batch - `onWatchUpdated` might be
|
|
451
|
+
// called with an `undefined` `lastDiff` on the watcher if the cache was just subscribed to.
|
|
452
|
+
const lastDiff = this.getCacheDiff();
|
|
450
453
|
// Performing this cache update inside a cache.batch transaction ensures
|
|
451
454
|
// any affected cache.watch watchers are notified at most once about any
|
|
452
455
|
// updates. Most watchers will be using the QueryInfo class, which
|
|
@@ -478,8 +481,9 @@ class ObservableQuery {
|
|
|
478
481
|
});
|
|
479
482
|
}
|
|
480
483
|
},
|
|
481
|
-
onWatchUpdated: (watch) => {
|
|
482
|
-
if (watch.watcher === this
|
|
484
|
+
onWatchUpdated: (watch, diff) => {
|
|
485
|
+
if (watch.watcher === this &&
|
|
486
|
+
!(0, equality_1.equal)(diff.result, lastDiff.result)) {
|
|
483
487
|
wasUpdated = true;
|
|
484
488
|
}
|
|
485
489
|
},
|