@apollo/client 3.10.3 → 3.10.4

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