@apollo/client 3.7.0 → 3.7.1

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/apollo-client.cjs CHANGED
@@ -1300,7 +1300,7 @@ var concat = ApolloLink.concat;
1300
1300
 
1301
1301
  var execute = ApolloLink.execute;
1302
1302
 
1303
- var version = '3.7.0';
1303
+ var version = '3.7.1';
1304
1304
 
1305
1305
  function isNodeResponse(value) {
1306
1306
  return !!value.body;
@@ -4350,8 +4350,10 @@ var ObservableQuery = (function (_super) {
4350
4350
  }
4351
4351
  return result;
4352
4352
  };
4353
- ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) {
4354
- return !this.last || !equality.equal(this.last.result, newResult);
4353
+ ObservableQuery.prototype.isDifferentFromLastResult = function (newResult, variables) {
4354
+ return (!this.last ||
4355
+ !equality.equal(this.last.result, newResult) ||
4356
+ (variables && !equality.equal(this.last.variables, variables)));
4355
4357
  };
4356
4358
  ObservableQuery.prototype.getLast = function (key, variablesMustMatch) {
4357
4359
  var last = this.last;
@@ -4659,7 +4661,7 @@ var ObservableQuery = (function (_super) {
4659
4661
  };
4660
4662
  ObservableQuery.prototype.reportResult = function (result, variables) {
4661
4663
  var lastError = this.getLastError();
4662
- if (lastError || this.isDifferentFromLastResult(result)) {
4664
+ if (lastError || this.isDifferentFromLastResult(result, variables)) {
4663
4665
  if (lastError || !result.partial || this.options.returnPartialData) {
4664
4666
  this.updateLastResult(result, variables);
4665
4667
  }
@@ -7104,13 +7106,11 @@ function useFragment_experimental(options) {
7104
7106
  var resultRef = React.useRef();
7105
7107
  var latestDiff = cache.diff(diffOptions);
7106
7108
  return useSyncExternalStore(function (forceUpdate) {
7107
- var immediate = true;
7108
- return cache.watch(tslib.__assign(tslib.__assign({}, diffOptions), { immediate: immediate, callback: function (diff) {
7109
- if (!immediate && !equality.equal(diff, latestDiff)) {
7109
+ return cache.watch(tslib.__assign(tslib.__assign({}, diffOptions), { immediate: true, callback: function (diff) {
7110
+ if (!equality.equal(diff, latestDiff)) {
7110
7111
  resultRef.current = diffToResult(latestDiff = diff);
7111
7112
  forceUpdate();
7112
7113
  }
7113
- immediate = false;
7114
7114
  } }));
7115
7115
  }, function () {
7116
7116
  var latestDiffToResult = diffToResult(latestDiff);