@apollo/client 4.0.5 → 4.0.6

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 4.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
3
9
  ## 4.0.5
4
10
 
5
11
  ### Patch Changes
@@ -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
  },