@apollo/client 3.6.5 → 3.6.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/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.6.5';
1303
+ var version = '3.6.6';
1304
1304
 
1305
1305
  var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
1306
1306
  function parseAndCheckHttpResponse(operations) {
@@ -6300,7 +6300,7 @@ var InternalState = (function () {
6300
6300
  this.watchQueryOptions = watchQueryOptions;
6301
6301
  if (currentWatchQueryOptions && this.observable) {
6302
6302
  this.optionsToIgnoreOnce.delete(currentWatchQueryOptions);
6303
- this.observable.reobserve(watchQueryOptions);
6303
+ this.observable.reobserve(this.getObsQueryOptions());
6304
6304
  this.previousData = ((_a = this.result) === null || _a === void 0 ? void 0 : _a.data) || this.previousData;
6305
6305
  this.result = void 0;
6306
6306
  }
@@ -6321,6 +6321,17 @@ var InternalState = (function () {
6321
6321
  this.result = void 0;
6322
6322
  }
6323
6323
  };
6324
+ InternalState.prototype.getObsQueryOptions = function () {
6325
+ var toMerge = [];
6326
+ var globalDefaults = this.client.defaultOptions.watchQuery;
6327
+ if (globalDefaults)
6328
+ toMerge.push(globalDefaults);
6329
+ if (this.queryHookOptions.defaultOptions) {
6330
+ toMerge.push(this.queryHookOptions.defaultOptions);
6331
+ }
6332
+ toMerge.push(compact(this.observable && this.observable.options, this.watchQueryOptions));
6333
+ return toMerge.reduce(mergeOptions);
6334
+ };
6324
6335
  InternalState.prototype.createWatchQueryOptions = function (_a) {
6325
6336
  var _b;
6326
6337
  if (_a === void 0) { _a = {}; }
@@ -6361,7 +6372,7 @@ var InternalState = (function () {
6361
6372
  this.renderPromises
6362
6373
  && this.renderPromises.getSSRObservable(this.watchQueryOptions)
6363
6374
  || this.observable
6364
- || this.client.watchQuery(mergeOptions(this.queryHookOptions.defaultOptions, this.watchQueryOptions));
6375
+ || this.client.watchQuery(this.getObsQueryOptions());
6365
6376
  this.obsQueryFields = React.useMemo(function () { return ({
6366
6377
  refetch: obsQuery.refetch.bind(obsQuery),
6367
6378
  reobserve: obsQuery.reobserve.bind(obsQuery),