@apollo/client 3.14.0-alpha.0 → 3.14.0-rc.0

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.
Files changed (200) hide show
  1. package/.changeset/breezy-lions-rule.md +5 -0
  2. package/.changeset/great-jobs-fetch.md +5 -0
  3. package/.changeset/pre.json +6 -2
  4. package/.changeset/shy-boxes-exercise.md +5 -0
  5. package/.changeset/tidy-bulldogs-exercise.md +5 -0
  6. package/CHANGELOG.md +16 -0
  7. package/README.md +2 -2
  8. package/apollo-client.cjs +187 -119
  9. package/apollo-client.cjs.map +1 -1
  10. package/apollo-client.min.cjs +1 -1
  11. package/cache/cache.cjs +7 -2
  12. package/cache/cache.cjs.map +1 -1
  13. package/cache/cache.cjs.native.js +7 -2
  14. package/cache/inmemory/inMemoryCache.d.ts +8 -0
  15. package/cache/inmemory/inMemoryCache.js +3 -0
  16. package/cache/inmemory/inMemoryCache.js.map +1 -1
  17. package/core/ApolloClient.d.ts +9 -9
  18. package/core/ApolloClient.js +6 -1
  19. package/core/ApolloClient.js.map +1 -1
  20. package/core/LocalState.js +2 -2
  21. package/core/ObservableQuery.d.ts +51 -6
  22. package/core/ObservableQuery.js +89 -13
  23. package/core/ObservableQuery.js.map +1 -1
  24. package/core/QueryInfo.js +6 -3
  25. package/core/QueryInfo.js.map +1 -1
  26. package/core/QueryManager.js +14 -12
  27. package/core/QueryManager.js.map +1 -1
  28. package/core/core.cjs +85 -33
  29. package/core/core.cjs.map +1 -1
  30. package/core/core.cjs.native.js +85 -33
  31. package/core/types.d.ts +177 -3
  32. package/core/types.js.map +1 -1
  33. package/core/watchQueryOptions.d.ts +10 -2
  34. package/core/watchQueryOptions.js.map +1 -1
  35. package/dev/dev.cjs +149 -97
  36. package/dev/dev.cjs.map +1 -1
  37. package/dev/dev.cjs.native.js +149 -97
  38. package/errors/errors.cjs.map +1 -1
  39. package/errors/index.d.ts +19 -0
  40. package/errors/index.js +19 -0
  41. package/errors/index.js.map +1 -1
  42. package/invariantErrorCodes.js +161 -96
  43. package/link/batch-http/batch-http.cjs +9 -0
  44. package/link/batch-http/batch-http.cjs.map +1 -1
  45. package/link/batch-http/batch-http.cjs.native.js +9 -0
  46. package/link/batch-http/batchHttpLink.js +9 -0
  47. package/link/batch-http/batchHttpLink.js.map +1 -1
  48. package/link/core/ApolloLink.d.ts +8 -0
  49. package/link/core/ApolloLink.js +19 -2
  50. package/link/core/ApolloLink.js.map +1 -1
  51. package/link/core/core.cjs +24 -2
  52. package/link/core/core.cjs.map +1 -1
  53. package/link/core/core.cjs.native.js +24 -2
  54. package/link/core/types.d.ts +20 -0
  55. package/link/core/types.js.map +1 -1
  56. package/link/error/index.d.ts +48 -0
  57. package/link/error/index.js.map +1 -1
  58. package/link/http/checkFetcher.js +1 -1
  59. package/link/http/createHttpLink.js +4 -1
  60. package/link/http/createHttpLink.js.map +1 -1
  61. package/link/http/http.cjs +6 -3
  62. package/link/http/http.cjs.map +1 -1
  63. package/link/http/http.cjs.native.js +6 -3
  64. package/link/http/serializeFetchParameter.js +1 -1
  65. package/link/persisted-queries/index.d.ts +38 -0
  66. package/link/persisted-queries/index.js +2 -2
  67. package/link/persisted-queries/index.js.map +1 -1
  68. package/link/persisted-queries/persisted-queries.cjs +2 -2
  69. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  70. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  71. package/link/utils/fromError.d.ts +16 -0
  72. package/link/utils/fromError.js +16 -0
  73. package/link/utils/fromError.js.map +1 -1
  74. package/link/utils/fromPromise.d.ts +16 -0
  75. package/link/utils/fromPromise.js +16 -0
  76. package/link/utils/fromPromise.js.map +1 -1
  77. package/link/utils/throwServerError.d.ts +30 -0
  78. package/link/utils/throwServerError.js +17 -0
  79. package/link/utils/throwServerError.js.map +1 -1
  80. package/link/utils/toPromise.d.ts +16 -0
  81. package/link/utils/toPromise.js +17 -1
  82. package/link/utils/toPromise.js.map +1 -1
  83. package/link/utils/utils.cjs +2 -2
  84. package/link/utils/utils.cjs.map +1 -1
  85. package/link/utils/utils.cjs.native.js +2 -2
  86. package/link/utils/validateOperation.js +1 -1
  87. package/masking/maskDefinition.js +2 -2
  88. package/masking/maskFragment.js +2 -2
  89. package/masking/maskOperation.js +1 -1
  90. package/masking/masking.cjs +6 -6
  91. package/masking/masking.cjs.map +1 -1
  92. package/masking/masking.cjs.native.js +6 -6
  93. package/masking/utils.js +1 -1
  94. package/masking/utils.js.map +1 -1
  95. package/package.json +1 -1
  96. package/react/components/Mutation.js +1 -1
  97. package/react/components/Query.js +1 -1
  98. package/react/components/Subscription.js +1 -1
  99. package/react/components/components.cjs +6 -4
  100. package/react/components/components.cjs.map +1 -1
  101. package/react/components/components.cjs.native.js +6 -4
  102. package/react/context/ApolloConsumer.js +1 -1
  103. package/react/context/ApolloContext.js +2 -2
  104. package/react/context/ApolloProvider.js +1 -1
  105. package/react/context/context.cjs +4 -4
  106. package/react/context/context.cjs.map +1 -1
  107. package/react/context/context.cjs.native.js +4 -4
  108. package/react/hoc/graphql.js +1 -1
  109. package/react/hoc/hoc-utils.js +1 -1
  110. package/react/hoc/hoc.cjs +9 -7
  111. package/react/hoc/hoc.cjs.map +1 -1
  112. package/react/hoc/hoc.cjs.native.js +9 -7
  113. package/react/hoc/mutation-hoc.js +1 -1
  114. package/react/hoc/query-hoc.js +1 -1
  115. package/react/hoc/subscription-hoc.js +1 -1
  116. package/react/hoc/withApollo.js +1 -1
  117. package/react/hooks/hooks.cjs +18 -16
  118. package/react/hooks/hooks.cjs.map +1 -1
  119. package/react/hooks/hooks.cjs.native.js +18 -16
  120. package/react/hooks/internal/useWarnRemoved.d.ts +2 -1
  121. package/react/hooks/internal/useWarnRemoved.js.map +1 -1
  122. package/react/hooks/internal/useWarnRemovedOption.js +1 -1
  123. package/react/hooks/useApolloClient.js +1 -1
  124. package/react/hooks/useLazyQuery.js +2 -2
  125. package/react/hooks/useLoadableQuery.js +2 -2
  126. package/react/hooks/useQuery.js +1 -1
  127. package/react/hooks/useSubscription.js +3 -3
  128. package/react/hooks/useSuspenseQuery.js +2 -2
  129. package/react/hooks/useSyncExternalStore.js +1 -1
  130. package/react/internal/cache/QueryReference.d.ts +1 -0
  131. package/react/internal/cache/QueryReference.js +5 -2
  132. package/react/internal/cache/QueryReference.js.map +1 -1
  133. package/react/internal/internal.cjs +16 -3
  134. package/react/internal/internal.cjs.map +1 -1
  135. package/react/internal/internal.cjs.native.js +16 -3
  136. package/react/parser/index.js +6 -6
  137. package/react/parser/parser.cjs +9 -7
  138. package/react/parser/parser.cjs.map +1 -1
  139. package/react/parser/parser.cjs.native.js +9 -7
  140. package/react/react.cjs +4 -2
  141. package/react/react.cjs.map +1 -1
  142. package/react/react.cjs.native.js +4 -2
  143. package/react/types/types.d.ts +40 -0
  144. package/react/types/types.documentation.d.ts +1 -1
  145. package/react/types/types.documentation.js.map +1 -1
  146. package/react/types/types.js.map +1 -1
  147. package/testing/core/core.cjs +17 -3
  148. package/testing/core/core.cjs.map +1 -1
  149. package/testing/core/core.cjs.native.js +17 -3
  150. package/testing/core/itAsync.d.ts +5 -0
  151. package/testing/core/itAsync.js +5 -0
  152. package/testing/core/itAsync.js.map +1 -1
  153. package/testing/core/mocking/mockClient.d.ts +4 -0
  154. package/testing/core/mocking/mockClient.js +4 -0
  155. package/testing/core/mocking/mockClient.js.map +1 -1
  156. package/testing/core/mocking/mockLink.d.ts +10 -0
  157. package/testing/core/mocking/mockLink.js +23 -4
  158. package/testing/core/mocking/mockLink.js.map +1 -1
  159. package/testing/core/mocking/mockSubscriptionLink.d.ts +4 -0
  160. package/testing/core/mocking/mockSubscriptionLink.js +4 -0
  161. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  162. package/testing/core/subscribeAndCount.d.ts +4 -0
  163. package/testing/core/subscribeAndCount.js +4 -0
  164. package/testing/core/subscribeAndCount.js.map +1 -1
  165. package/testing/experimental/createSchemaFetch.d.ts +1 -1
  166. package/testing/experimental/createSchemaFetch.js +1 -1
  167. package/testing/experimental/createSchemaFetch.js.map +1 -1
  168. package/testing/experimental/createTestSchema.d.ts +1 -1
  169. package/testing/experimental/createTestSchema.js +1 -1
  170. package/testing/experimental/createTestSchema.js.map +1 -1
  171. package/testing/experimental/experimental.cjs.map +1 -1
  172. package/testing/testing.cjs +4 -2
  173. package/testing/testing.cjs.map +1 -1
  174. package/testing/testing.cjs.native.js +4 -2
  175. package/utilities/deprecation/index.d.ts +83 -3
  176. package/utilities/deprecation/index.js +15 -3
  177. package/utilities/deprecation/index.js.map +1 -1
  178. package/utilities/globals/globals.cjs +1 -1
  179. package/utilities/globals/globals.cjs.map +1 -1
  180. package/utilities/globals/globals.cjs.native.js +1 -1
  181. package/utilities/graphql/DocumentTransform.js +1 -1
  182. package/utilities/graphql/directives.js +7 -7
  183. package/utilities/graphql/fragments.js +3 -3
  184. package/utilities/graphql/getFromAST.js +8 -8
  185. package/utilities/graphql/storeUtils.js +1 -1
  186. package/utilities/graphql/transform.js +2 -2
  187. package/utilities/observables/asyncMap.d.ts +13 -0
  188. package/utilities/observables/asyncMap.js +13 -0
  189. package/utilities/observables/asyncMap.js.map +1 -1
  190. package/utilities/observables/iteration.d.ts +4 -0
  191. package/utilities/observables/iteration.js +4 -0
  192. package/utilities/observables/iteration.js.map +1 -1
  193. package/utilities/subscriptions/urql/index.d.ts +5 -0
  194. package/utilities/subscriptions/urql/index.js +5 -0
  195. package/utilities/subscriptions/urql/index.js.map +1 -1
  196. package/utilities/subscriptions/urql/urql.cjs.map +1 -1
  197. package/utilities/utilities.cjs +22 -22
  198. package/utilities/utilities.cjs.map +1 -1
  199. package/utilities/utilities.cjs.native.js +22 -22
  200. package/version.js +1 -1
package/core/core.cjs CHANGED
@@ -22,7 +22,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
22
22
 
23
23
  var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
24
24
 
25
- var version = "3.14.0-alpha.0";
25
+ var version = "3.14.0-rc.0";
26
26
 
27
27
  function isNonNullObject(obj) {
28
28
  return obj !== null && typeof obj === "object";
@@ -195,9 +195,11 @@ function directiveIsNonreactive(dir) {
195
195
  return dir.name.value === "nonreactive";
196
196
  }
197
197
 
198
+ var muteAllDeprecations = Symbol.for("apollo.deprecations");
199
+ var global = globals.global;
198
200
  var slot = new optimism.Slot();
199
201
  function isMuted(name) {
200
- return (slot.getValue() || []).includes(name);
202
+ return global[muteAllDeprecations] || (slot.getValue() || []).includes(name);
201
203
  }
202
204
  function muteDeprecations(name) {
203
205
  var args = [];
@@ -210,7 +212,7 @@ function warnRemovedOption(options, name, callSite, recommendation) {
210
212
  if (recommendation === void 0) { recommendation = "Please remove this option."; }
211
213
  warnDeprecated(name, function () {
212
214
  if (name in options) {
213
- globalThis.__DEV__ !== false && globals.invariant.warn(91, callSite, name, recommendation);
215
+ globalThis.__DEV__ !== false && globals.invariant.warn(104, callSite, name, recommendation);
214
216
  }
215
217
  });
216
218
  }
@@ -294,6 +296,11 @@ var ObservableQuery = (function (_super) {
294
296
  });
295
297
  ObservableQuery.prototype.result = function () {
296
298
  var _this = this;
299
+ if (globalThis.__DEV__ !== false) {
300
+ warnDeprecated("observableQuery.result", function () {
301
+ globalThis.__DEV__ !== false && globals.invariant.warn(23);
302
+ });
303
+ }
297
304
  return new Promise(function (resolve, reject) {
298
305
  var observer = {
299
306
  next: function (result) {
@@ -315,8 +322,11 @@ var ObservableQuery = (function (_super) {
315
322
  this.queryInfo.resetDiff();
316
323
  };
317
324
  ObservableQuery.prototype.getCurrentFullResult = function (saveAsLastResult) {
325
+ var _this = this;
318
326
  if (saveAsLastResult === void 0) { saveAsLastResult = true; }
319
- var lastResult = this.getLastResult(true);
327
+ var lastResult = muteDeprecations("getLastResult", function () {
328
+ return _this.getLastResult(true);
329
+ });
320
330
  var networkStatus = this.queryInfo.networkStatus ||
321
331
  (lastResult && lastResult.networkStatus) ||
322
332
  exports.NetworkStatus.ready;
@@ -391,16 +401,34 @@ var ObservableQuery = (function (_super) {
391
401
  }
392
402
  };
393
403
  ObservableQuery.prototype.getLastResult = function (variablesMustMatch) {
404
+ if (globalThis.__DEV__ !== false) {
405
+ warnDeprecated("getLastResult", function () {
406
+ globalThis.__DEV__ !== false && globals.invariant.warn(24);
407
+ });
408
+ }
394
409
  return this.getLast("result", variablesMustMatch);
395
410
  };
396
411
  ObservableQuery.prototype.getLastError = function (variablesMustMatch) {
412
+ if (globalThis.__DEV__ !== false) {
413
+ warnDeprecated("getLastError", function () {
414
+ globalThis.__DEV__ !== false && globals.invariant.warn(25);
415
+ });
416
+ }
397
417
  return this.getLast("error", variablesMustMatch);
398
418
  };
399
419
  ObservableQuery.prototype.resetLastResults = function () {
420
+ if (globalThis.__DEV__ !== false) {
421
+ warnDeprecated("resetLastResults", function () {
422
+ globalThis.__DEV__ !== false && globals.invariant.warn(26);
423
+ });
424
+ }
400
425
  delete this.last;
401
426
  this.isTornDown = false;
402
427
  };
403
428
  ObservableQuery.prototype.resetQueryStoreErrors = function () {
429
+ if (globalThis.__DEV__ !== false) {
430
+ globalThis.__DEV__ !== false && globals.invariant.warn(27);
431
+ }
404
432
  this.queryManager.resetErrors(this.queryId);
405
433
  };
406
434
  ObservableQuery.prototype.refetch = function (variables) {
@@ -420,7 +448,7 @@ var ObservableQuery = (function (_super) {
420
448
  var vars = queryDef.variableDefinitions;
421
449
  if (!vars || !vars.some(function (v) { return v.variable.name.value === "variables"; })) {
422
450
  globalThis.__DEV__ !== false && globals.invariant.warn(
423
- 22,
451
+ 28,
424
452
  variables,
425
453
  ((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || queryDef
426
454
  );
@@ -452,7 +480,7 @@ var ObservableQuery = (function (_super) {
452
480
  var updateQuery = fetchMoreOptions === null || fetchMoreOptions === void 0 ? void 0 : fetchMoreOptions.updateQuery;
453
481
  var isCached = this.options.fetchPolicy !== "no-cache";
454
482
  if (!isCached) {
455
- globals.invariant(updateQuery, 23);
483
+ globals.invariant(updateQuery, 29);
456
484
  }
457
485
  return this.queryManager
458
486
  .fetchQuery(qid, combinedOptions, exports.NetworkStatus.fetchMore)
@@ -529,7 +557,7 @@ var ObservableQuery = (function (_super) {
529
557
  options.onError(err);
530
558
  return;
531
559
  }
532
- globalThis.__DEV__ !== false && globals.invariant.error(24, err);
560
+ globalThis.__DEV__ !== false && globals.invariant.error(30, err);
533
561
  },
534
562
  });
535
563
  this.subscriptions.add(subscription);
@@ -542,6 +570,9 @@ var ObservableQuery = (function (_super) {
542
570
  ObservableQuery.prototype.setOptions = function (newOptions) {
543
571
  if (globalThis.__DEV__ !== false) {
544
572
  warnRemovedOption(newOptions, "canonizeResults", "setOptions");
573
+ warnDeprecated("setOptions", function () {
574
+ globalThis.__DEV__ !== false && globals.invariant.warn(31);
575
+ });
545
576
  }
546
577
  return this.reobserve(newOptions);
547
578
  };
@@ -550,8 +581,11 @@ var ObservableQuery = (function (_super) {
550
581
  assign(this.options, mergedOptions);
551
582
  };
552
583
  ObservableQuery.prototype.setVariables = function (variables) {
584
+ var _this = this;
553
585
  if (equal.equal(this.variables, variables)) {
554
- return this.observers.size ? this.result() : Promise.resolve();
586
+ return this.observers.size ?
587
+ muteDeprecations("observableQuery.result", function () { return _this.result(); })
588
+ : Promise.resolve();
555
589
  }
556
590
  this.options.variables = variables;
557
591
  if (!this.observers.size) {
@@ -635,7 +669,7 @@ var ObservableQuery = (function (_super) {
635
669
  if (pollingInfo && pollingInfo.interval === pollInterval) {
636
670
  return;
637
671
  }
638
- globals.invariant(pollInterval, 25);
672
+ globals.invariant(pollInterval, 32);
639
673
  var info = pollingInfo || (this.pollingInfo = {});
640
674
  info.interval = pollInterval;
641
675
  var maybeFetch = function () {
@@ -664,8 +698,11 @@ var ObservableQuery = (function (_super) {
664
698
  poll();
665
699
  };
666
700
  ObservableQuery.prototype.updateLastResult = function (newResult, variables) {
701
+ var _this = this;
667
702
  if (variables === void 0) { variables = this.variables; }
668
- var error = this.getLastError();
703
+ var error = muteDeprecations("getLastError", function () {
704
+ return _this.getLastError();
705
+ });
669
706
  if (error && this.last && !equal.equal(variables, this.last.variables)) {
670
707
  error = void 0;
671
708
  }
@@ -741,12 +778,13 @@ var ObservableQuery = (function (_super) {
741
778
  return utilities.preventUnhandledRejection(this.reobserveAsConcast(newOptions, newNetworkStatus).promise.then(this.maskResult));
742
779
  };
743
780
  ObservableQuery.prototype.resubscribeAfterError = function () {
781
+ var _this = this;
744
782
  var args = [];
745
783
  for (var _i = 0; _i < arguments.length; _i++) {
746
784
  args[_i] = arguments[_i];
747
785
  }
748
786
  var last = this.last;
749
- this.resetLastResults();
787
+ muteDeprecations("resetLastResults", function () { return _this.resetLastResults(); });
750
788
  var subscription = this.subscribe.apply(this, args);
751
789
  this.last = last;
752
790
  return subscription;
@@ -756,7 +794,10 @@ var ObservableQuery = (function (_super) {
756
794
  this.getCurrentFullResult(false), this.variables);
757
795
  };
758
796
  ObservableQuery.prototype.reportResult = function (result, variables) {
759
- var lastError = this.getLastError();
797
+ var _this = this;
798
+ var lastError = muteDeprecations("getLastError", function () {
799
+ return _this.getLastError();
800
+ });
760
801
  var isDifferent = this.isDifferentFromLastResult(result, variables);
761
802
  if (lastError || !result.partial || this.options.returnPartialData) {
762
803
  this.updateLastResult(result, variables);
@@ -766,7 +807,8 @@ var ObservableQuery = (function (_super) {
766
807
  }
767
808
  };
768
809
  ObservableQuery.prototype.reportError = function (error, variables) {
769
- var errorResult = tslib.__assign(tslib.__assign({}, this.getLastResult()), { error: error, errors: error.graphQLErrors, networkStatus: exports.NetworkStatus.error, loading: false });
810
+ var _this = this;
811
+ var errorResult = tslib.__assign(tslib.__assign({}, muteDeprecations("getLastResult", function () { return _this.getLastResult(); })), { error: error, errors: error.graphQLErrors, networkStatus: exports.NetworkStatus.error, loading: false });
770
812
  this.updateLastResult(errorResult, variables);
771
813
  utilities.iterateObserversSafely(this.observers, "error", (this.last.error = error));
772
814
  };
@@ -856,11 +898,11 @@ var ObservableQuery = (function (_super) {
856
898
  }(utilities.Observable));
857
899
  utilities.fixObservableSubclass(ObservableQuery);
858
900
  function defaultSubscriptionObserverErrorCallback(error) {
859
- globalThis.__DEV__ !== false && globals.invariant.error(26, error.message, error.stack);
901
+ globalThis.__DEV__ !== false && globals.invariant.error(33, error.message, error.stack);
860
902
  }
861
903
  function logMissingFieldErrors(missing) {
862
904
  if (globalThis.__DEV__ !== false && missing) {
863
- globalThis.__DEV__ !== false && globals.invariant.debug(27, missing);
905
+ globalThis.__DEV__ !== false && globals.invariant.debug(34, missing);
864
906
  }
865
907
  }
866
908
  function skipCacheDataFor(fetchPolicy ) {
@@ -963,14 +1005,17 @@ var QueryInfo = (function () {
963
1005
  };
964
1006
  };
965
1007
  QueryInfo.prototype.setDiff = function (diff) {
966
- var _a, _b;
1008
+ var _this = this;
1009
+ var _a;
967
1010
  var oldDiff = this.lastDiff && this.lastDiff.diff;
968
- if (diff && !diff.complete && ((_a = this.observableQuery) === null || _a === void 0 ? void 0 : _a.getLastError())) {
1011
+ if (diff &&
1012
+ !diff.complete &&
1013
+ muteDeprecations("getLastError", function () { var _a; return (_a = _this.observableQuery) === null || _a === void 0 ? void 0 : _a.getLastError(); })) {
969
1014
  return;
970
1015
  }
971
1016
  this.updateLastDiff(diff);
972
1017
  if (!equal.equal(oldDiff && oldDiff.result, diff && diff.result)) {
973
- (_b = this.observableQuery) === null || _b === void 0 ? void 0 : _b["scheduleNotify"]();
1018
+ (_a = this.observableQuery) === null || _a === void 0 ? void 0 : _a["scheduleNotify"]();
974
1019
  }
975
1020
  };
976
1021
  QueryInfo.prototype.setObservableQuery = function (oq) {
@@ -1150,7 +1195,7 @@ var QueryManager = (function () {
1150
1195
  this.queries.forEach(function (_info, queryId) {
1151
1196
  _this.stopQueryNoBroadcast(queryId);
1152
1197
  });
1153
- this.cancelPendingFetches(globals.newInvariantError(28));
1198
+ this.cancelPendingFetches(globals.newInvariantError(35));
1154
1199
  };
1155
1200
  QueryManager.prototype.cancelPendingFetches = function (error) {
1156
1201
  this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });
@@ -1164,8 +1209,8 @@ var QueryManager = (function () {
1164
1209
  return tslib.__generator(this, function (_j) {
1165
1210
  switch (_j.label) {
1166
1211
  case 0:
1167
- globals.invariant(mutation, 29);
1168
- globals.invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 30);
1212
+ globals.invariant(mutation, 36);
1213
+ globals.invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 37);
1169
1214
  mutationId = this.generateMutationId();
1170
1215
  mutation = this.cache.transformForLink(this.transform(mutation));
1171
1216
  hasClientExports = this.getDocumentInfo(mutation).hasClientExports;
@@ -1495,10 +1540,10 @@ var QueryManager = (function () {
1495
1540
  QueryManager.prototype.query = function (options, queryId) {
1496
1541
  var _this = this;
1497
1542
  if (queryId === void 0) { queryId = this.generateQueryId(); }
1498
- globals.invariant(options.query, 31);
1499
- globals.invariant(options.query.kind === "Document", 32);
1500
- globals.invariant(!options.returnPartialData, 33);
1501
- globals.invariant(!options.pollInterval, 34);
1543
+ globals.invariant(options.query, 38);
1544
+ globals.invariant(options.query.kind === "Document", 39);
1545
+ globals.invariant(!options.returnPartialData, 40);
1546
+ globals.invariant(!options.pollInterval, 41);
1502
1547
  var query = this.transform(options.query);
1503
1548
  return this.fetchQuery(queryId, tslib.__assign(tslib.__assign({}, options), { query: query }))
1504
1549
  .then(function (result) {
@@ -1533,7 +1578,7 @@ var QueryManager = (function () {
1533
1578
  if (options === void 0) { options = {
1534
1579
  discardWatches: true,
1535
1580
  }; }
1536
- this.cancelPendingFetches(globals.newInvariantError(35));
1581
+ this.cancelPendingFetches(globals.newInvariantError(42));
1537
1582
  this.queries.forEach(function (queryInfo) {
1538
1583
  if (queryInfo.observableQuery) {
1539
1584
  queryInfo.networkStatus = exports.NetworkStatus.loading;
@@ -1615,10 +1660,10 @@ var QueryManager = (function () {
1615
1660
  if (!included) {
1616
1661
  var queryName = queryNames.get(nameOrQueryString);
1617
1662
  if (queryName) {
1618
- globalThis.__DEV__ !== false && globals.invariant.warn(36, queryName);
1663
+ globalThis.__DEV__ !== false && globals.invariant.warn(43, queryName);
1619
1664
  }
1620
1665
  else {
1621
- globalThis.__DEV__ !== false && globals.invariant.warn(37);
1666
+ globalThis.__DEV__ !== false && globals.invariant.warn(44);
1622
1667
  }
1623
1668
  }
1624
1669
  });
@@ -1631,7 +1676,9 @@ var QueryManager = (function () {
1631
1676
  var observableQueryPromises = [];
1632
1677
  this.getObservableQueries(includeStandby ? "all" : "active").forEach(function (observableQuery, queryId) {
1633
1678
  var fetchPolicy = observableQuery.options.fetchPolicy;
1634
- observableQuery.resetLastResults();
1679
+ muteDeprecations("resetLastResults", function () {
1680
+ return observableQuery.resetLastResults();
1681
+ });
1635
1682
  if (includeStandby ||
1636
1683
  (fetchPolicy !== "standby" && fetchPolicy !== "cache-only")) {
1637
1684
  observableQueryPromises.push(observableQuery.refetch());
@@ -1944,7 +1991,7 @@ var QueryManager = (function () {
1944
1991
  !this.noCacheWarningsByQueryId.has(operationId)) {
1945
1992
  this.noCacheWarningsByQueryId.add(operationId);
1946
1993
  globalThis.__DEV__ !== false && globals.invariant.warn(
1947
- 38,
1994
+ 45,
1948
1995
  (_c = utilities.getOperationName(document)) !== null && _c !== void 0 ? _c : "Unnamed ".concat(operationType !== null && operationType !== void 0 ? operationType : "operation")
1949
1996
  );
1950
1997
  }
@@ -2259,7 +2306,7 @@ var LocalState = (function () {
2259
2306
  }
2260
2307
  else {
2261
2308
  fragment = fragmentMap[selection.name.value];
2262
- globals.invariant(fragment, 20, selection.name.value);
2309
+ globals.invariant(fragment, 21, selection.name.value);
2263
2310
  }
2264
2311
  if (fragment && fragment.typeCondition) {
2265
2312
  typeCondition = fragment.typeCondition.name.value;
@@ -2373,7 +2420,7 @@ var LocalState = (function () {
2373
2420
  },
2374
2421
  FragmentSpread: function (spread, _, __, ___, ancestors) {
2375
2422
  var fragment = fragmentMap[spread.name.value];
2376
- globals.invariant(fragment, 21, spread.name.value);
2423
+ globals.invariant(fragment, 22, spread.name.value);
2377
2424
  var fragmentSelections = collectByDefinition(fragment);
2378
2425
  if (fragmentSelections.size > 0) {
2379
2426
  ancestors.forEach(function (node) {
@@ -2626,6 +2673,7 @@ var ApolloClient = (function () {
2626
2673
  }
2627
2674
  if (globalThis.__DEV__ !== false) {
2628
2675
  warnRemovedOption(options, "canonizeResults", "client.watchQuery");
2676
+ warnRemovedOption(options, "partialRefetch", "client.watchQuery");
2629
2677
  }
2630
2678
  return this.queryManager.watchQuery(options);
2631
2679
  };
@@ -2639,6 +2687,10 @@ var ApolloClient = (function () {
2639
2687
  }
2640
2688
  if (globalThis.__DEV__ !== false) {
2641
2689
  warnRemovedOption(options, "canonizeResults", "client.query");
2690
+ warnRemovedOption(options, "notifyOnNetworkStatusChange", "client.query", "This option does not affect `client.query` and can be safely removed.");
2691
+ if (options.fetchPolicy === "standby") {
2692
+ globalThis.__DEV__ !== false && globals.invariant.warn(19);
2693
+ }
2642
2694
  }
2643
2695
  return this.queryManager.query(options);
2644
2696
  };
@@ -2742,7 +2794,7 @@ var ApolloClient = (function () {
2742
2794
  result.queries = queries;
2743
2795
  result.results = results;
2744
2796
  result.catch(function (error) {
2745
- globalThis.__DEV__ !== false && globals.invariant.debug(19, error);
2797
+ globalThis.__DEV__ !== false && globals.invariant.debug(20, error);
2746
2798
  });
2747
2799
  return result;
2748
2800
  };