@apollo/client 3.14.0-rc.0 → 3.14.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.
Files changed (134) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/apollo-client.cjs +85 -77
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +14 -41
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +14 -41
  8. package/cache/core/cache.js +1 -1
  9. package/cache/core/cache.js.map +1 -1
  10. package/cache/inmemory/inMemoryCache.js +1 -1
  11. package/cache/inmemory/inMemoryCache.js.map +1 -1
  12. package/core/ApolloClient.js +1 -1
  13. package/core/ApolloClient.js.map +1 -1
  14. package/core/ObservableQuery.d.ts +1 -0
  15. package/core/ObservableQuery.js +10 -6
  16. package/core/ObservableQuery.js.map +1 -1
  17. package/core/QueryInfo.js +1 -1
  18. package/core/QueryInfo.js.map +1 -1
  19. package/core/QueryManager.js +1 -1
  20. package/core/QueryManager.js.map +1 -1
  21. package/core/core.cjs +38 -61
  22. package/core/core.cjs.map +1 -1
  23. package/core/core.cjs.native.js +38 -61
  24. package/dev/dev.cjs +49 -53
  25. package/dev/dev.cjs.map +1 -1
  26. package/dev/dev.cjs.native.js +49 -53
  27. package/invariantErrorCodes.js +48 -53
  28. package/link/core/ApolloLink.js +1 -1
  29. package/link/core/ApolloLink.js.map +1 -1
  30. package/link/core/core.cjs +1 -15
  31. package/link/core/core.cjs.map +1 -1
  32. package/link/core/core.cjs.native.js +1 -15
  33. package/package.json +1 -1
  34. package/react/components/components.cjs +2 -14
  35. package/react/components/components.cjs.map +1 -1
  36. package/react/components/components.cjs.native.js +2 -14
  37. package/react/hoc/graphql.js +1 -1
  38. package/react/hoc/graphql.js.map +1 -1
  39. package/react/hoc/hoc.cjs +12 -31
  40. package/react/hoc/hoc.cjs.map +1 -1
  41. package/react/hoc/hoc.cjs.native.js +12 -31
  42. package/react/hoc/mutation-hoc.js +1 -1
  43. package/react/hoc/mutation-hoc.js.map +1 -1
  44. package/react/hoc/query-hoc.js +1 -1
  45. package/react/hoc/query-hoc.js.map +1 -1
  46. package/react/hoc/subscription-hoc.js +1 -1
  47. package/react/hoc/subscription-hoc.js.map +1 -1
  48. package/react/hooks/hooks.cjs +26 -52
  49. package/react/hooks/hooks.cjs.map +1 -1
  50. package/react/hooks/hooks.cjs.native.js +26 -52
  51. package/react/hooks/internal/useWarnRemoved.d.ts +1 -1
  52. package/react/hooks/internal/useWarnRemoved.js +1 -1
  53. package/react/hooks/internal/useWarnRemoved.js.map +1 -1
  54. package/react/hooks/internal/useWarnRemovedOption.d.ts +2 -1
  55. package/react/hooks/internal/useWarnRemovedOption.js +7 -5
  56. package/react/hooks/internal/useWarnRemovedOption.js.map +1 -1
  57. package/react/hooks/useApolloClient.js +1 -1
  58. package/react/hooks/useBackgroundQuery.js +1 -1
  59. package/react/hooks/useBackgroundQuery.js.map +1 -1
  60. package/react/hooks/useFragment.js +1 -1
  61. package/react/hooks/useFragment.js.map +1 -1
  62. package/react/hooks/useLazyQuery.js +3 -3
  63. package/react/hooks/useLazyQuery.js.map +1 -1
  64. package/react/hooks/useLoadableQuery.js +3 -3
  65. package/react/hooks/useLoadableQuery.js.map +1 -1
  66. package/react/hooks/useQuery.js +3 -3
  67. package/react/hooks/useQuery.js.map +1 -1
  68. package/react/hooks/useSubscription.js +3 -3
  69. package/react/hooks/useSuspenseQuery.js +3 -3
  70. package/react/hooks/useSuspenseQuery.js.map +1 -1
  71. package/react/hooks/useSyncExternalStore.js +1 -1
  72. package/react/internal/cache/QueryReference.js +2 -2
  73. package/react/internal/cache/QueryReference.js.map +1 -1
  74. package/react/internal/internal.cjs +3 -14
  75. package/react/internal/internal.cjs.map +1 -1
  76. package/react/internal/internal.cjs.native.js +3 -14
  77. package/react/parser/index.js +7 -7
  78. package/react/parser/index.js.map +1 -1
  79. package/react/parser/parser.cjs +9 -29
  80. package/react/parser/parser.cjs.map +1 -1
  81. package/react/parser/parser.cjs.native.js +9 -29
  82. package/react/query-preloader/createQueryPreloader.js +1 -1
  83. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  84. package/react/react.cjs +4 -31
  85. package/react/react.cjs.map +1 -1
  86. package/react/react.cjs.native.js +4 -31
  87. package/testing/core/core.cjs +4 -4
  88. package/testing/core/core.cjs.map +1 -1
  89. package/testing/core/core.cjs.native.js +4 -4
  90. package/testing/core/mocking/mockLink.d.ts +13 -0
  91. package/testing/core/mocking/mockLink.js +4 -4
  92. package/testing/core/mocking/mockLink.js.map +1 -1
  93. package/testing/internal/disposables/index.d.ts +1 -0
  94. package/testing/internal/disposables/index.js +1 -0
  95. package/testing/internal/disposables/index.js.map +1 -1
  96. package/testing/internal/disposables/withMutedDeprecations.d.ts +4 -0
  97. package/testing/internal/disposables/withMutedDeprecations.js +13 -0
  98. package/testing/internal/disposables/withMutedDeprecations.js.map +1 -0
  99. package/testing/react/MockedProvider.js +1 -1
  100. package/testing/react/MockedProvider.js.map +1 -1
  101. package/testing/testing.cjs +5 -32
  102. package/testing/testing.cjs.map +1 -1
  103. package/testing/testing.cjs.native.js +5 -32
  104. package/utilities/deprecation/index.d.ts +0 -3
  105. package/utilities/deprecation/index.js +4 -12
  106. package/utilities/deprecation/index.js.map +1 -1
  107. package/utilities/globals/globals.cjs +1 -1
  108. package/utilities/globals/globals.cjs.map +1 -1
  109. package/utilities/globals/globals.cjs.native.js +1 -1
  110. package/utilities/graphql/DocumentTransform.js +1 -1
  111. package/utilities/graphql/directives.js +7 -7
  112. package/utilities/graphql/fragments.js +3 -3
  113. package/utilities/graphql/getFromAST.js +8 -8
  114. package/utilities/graphql/storeUtils.js +1 -1
  115. package/utilities/graphql/transform.js +2 -2
  116. package/utilities/index.d.ts +2 -0
  117. package/utilities/index.js +1 -0
  118. package/utilities/index.js.map +1 -1
  119. package/utilities/utilities.cjs +54 -22
  120. package/utilities/utilities.cjs.map +1 -1
  121. package/utilities/utilities.cjs.native.js +54 -22
  122. package/version.js +1 -1
  123. package/.changeset/breezy-lions-rule.md +0 -5
  124. package/.changeset/chilled-cameras-scream.md +0 -5
  125. package/.changeset/great-jobs-fetch.md +0 -5
  126. package/.changeset/great-suns-cover.md +0 -5
  127. package/.changeset/perfect-donuts-roll.md +0 -5
  128. package/.changeset/popular-waves-drop.md +0 -5
  129. package/.changeset/pre.json +0 -20
  130. package/.changeset/shy-boxes-exercise.md +0 -5
  131. package/.changeset/shy-dragons-tease.md +0 -5
  132. package/.changeset/smooth-countries-cough.md +0 -5
  133. package/.changeset/spotty-walls-repair.md +0 -5
  134. package/.changeset/tidy-bulldogs-exercise.md +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#13168](https://github.com/apollographql/apollo-client/pull/13168) [`6b84ec0`](https://github.com/apollographql/apollo-client/commit/6b84ec02d39a22690ae34113fccf24d59a1142a1) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix issue where muting a deprecation from one entrypoint would not mute the warning when checked in a different entrypoint. This caused some rogue deprecation warnings to appear in the console even though the warnings should have been muted.
8
+
9
+ - [#12970](https://github.com/apollographql/apollo-client/pull/12970) [`f91fab5`](https://github.com/apollographql/apollo-client/commit/f91fab505d8c08ce2bd793e8e73e354f8b8e2534) Thanks [@acemir](https://github.com/acemir)! - Add a deprecation message for the `variableMatcher` option in `MockLink`.
10
+
11
+ - [#13168](https://github.com/apollographql/apollo-client/pull/13168) [`6b84ec0`](https://github.com/apollographql/apollo-client/commit/6b84ec02d39a22690ae34113fccf24d59a1142a1) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ensure deprecation warnings are properly silenced in React hooks when globally disabled.
12
+
13
+ ## 3.14.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#12752](https://github.com/apollographql/apollo-client/pull/12752) [`8b779b4`](https://github.com/apollographql/apollo-client/commit/8b779b428b9dc9dad3e78f02bba6646ff415631d) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add deprecations and warnings to remaining APIs changed in Apollo Client 4.0.
18
+
19
+ - [#12746](https://github.com/apollographql/apollo-client/pull/12746) [`0bcd2f4`](https://github.com/apollographql/apollo-client/commit/0bcd2f4ead372eb5928bbd5c00b0bd48e497a5e1) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add warnings and deprecations for options and methods for all React APIs.
20
+
21
+ - [#12751](https://github.com/apollographql/apollo-client/pull/12751) [`567cad8`](https://github.com/apollographql/apollo-client/commit/567cad8fcc30ac3b82560abc24970d33f160622e) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add `@deprecated` tags to all properties returned from any query API (e.g. `client.query`, `observableQuery.refetch`, etc.), `client.mutate`, and `client.subscribe` that are no longer available in Apollo Client 4.0.
22
+
23
+ - [#12746](https://github.com/apollographql/apollo-client/pull/12746) [`0bcd2f4`](https://github.com/apollographql/apollo-client/commit/0bcd2f4ead372eb5928bbd5c00b0bd48e497a5e1) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add `preloadQuery.toPromise(queryRef)` as a replacement for `queryRef.toPromise()`. `queryRef.toPromise()` has been removed in Apollo Client 4.0 in favor of `preloadQuery.toPromise` and is now considered deprecated.
24
+
25
+ - [#12736](https://github.com/apollographql/apollo-client/pull/12736) [`ea89440`](https://github.com/apollographql/apollo-client/commit/ea8944013278060ef87dfa4de6663a21b5204880) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add deprecations and deprecation warnings for `ApolloClient` options and methods.
26
+
27
+ - [#12763](https://github.com/apollographql/apollo-client/pull/12763) [`5de6a3d`](https://github.com/apollographql/apollo-client/commit/5de6a3d3189afa2a7c3bb2eb08d3c4394ae4a16d) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Version bump only to release latest as `rc`.
28
+
29
+ - [#12459](https://github.com/apollographql/apollo-client/pull/12459) [`1c5a031`](https://github.com/apollographql/apollo-client/commit/1c5a0313d388945aeda93b2c1992ad77f4416fa1) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Reset `addTypenameTransform` and `fragments` caches when calling `cache.gc()` only when `resetResultCache` is `true`.
30
+
31
+ - [#12743](https://github.com/apollographql/apollo-client/pull/12743) [`92ad409`](https://github.com/apollographql/apollo-client/commit/92ad4097e5c83e0a780ede20db34e9e63fb98e8b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add deprecations and warnings for `addTypename` in `InMemoryCache` and `MockedProvider`.
32
+
33
+ - [#12743](https://github.com/apollographql/apollo-client/pull/12743) [`92ad409`](https://github.com/apollographql/apollo-client/commit/92ad4097e5c83e0a780ede20db34e9e63fb98e8b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add deprecations and warnings for `canonizeResults`.
34
+
35
+ - [#12751](https://github.com/apollographql/apollo-client/pull/12751) [`567cad8`](https://github.com/apollographql/apollo-client/commit/567cad8fcc30ac3b82560abc24970d33f160622e) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Warn when using a `standby` fetch policy with `client.query`.
36
+
37
+ ### Patch Changes
38
+
39
+ - [#12750](https://github.com/apollographql/apollo-client/pull/12750) [`ecf3de1`](https://github.com/apollographql/apollo-client/commit/ecf3de1cc9a2cf3aaeba0c945909324b9e4b478a) Thanks [@phryneas](https://github.com/phryneas)! - Prevent field policies from overwriting/merging into supertype field policies.
40
+
3
41
  ## 3.14.0-rc.0
4
42
 
5
43
  ### Minor Changes
@@ -36,6 +74,12 @@
36
74
 
37
75
  - [#12750](https://github.com/apollographql/apollo-client/pull/12750) [`ecf3de1`](https://github.com/apollographql/apollo-client/commit/ecf3de1cc9a2cf3aaeba0c945909324b9e4b478a) Thanks [@phryneas](https://github.com/phryneas)! - Prevent field policies from overwriting/merging into supertype field policies.
38
76
 
77
+ ## 3.13.9
78
+
79
+ ### Patch Changes
80
+
81
+ - [#12804](https://github.com/apollographql/apollo-client/pull/12804) [`32c9aa9`](https://github.com/apollographql/apollo-client/commit/32c9aa9215fab72e9ab68ee71198ce242157f855) Thanks [@phryneas](https://github.com/phryneas)! - Fix a possible race condition on queries that were reobserved before they were subscribed to the first time.
82
+
39
83
  ## 3.13.8
40
84
 
41
85
  ### Patch Changes
package/apollo-client.cjs CHANGED
@@ -31,7 +31,7 @@ function _interopNamespace(e) {
31
31
  var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
32
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
33
 
34
- var version = "3.14.0-rc.0";
34
+ var version = "3.14.1";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -145,7 +145,7 @@ function shouldInclude(_a, variables) {
145
145
  if (ifArgument.value.kind === "Variable") {
146
146
  evaledValue =
147
147
  variables && variables[ifArgument.value.name.value];
148
- invariant(evaledValue !== void 0, 106, directive.name.value);
148
+ invariant(evaledValue !== void 0, 105, directive.name.value);
149
149
  }
150
150
  else {
151
151
  evaledValue = ifArgument.value.value;
@@ -180,12 +180,12 @@ function getInclusionDirectives(directives) {
180
180
  return;
181
181
  var directiveArguments = directive.arguments;
182
182
  var directiveName = directive.name.value;
183
- invariant(directiveArguments && directiveArguments.length === 1, 107, directiveName);
183
+ invariant(directiveArguments && directiveArguments.length === 1, 106, directiveName);
184
184
  var ifArgument = directiveArguments[0];
185
- invariant(ifArgument.name && ifArgument.name.value === "if", 108, directiveName);
185
+ invariant(ifArgument.name && ifArgument.name.value === "if", 107, directiveName);
186
186
  var ifValue = ifArgument.value;
187
187
  invariant(ifValue &&
188
- (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 109, directiveName);
188
+ (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 108, directiveName);
189
189
  result.push({ directive: directive, ifArgument: ifArgument });
190
190
  });
191
191
  }
@@ -207,13 +207,13 @@ function getFragmentMaskMode(fragment) {
207
207
  if (globalThis.__DEV__ !== false) {
208
208
  if (modeArg) {
209
209
  if (modeArg.value.kind === graphql.Kind.VARIABLE) {
210
- globalThis.__DEV__ !== false && invariant.warn(110);
210
+ globalThis.__DEV__ !== false && invariant.warn(109);
211
211
  }
212
212
  else if (modeArg.value.kind !== graphql.Kind.STRING) {
213
- globalThis.__DEV__ !== false && invariant.warn(111);
213
+ globalThis.__DEV__ !== false && invariant.warn(110);
214
214
  }
215
215
  else if (modeArg.value.value !== "migrate") {
216
- globalThis.__DEV__ !== false && invariant.warn(112, modeArg.value.value);
216
+ globalThis.__DEV__ !== false && invariant.warn(111, modeArg.value.value);
217
217
  }
218
218
  }
219
219
  }
@@ -246,7 +246,7 @@ function getFragmentQueryDocument(document, fragmentName) {
246
246
  document.definitions.forEach(function (definition) {
247
247
  if (definition.kind === "OperationDefinition") {
248
248
  throw newInvariantError(
249
- 113,
249
+ 112,
250
250
  definition.operation,
251
251
  definition.name ? " named '".concat(definition.name.value, "'") : ""
252
252
  );
@@ -256,7 +256,7 @@ function getFragmentQueryDocument(document, fragmentName) {
256
256
  }
257
257
  });
258
258
  if (typeof actualFragmentName === "undefined") {
259
- invariant(fragments.length === 1, 114, fragments.length);
259
+ invariant(fragments.length === 1, 113, fragments.length);
260
260
  actualFragmentName = fragments[0].name.value;
261
261
  }
262
262
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -297,7 +297,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
297
297
  return fragmentMap(fragmentName);
298
298
  }
299
299
  var fragment = fragmentMap && fragmentMap[fragmentName];
300
- invariant(fragment, 115, fragmentName);
300
+ invariant(fragment, 114, fragmentName);
301
301
  return fragment || null;
302
302
  }
303
303
  default:
@@ -562,7 +562,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
562
562
  argObj[name.value] = null;
563
563
  }
564
564
  else {
565
- throw newInvariantError(124, name.value, value.kind);
565
+ throw newInvariantError(123, name.value, value.kind);
566
566
  }
567
567
  }
568
568
  function storeKeyNameFromField(field, variables) {
@@ -696,16 +696,16 @@ function isInlineFragment(selection) {
696
696
  }
697
697
 
698
698
  function checkDocument(doc) {
699
- invariant(doc && doc.kind === "Document", 116);
699
+ invariant(doc && doc.kind === "Document", 115);
700
700
  var operations = doc.definitions
701
701
  .filter(function (d) { return d.kind !== "FragmentDefinition"; })
702
702
  .map(function (definition) {
703
703
  if (definition.kind !== "OperationDefinition") {
704
- throw newInvariantError(117, definition.kind);
704
+ throw newInvariantError(116, definition.kind);
705
705
  }
706
706
  return definition;
707
707
  });
708
- invariant(operations.length <= 1, 118, operations.length);
708
+ invariant(operations.length <= 1, 117, operations.length);
709
709
  return doc;
710
710
  }
711
711
  function getOperationDefinition(doc) {
@@ -728,14 +728,14 @@ function getFragmentDefinitions(doc) {
728
728
  }
729
729
  function getQueryDefinition(doc) {
730
730
  var queryDef = getOperationDefinition(doc);
731
- invariant(queryDef && queryDef.operation === "query", 119);
731
+ invariant(queryDef && queryDef.operation === "query", 118);
732
732
  return queryDef;
733
733
  }
734
734
  function getFragmentDefinition(doc) {
735
- invariant(doc.kind === "Document", 120);
736
- invariant(doc.definitions.length <= 1, 121);
735
+ invariant(doc.kind === "Document", 119);
736
+ invariant(doc.definitions.length <= 1, 120);
737
737
  var fragmentDef = doc.definitions[0];
738
- invariant(fragmentDef.kind === "FragmentDefinition", 122);
738
+ invariant(fragmentDef.kind === "FragmentDefinition", 121);
739
739
  return fragmentDef;
740
740
  }
741
741
  function getMainDefinition(queryDoc) {
@@ -758,7 +758,7 @@ function getMainDefinition(queryDoc) {
758
758
  if (fragmentDefinition) {
759
759
  return fragmentDefinition;
760
760
  }
761
- throw newInvariantError(123);
761
+ throw newInvariantError(122);
762
762
  }
763
763
  function getDefaultValues(definition) {
764
764
  var defaultValues = Object.create(null);
@@ -809,7 +809,7 @@ var DocumentTransform = (function () {
809
809
  makeCacheKey: function (document) {
810
810
  var cacheKeys = _this.getCacheKey(document);
811
811
  if (cacheKeys) {
812
- invariant(Array.isArray(cacheKeys), 105);
812
+ invariant(Array.isArray(cacheKeys), 104);
813
813
  return stableCacheKeys_1.lookupArray(cacheKeys);
814
814
  }
815
815
  },
@@ -939,7 +939,7 @@ function removeDirectivesFromDocument(directives, doc) {
939
939
  return getInUseByFragmentName(ancestor.name.value);
940
940
  }
941
941
  }
942
- globalThis.__DEV__ !== false && invariant.error(125);
942
+ globalThis.__DEV__ !== false && invariant.error(124);
943
943
  return null;
944
944
  };
945
945
  var operationCount = 0;
@@ -1603,6 +1603,35 @@ function mergeOptions(defaults, options) {
1603
1603
  });
1604
1604
  }
1605
1605
 
1606
+ var _a;
1607
+ var muteAllDeprecations = Symbol.for("apollo.deprecations");
1608
+ var deprecationsSlot = Symbol.for("apollo.deprecations.slot");
1609
+ var global$1 = untypedGlobal;
1610
+ var slot = ((_a = global$1[deprecationsSlot]) !== null && _a !== void 0 ? _a : (global$1[deprecationsSlot] = new optimism.Slot()));
1611
+ function isMuted(name) {
1612
+ return global$1[muteAllDeprecations] || (slot.getValue() || []).includes(name);
1613
+ }
1614
+ function muteDeprecations(name) {
1615
+ var args = [];
1616
+ for (var _i = 1; _i < arguments.length; _i++) {
1617
+ args[_i - 1] = arguments[_i];
1618
+ }
1619
+ return slot.withValue.apply(slot, tslib.__spreadArray([Array.isArray(name) ? name : [name]], args, false));
1620
+ }
1621
+ function warnRemovedOption(options, name, callSite, recommendation) {
1622
+ if (recommendation === void 0) { recommendation = "Please remove this option."; }
1623
+ warnDeprecated(name, function () {
1624
+ if (name in options) {
1625
+ globalThis.__DEV__ !== false && invariant.warn(103, callSite, name, recommendation);
1626
+ }
1627
+ });
1628
+ }
1629
+ function warnDeprecated(name, cb) {
1630
+ if (!isMuted(name)) {
1631
+ cb();
1632
+ }
1633
+ }
1634
+
1606
1635
  function fromError(errorValue) {
1607
1636
  return new zenObservableTs.Observable(function (observer) {
1608
1637
  observer.error(errorValue);
@@ -1719,33 +1748,6 @@ function filterOperationVariables(variables, query) {
1719
1748
  return result;
1720
1749
  }
1721
1750
 
1722
- var muteAllDeprecations = Symbol.for("apollo.deprecations");
1723
- var global$1 = untypedGlobal;
1724
- var slot = new optimism.Slot();
1725
- function isMuted(name) {
1726
- return global$1[muteAllDeprecations] || (slot.getValue() || []).includes(name);
1727
- }
1728
- function muteDeprecations(name) {
1729
- var args = [];
1730
- for (var _i = 1; _i < arguments.length; _i++) {
1731
- args[_i - 1] = arguments[_i];
1732
- }
1733
- return slot.withValue.apply(slot, tslib.__spreadArray([Array.isArray(name) ? name : [name]], args, false));
1734
- }
1735
- function warnRemovedOption(options, name, callSite, recommendation) {
1736
- if (recommendation === void 0) { recommendation = "Please remove this option."; }
1737
- warnDeprecated(name, function () {
1738
- if (name in options) {
1739
- globalThis.__DEV__ !== false && invariant.warn(104, callSite, name, recommendation);
1740
- }
1741
- });
1742
- }
1743
- function warnDeprecated(name, cb) {
1744
- if (!isMuted(name)) {
1745
- cb();
1746
- }
1747
- }
1748
-
1749
1751
  function passthrough(op, forward) {
1750
1752
  return (forward ? forward(op) : zenObservableTs.Observable.of());
1751
1753
  }
@@ -5245,10 +5247,7 @@ var ObservableQuery = (function (_super) {
5245
5247
  var _this = this;
5246
5248
  var startedInactive = ObservableQuery.inactiveOnCreation.getValue();
5247
5249
  _this = _super.call(this, function (observer) {
5248
- if (startedInactive) {
5249
- queryManager["queries"].set(_this.queryId, queryInfo);
5250
- startedInactive = false;
5251
- }
5250
+ _this._getOrCreateQuery();
5252
5251
  try {
5253
5252
  var subObserver = observer._subscription._observer;
5254
5253
  if (subObserver && !subObserver.error) {
@@ -5277,6 +5276,13 @@ var ObservableQuery = (function (_super) {
5277
5276
  _this.observers = new Set();
5278
5277
  _this.subscriptions = new Set();
5279
5278
  _this.dirty = false;
5279
+ _this._getOrCreateQuery = function () {
5280
+ if (startedInactive) {
5281
+ queryManager["queries"].set(_this.queryId, queryInfo);
5282
+ startedInactive = false;
5283
+ }
5284
+ return _this.queryManager.getOrCreateQuery(_this.queryId);
5285
+ };
5280
5286
  _this.queryInfo = queryInfo;
5281
5287
  _this.queryManager = queryManager;
5282
5288
  _this.waitForOwnResult = skipCacheDataFor(options.fetchPolicy);
@@ -5664,7 +5670,7 @@ var ObservableQuery = (function (_super) {
5664
5670
  return options.fetchPolicy;
5665
5671
  };
5666
5672
  ObservableQuery.prototype.fetch = function (options, newNetworkStatus, query) {
5667
- var queryInfo = this.queryManager.getOrCreateQuery(this.queryId);
5673
+ var queryInfo = this._getOrCreateQuery();
5668
5674
  queryInfo.setObservableQuery(this);
5669
5675
  return this.queryManager["fetchConcastWithInfo"](queryInfo, options, newNetworkStatus, query);
5670
5676
  };
@@ -7823,7 +7829,7 @@ var ApolloProvider = function (_a) {
7823
7829
  function useApolloClient(override) {
7824
7830
  var context = React__namespace.useContext(getApolloContext());
7825
7831
  var client = override || context.client;
7826
- invariant(!!client, 79);
7832
+ invariant(!!client, 78);
7827
7833
  return client;
7828
7834
  }
7829
7835
 
@@ -7838,7 +7844,7 @@ var useSyncExternalStore = realHook$1 ||
7838
7844
  !didWarnUncachedGetSnapshot &&
7839
7845
  value !== getSnapshot()) {
7840
7846
  didWarnUncachedGetSnapshot = true;
7841
- globalThis.__DEV__ !== false && invariant.error(92);
7847
+ globalThis.__DEV__ !== false && invariant.error(91);
7842
7848
  }
7843
7849
  var _a = React__namespace.useState({
7844
7850
  inst: { value: value, getSnapshot: getSnapshot },
@@ -7900,7 +7906,7 @@ function operationName(type) {
7900
7906
  }
7901
7907
  function parser(document) {
7902
7908
  warnDeprecated("parser", function () {
7903
- globalThis.__DEV__ !== false && invariant.warn(94);
7909
+ globalThis.__DEV__ !== false && invariant.warn(93);
7904
7910
  });
7905
7911
  if (!cache) {
7906
7912
  cache = new AutoCleanedWeakCache(cacheSizes.parser || 1000 );
@@ -7909,7 +7915,7 @@ function parser(document) {
7909
7915
  if (cached)
7910
7916
  return cached;
7911
7917
  var variables, type, name;
7912
- invariant(!!document && !!document.kind, 95, document);
7918
+ invariant(!!document && !!document.kind, 94, document);
7913
7919
  var fragments = [];
7914
7920
  var queries = [];
7915
7921
  var mutations = [];
@@ -7937,10 +7943,10 @@ function parser(document) {
7937
7943
  invariant(!fragments.length ||
7938
7944
  queries.length ||
7939
7945
  mutations.length ||
7940
- subscriptions.length, 96);
7946
+ subscriptions.length, 95);
7941
7947
  invariant(
7942
7948
  queries.length + mutations.length + subscriptions.length <= 1,
7943
- 97,
7949
+ 96,
7944
7950
  document,
7945
7951
  queries.length,
7946
7952
  subscriptions.length,
@@ -7952,7 +7958,7 @@ function parser(document) {
7952
7958
  var definitions = queries.length ? queries
7953
7959
  : mutations.length ? mutations
7954
7960
  : subscriptions;
7955
- invariant(definitions.length === 1, 98, document, definitions.length);
7961
+ invariant(definitions.length === 1, 97, document, definitions.length);
7956
7962
  var definition = definitions[0];
7957
7963
  variables = definition.variableDefinitions || [];
7958
7964
  if (definition.name && definition.name.kind === "Name") {
@@ -7977,7 +7983,7 @@ function verifyDocumentType(document, type) {
7977
7983
  var usedOperationName = operationName(operation.type);
7978
7984
  invariant(
7979
7985
  operation.type === type,
7980
- 99,
7986
+ 98,
7981
7987
  requiredOperationName,
7982
7988
  requiredOperationName,
7983
7989
  usedOperationName
@@ -8021,9 +8027,11 @@ function useWarnRemovedOption(options, name, callSite, recommendation) {
8021
8027
  "use no memo";
8022
8028
  if (recommendation === void 0) { recommendation = "Please remove this option."; }
8023
8029
  var didWarn = React__namespace.useRef(false);
8024
- if (name in options && !didWarn.current) {
8025
- globalThis.__DEV__ !== false && invariant.warn(78, callSite, name, recommendation);
8026
- didWarn.current = true;
8030
+ if (globalThis.__DEV__ !== false) {
8031
+ if (name in options && !didWarn.current) {
8032
+ warnRemovedOption(options, name, callSite, recommendation);
8033
+ didWarn.current = true;
8034
+ }
8027
8035
  }
8028
8036
  }
8029
8037
 
@@ -8079,7 +8087,7 @@ function useInternalState(client, query, options, renderPromises, makeWatchQuery
8079
8087
  (renderPromises &&
8080
8088
  renderPromises.getSSRObservable(makeWatchQueryOptions())) ||
8081
8089
  ObservableQuery["inactiveOnCreation"].withValue(!renderPromises, function () {
8082
- return muteDeprecations("canonizeResults", function () {
8090
+ return muteDeprecations(["canonizeResults", "partialRefetch"], function () {
8083
8091
  return client.watchQuery(getObsQueryOptions(void 0, client, options, makeWatchQueryOptions()));
8084
8092
  });
8085
8093
  }),
@@ -8354,7 +8362,7 @@ function bindObservableMethods(observable) {
8354
8362
  args[_i] = arguments[_i];
8355
8363
  }
8356
8364
  if (globalThis.__DEV__ !== false) {
8357
- globalThis.__DEV__ !== false && invariant.warn(84);
8365
+ globalThis.__DEV__ !== false && invariant.warn(83);
8358
8366
  }
8359
8367
  return observable.reobserve.apply(observable, args);
8360
8368
  },
@@ -8428,7 +8436,7 @@ function useLazyQuery(query, options) {
8428
8436
  eagerMethods[key] = function () {
8429
8437
  if (globalThis.__DEV__ !== false) {
8430
8438
  if (key === "reobserve") {
8431
- globalThis.__DEV__ !== false && invariant.warn(80);
8439
+ globalThis.__DEV__ !== false && invariant.warn(79);
8432
8440
  }
8433
8441
  }
8434
8442
  if (!execOptionsRef.current) {
@@ -8451,7 +8459,7 @@ function useLazyQuery(query, options) {
8451
8459
  var execute = React__namespace.useCallback(function (executeOptions) {
8452
8460
  if (globalThis.__DEV__ !== false) {
8453
8461
  if (calledDuringRender()) {
8454
- globalThis.__DEV__ !== false && invariant.warn(81);
8462
+ globalThis.__DEV__ !== false && invariant.warn(80);
8455
8463
  }
8456
8464
  for (var _i = 0, REMOVED_EXECUTE_OPTIONS_1 = REMOVED_EXECUTE_OPTIONS; _i < REMOVED_EXECUTE_OPTIONS_1.length; _i++) {
8457
8465
  var name_1 = REMOVED_EXECUTE_OPTIONS_1[_i];
@@ -8642,10 +8650,10 @@ function useSubscription(subscription, options) {
8642
8650
  if (!hasIssuedDeprecationWarningRef.current) {
8643
8651
  hasIssuedDeprecationWarningRef.current = true;
8644
8652
  if (options.onSubscriptionData) {
8645
- globalThis.__DEV__ !== false && invariant.warn(options.onData ? 85 : 86);
8653
+ globalThis.__DEV__ !== false && invariant.warn(options.onData ? 84 : 85);
8646
8654
  }
8647
8655
  if (options.onSubscriptionComplete) {
8648
- globalThis.__DEV__ !== false && invariant.warn(options.onComplete ? 87 : 88);
8656
+ globalThis.__DEV__ !== false && invariant.warn(options.onComplete ? 86 : 87);
8649
8657
  }
8650
8658
  }
8651
8659
  var skip = options.skip, fetchPolicy = options.fetchPolicy, errorPolicy = options.errorPolicy, shouldResubscribe = options.shouldResubscribe, context = options.context, extensions = options.extensions, ignoreResults = options.ignoreResults;
@@ -8766,7 +8774,7 @@ function useSubscription(subscription, options) {
8766
8774
  : fallbackResult;
8767
8775
  }, function () { return fallbackResult; });
8768
8776
  var restart = React__namespace.useCallback(function () {
8769
- invariant(!optionsRef.current.skip, 89);
8777
+ invariant(!optionsRef.current.skip, 88);
8770
8778
  setObservable(recreateRef.current());
8771
8779
  }, [optionsRef, recreateRef]);
8772
8780
  return React__namespace.useMemo(function () { return (tslib.__assign(tslib.__assign({}, ret), { restart: restart })); }, [ret, restart]);
@@ -8896,7 +8904,7 @@ function wrapQueryRef(internalQueryRef) {
8896
8904
  return ref;
8897
8905
  }
8898
8906
  function assertWrappedQueryRef(queryRef) {
8899
- invariant(!queryRef || QUERY_REFERENCE_SYMBOL in queryRef, 93);
8907
+ invariant(!queryRef || QUERY_REFERENCE_SYMBOL in queryRef, 92);
8900
8908
  }
8901
8909
  function getWrappedPromise(queryRef) {
8902
8910
  var internalQueryRef = unwrapQueryRef(queryRef);
@@ -9399,11 +9407,11 @@ function validateFetchPolicy(fetchPolicy) {
9399
9407
  "no-cache",
9400
9408
  "cache-and-network",
9401
9409
  ];
9402
- invariant(supportedFetchPolicies.includes(fetchPolicy), 90, fetchPolicy);
9410
+ invariant(supportedFetchPolicies.includes(fetchPolicy), 89, fetchPolicy);
9403
9411
  }
9404
9412
  function validatePartialDataReturn(fetchPolicy, returnPartialData) {
9405
9413
  if (fetchPolicy === "no-cache" && returnPartialData) {
9406
- globalThis.__DEV__ !== false && invariant.warn(91);
9414
+ globalThis.__DEV__ !== false && invariant.warn(90);
9407
9415
  }
9408
9416
  }
9409
9417
  function toApolloError(result) {
@@ -9573,7 +9581,7 @@ function useLoadableQuery(query, options) {
9573
9581
  for (var _i = 0; _i < arguments.length; _i++) {
9574
9582
  args[_i] = arguments[_i];
9575
9583
  }
9576
- invariant(!calledDuringRender(), 82);
9584
+ invariant(!calledDuringRender(), 81);
9577
9585
  var variables = args[0];
9578
9586
  var cacheKey = tslib.__spreadArray([
9579
9587
  query,
@@ -9594,7 +9602,7 @@ function useLoadableQuery(query, options) {
9594
9602
  client,
9595
9603
  ]);
9596
9604
  var subscribeToMore = React__namespace.useCallback(function (options) {
9597
- invariant(internalQueryRef, 83);
9605
+ invariant(internalQueryRef, 82);
9598
9606
  return internalQueryRef.observable.subscribeToMore(
9599
9607
  options);
9600
9608
  }, [internalQueryRef]);