@apollo/client 3.11.2 → 3.11.3

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 (82) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/apollo-client.cjs +105 -86
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/core/ObservableQuery.js +72 -43
  6. package/core/ObservableQuery.js.map +1 -1
  7. package/core/QueryManager.js +19 -11
  8. package/core/QueryManager.js.map +1 -1
  9. package/core/core.cjs +62 -43
  10. package/core/core.cjs.map +1 -1
  11. package/core/core.cjs.native.js +62 -43
  12. package/dev/dev.cjs +72 -67
  13. package/dev/dev.cjs.map +1 -1
  14. package/dev/dev.cjs.native.js +72 -67
  15. package/invariantErrorCodes.js +72 -66
  16. package/link/core/ApolloLink.js +2 -2
  17. package/link/core/core.cjs +2 -2
  18. package/link/core/core.cjs.map +1 -1
  19. package/link/core/core.cjs.native.js +2 -2
  20. package/link/http/checkFetcher.js +1 -1
  21. package/link/http/createHttpLink.js +1 -1
  22. package/link/http/http.cjs +3 -3
  23. package/link/http/http.cjs.map +1 -1
  24. package/link/http/http.cjs.native.js +3 -3
  25. package/link/http/serializeFetchParameter.js +1 -1
  26. package/link/persisted-queries/index.js +2 -2
  27. package/link/persisted-queries/persisted-queries.cjs +2 -2
  28. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  29. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  30. package/link/utils/toPromise.js +1 -1
  31. package/link/utils/utils.cjs +2 -2
  32. package/link/utils/utils.cjs.map +1 -1
  33. package/link/utils/utils.cjs.native.js +2 -2
  34. package/link/utils/validateOperation.js +1 -1
  35. package/package.json +1 -1
  36. package/react/context/ApolloConsumer.js +1 -1
  37. package/react/context/ApolloContext.js +1 -1
  38. package/react/context/ApolloProvider.js +1 -1
  39. package/react/context/context.cjs +3 -3
  40. package/react/context/context.cjs.map +1 -1
  41. package/react/context/context.cjs.native.js +3 -3
  42. package/react/hoc/hoc-utils.js +1 -1
  43. package/react/hoc/hoc.cjs +2 -2
  44. package/react/hoc/hoc.cjs.map +1 -1
  45. package/react/hoc/hoc.cjs.native.js +2 -2
  46. package/react/hoc/withApollo.js +1 -1
  47. package/react/hooks/hooks.cjs +9 -9
  48. package/react/hooks/hooks.cjs.map +1 -1
  49. package/react/hooks/hooks.cjs.native.js +9 -9
  50. package/react/hooks/useApolloClient.js +1 -1
  51. package/react/hooks/useLoadableQuery.js +2 -2
  52. package/react/hooks/useSubscription.js +3 -3
  53. package/react/hooks/useSuspenseQuery.js +2 -2
  54. package/react/hooks/useSyncExternalStore.js +1 -1
  55. package/react/internal/cache/QueryReference.js +1 -1
  56. package/react/internal/internal.cjs +2 -2
  57. package/react/internal/internal.cjs.map +1 -1
  58. package/react/internal/internal.cjs.native.js +2 -2
  59. package/react/parser/index.js +5 -5
  60. package/react/parser/parser.cjs +5 -5
  61. package/react/parser/parser.cjs.map +1 -1
  62. package/react/parser/parser.cjs.native.js +5 -5
  63. package/testing/core/core.cjs +2 -2
  64. package/testing/core/core.cjs.map +1 -1
  65. package/testing/core/core.cjs.native.js +2 -2
  66. package/testing/core/mocking/mockLink.js +2 -2
  67. package/testing/internal/scenarios/index.d.ts +5 -0
  68. package/testing/internal/scenarios/index.js +1 -1
  69. package/testing/internal/scenarios/index.js.map +1 -1
  70. package/utilities/globals/globals.cjs +1 -1
  71. package/utilities/globals/globals.cjs.map +1 -1
  72. package/utilities/globals/globals.cjs.native.js +1 -1
  73. package/utilities/graphql/DocumentTransform.js +1 -1
  74. package/utilities/graphql/directives.js +4 -4
  75. package/utilities/graphql/fragments.js +3 -3
  76. package/utilities/graphql/getFromAST.js +8 -8
  77. package/utilities/graphql/storeUtils.js +1 -1
  78. package/utilities/graphql/transform.js +2 -2
  79. package/utilities/utilities.cjs +19 -19
  80. package/utilities/utilities.cjs.map +1 -1
  81. package/utilities/utilities.cjs.native.js +19 -19
  82. package/version.js +1 -1
@@ -22,7 +22,7 @@ function shouldInclude(_a, variables) {
22
22
  if (ifArgument.value.kind === "Variable") {
23
23
  evaledValue =
24
24
  variables && variables[ifArgument.value.name.value];
25
- globals.invariant(evaledValue !== void 0, 69, directive.name.value);
25
+ globals.invariant(evaledValue !== void 0, 70, directive.name.value);
26
26
  }
27
27
  else {
28
28
  evaledValue = ifArgument.value.value;
@@ -72,12 +72,12 @@ function getInclusionDirectives(directives) {
72
72
  return;
73
73
  var directiveArguments = directive.arguments;
74
74
  var directiveName = directive.name.value;
75
- globals.invariant(directiveArguments && directiveArguments.length === 1, 70, directiveName);
75
+ globals.invariant(directiveArguments && directiveArguments.length === 1, 71, directiveName);
76
76
  var ifArgument = directiveArguments[0];
77
- globals.invariant(ifArgument.name && ifArgument.name.value === "if", 71, directiveName);
77
+ globals.invariant(ifArgument.name && ifArgument.name.value === "if", 72, directiveName);
78
78
  var ifValue = ifArgument.value;
79
79
  globals.invariant(ifValue &&
80
- (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 72, directiveName);
80
+ (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 73, directiveName);
81
81
  result.push({ directive: directive, ifArgument: ifArgument });
82
82
  });
83
83
  }
@@ -111,7 +111,7 @@ function getFragmentQueryDocument(document, fragmentName) {
111
111
  document.definitions.forEach(function (definition) {
112
112
  if (definition.kind === "OperationDefinition") {
113
113
  throw globals.newInvariantError(
114
- 73,
114
+ 74,
115
115
  definition.operation,
116
116
  definition.name ? " named '".concat(definition.name.value, "'") : ""
117
117
  );
@@ -121,7 +121,7 @@ function getFragmentQueryDocument(document, fragmentName) {
121
121
  }
122
122
  });
123
123
  if (typeof actualFragmentName === "undefined") {
124
- globals.invariant(fragments.length === 1, 74, fragments.length);
124
+ globals.invariant(fragments.length === 1, 75, fragments.length);
125
125
  actualFragmentName = fragments[0].name.value;
126
126
  }
127
127
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -162,7 +162,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
162
162
  return fragmentMap(fragmentName);
163
163
  }
164
164
  var fragment = fragmentMap && fragmentMap[fragmentName];
165
- globals.invariant(fragment, 75, fragmentName);
165
+ globals.invariant(fragment, 76, fragmentName);
166
166
  return fragment || null;
167
167
  }
168
168
  default:
@@ -321,7 +321,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
321
321
  argObj[name.value] = null;
322
322
  }
323
323
  else {
324
- throw globals.newInvariantError(84, name.value, value.kind);
324
+ throw globals.newInvariantError(85, name.value, value.kind);
325
325
  }
326
326
  }
327
327
  function storeKeyNameFromField(field, variables) {
@@ -455,16 +455,16 @@ function isInlineFragment(selection) {
455
455
  }
456
456
 
457
457
  function checkDocument(doc) {
458
- globals.invariant(doc && doc.kind === "Document", 76);
458
+ globals.invariant(doc && doc.kind === "Document", 77);
459
459
  var operations = doc.definitions
460
460
  .filter(function (d) { return d.kind !== "FragmentDefinition"; })
461
461
  .map(function (definition) {
462
462
  if (definition.kind !== "OperationDefinition") {
463
- throw globals.newInvariantError(77, definition.kind);
463
+ throw globals.newInvariantError(78, definition.kind);
464
464
  }
465
465
  return definition;
466
466
  });
467
- globals.invariant(operations.length <= 1, 78, operations.length);
467
+ globals.invariant(operations.length <= 1, 79, operations.length);
468
468
  return doc;
469
469
  }
470
470
  function getOperationDefinition(doc) {
@@ -487,14 +487,14 @@ function getFragmentDefinitions(doc) {
487
487
  }
488
488
  function getQueryDefinition(doc) {
489
489
  var queryDef = getOperationDefinition(doc);
490
- globals.invariant(queryDef && queryDef.operation === "query", 79);
490
+ globals.invariant(queryDef && queryDef.operation === "query", 80);
491
491
  return queryDef;
492
492
  }
493
493
  function getFragmentDefinition(doc) {
494
- globals.invariant(doc.kind === "Document", 80);
495
- globals.invariant(doc.definitions.length <= 1, 81);
494
+ globals.invariant(doc.kind === "Document", 81);
495
+ globals.invariant(doc.definitions.length <= 1, 82);
496
496
  var fragmentDef = doc.definitions[0];
497
- globals.invariant(fragmentDef.kind === "FragmentDefinition", 82);
497
+ globals.invariant(fragmentDef.kind === "FragmentDefinition", 83);
498
498
  return fragmentDef;
499
499
  }
500
500
  function getMainDefinition(queryDoc) {
@@ -517,7 +517,7 @@ function getMainDefinition(queryDoc) {
517
517
  if (fragmentDefinition) {
518
518
  return fragmentDefinition;
519
519
  }
520
- throw globals.newInvariantError(83);
520
+ throw globals.newInvariantError(84);
521
521
  }
522
522
  function getDefaultValues(definition) {
523
523
  var defaultValues = Object.create(null);
@@ -568,7 +568,7 @@ var DocumentTransform = (function () {
568
568
  makeCacheKey: function (document) {
569
569
  var cacheKeys = _this.getCacheKey(document);
570
570
  if (cacheKeys) {
571
- globals.invariant(Array.isArray(cacheKeys), 68);
571
+ globals.invariant(Array.isArray(cacheKeys), 69);
572
572
  return stableCacheKeys_1.lookupArray(cacheKeys);
573
573
  }
574
574
  },
@@ -698,7 +698,7 @@ function removeDirectivesFromDocument(directives, doc) {
698
698
  return getInUseByFragmentName(ancestor.name.value);
699
699
  }
700
700
  }
701
- globalThis.__DEV__ !== false && globals.invariant.error(85);
701
+ globalThis.__DEV__ !== false && globals.invariant.error(86);
702
702
  return null;
703
703
  };
704
704
  var operationCount = 0;
@@ -888,7 +888,7 @@ var connectionRemoveConfig = {
888
888
  if (willRemove) {
889
889
  if (!directive.arguments ||
890
890
  !directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
891
- globalThis.__DEV__ !== false && globals.invariant.warn(86);
891
+ globalThis.__DEV__ !== false && globals.invariant.warn(87);
892
892
  }
893
893
  }
894
894
  return willRemove;
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = "3.11.2";
1
+ export var version = "3.11.3";
2
2
  //# sourceMappingURL=version.js.map