@apollo/client 3.8.5 → 3.8.7

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 (112) hide show
  1. package/apollo-client.cjs +114 -74
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/cache.cjs +46 -11
  5. package/cache/cache.cjs.map +1 -1
  6. package/cache/cache.cjs.native.js +46 -11
  7. package/cache/core/types/common.d.ts +2 -2
  8. package/cache/core/types/common.d.ts.map +1 -1
  9. package/cache/core/types/common.js.map +1 -1
  10. package/cache/inmemory/entityStore.d.ts.map +1 -1
  11. package/cache/inmemory/entityStore.js +35 -0
  12. package/cache/inmemory/entityStore.js.map +1 -1
  13. package/cache/inmemory/key-extractor.js +1 -1
  14. package/cache/inmemory/policies.js +4 -4
  15. package/cache/inmemory/readFromStore.js +2 -2
  16. package/cache/inmemory/writeToStore.js +4 -4
  17. package/core/ApolloClient.js +3 -3
  18. package/core/LocalState.js +2 -2
  19. package/core/ObservableQuery.js +5 -5
  20. package/core/QueryManager.js +9 -9
  21. package/core/core.cjs +20 -20
  22. package/core/core.cjs.map +1 -1
  23. package/core/core.cjs.native.js +20 -20
  24. package/dev/dev.cjs +97 -82
  25. package/dev/dev.cjs.map +1 -1
  26. package/dev/dev.cjs.native.js +97 -82
  27. package/dev/loadErrorMessageHandler.js +1 -1
  28. package/dev/loadErrorMessageHandler.js.map +1 -1
  29. package/invariantErrorCodes.js +95 -80
  30. package/link/core/ApolloLink.js +2 -2
  31. package/link/core/core.cjs +2 -2
  32. package/link/core/core.cjs.map +1 -1
  33. package/link/core/core.cjs.native.js +2 -2
  34. package/link/http/checkFetcher.js +1 -1
  35. package/link/http/createHttpLink.js +1 -1
  36. package/link/http/http.cjs +3 -3
  37. package/link/http/http.cjs.map +1 -1
  38. package/link/http/http.cjs.native.js +3 -3
  39. package/link/http/serializeFetchParameter.js +1 -1
  40. package/link/persisted-queries/index.js +2 -2
  41. package/link/persisted-queries/persisted-queries.cjs +2 -2
  42. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  43. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  44. package/link/utils/toPromise.js +1 -1
  45. package/link/utils/utils.cjs +2 -2
  46. package/link/utils/utils.cjs.map +1 -1
  47. package/link/utils/utils.cjs.native.js +2 -2
  48. package/link/utils/validateOperation.js +1 -1
  49. package/package.json +25 -25
  50. package/react/cache/QueryReference.d.ts.map +1 -1
  51. package/react/cache/QueryReference.js +7 -2
  52. package/react/cache/QueryReference.js.map +1 -1
  53. package/react/context/ApolloConsumer.js +1 -1
  54. package/react/context/ApolloContext.js +1 -1
  55. package/react/context/ApolloProvider.js +1 -1
  56. package/react/context/context.cjs +3 -3
  57. package/react/context/context.cjs.map +1 -1
  58. package/react/context/context.cjs.native.js +3 -3
  59. package/react/hoc/hoc-utils.js +1 -1
  60. package/react/hoc/hoc.cjs +2 -2
  61. package/react/hoc/hoc.cjs.map +1 -1
  62. package/react/hoc/hoc.cjs.native.js +2 -2
  63. package/react/hoc/withApollo.js +1 -1
  64. package/react/hooks/hooks.cjs +15 -10
  65. package/react/hooks/hooks.cjs.map +1 -1
  66. package/react/hooks/hooks.cjs.native.js +15 -10
  67. package/react/hooks/index.d.ts +1 -0
  68. package/react/hooks/index.d.ts.map +1 -1
  69. package/react/hooks/index.js.map +1 -1
  70. package/react/hooks/useApolloClient.js +1 -1
  71. package/react/hooks/useQuery.js +1 -1
  72. package/react/hooks/useReadQuery.d.ts +7 -4
  73. package/react/hooks/useReadQuery.d.ts.map +1 -1
  74. package/react/hooks/useReadQuery.js +1 -1
  75. package/react/hooks/useReadQuery.js.map +1 -1
  76. package/react/hooks/useSubscription.js +2 -2
  77. package/react/hooks/useSuspenseQuery.js +2 -2
  78. package/react/hooks/useSyncExternalStore.js +1 -1
  79. package/react/parser/index.js +5 -5
  80. package/react/parser/parser.cjs +5 -5
  81. package/react/parser/parser.cjs.map +1 -1
  82. package/react/parser/parser.cjs.native.js +5 -5
  83. package/testing/core/core.cjs +1 -1
  84. package/testing/core/core.cjs.map +1 -1
  85. package/testing/core/core.cjs.native.js +1 -1
  86. package/testing/core/mocking/mockLink.js +1 -1
  87. package/testing/react/MockedProvider.d.ts +1 -0
  88. package/testing/react/MockedProvider.d.ts.map +1 -1
  89. package/testing/react/MockedProvider.js +2 -1
  90. package/testing/react/MockedProvider.js.map +1 -1
  91. package/testing/testing.cjs +2 -1
  92. package/testing/testing.cjs.map +1 -1
  93. package/testing/testing.cjs.native.js +2 -1
  94. package/utilities/globals/globals.cjs +1 -1
  95. package/utilities/globals/globals.cjs.map +1 -1
  96. package/utilities/globals/globals.cjs.native.js +1 -1
  97. package/utilities/graphql/DocumentTransform.js +1 -1
  98. package/utilities/graphql/directives.js +4 -4
  99. package/utilities/graphql/fragments.js +3 -3
  100. package/utilities/graphql/getFromAST.js +8 -8
  101. package/utilities/graphql/storeUtils.d.ts +5 -0
  102. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  103. package/utilities/graphql/storeUtils.js +1 -1
  104. package/utilities/graphql/storeUtils.js.map +1 -1
  105. package/utilities/graphql/transform.js +2 -2
  106. package/utilities/index.d.ts +1 -1
  107. package/utilities/index.d.ts.map +1 -1
  108. package/utilities/index.js.map +1 -1
  109. package/utilities/utilities.cjs +19 -19
  110. package/utilities/utilities.cjs.map +1 -1
  111. package/utilities/utilities.cjs.native.js +19 -19
  112. package/version.js +1 -1
@@ -20,7 +20,7 @@ function shouldInclude(_a, variables) {
20
20
  if (ifArgument.value.kind === "Variable") {
21
21
  evaledValue =
22
22
  variables && variables[ifArgument.value.name.value];
23
- globals.invariant(evaledValue !== void 0, 64, directive.name.value);
23
+ globals.invariant(evaledValue !== void 0, 66, directive.name.value);
24
24
  }
25
25
  else {
26
26
  evaledValue = ifArgument.value.value;
@@ -70,12 +70,12 @@ function getInclusionDirectives(directives) {
70
70
  return;
71
71
  var directiveArguments = directive.arguments;
72
72
  var directiveName = directive.name.value;
73
- globals.invariant(directiveArguments && directiveArguments.length === 1, 65, directiveName);
73
+ globals.invariant(directiveArguments && directiveArguments.length === 1, 67, directiveName);
74
74
  var ifArgument = directiveArguments[0];
75
- globals.invariant(ifArgument.name && ifArgument.name.value === "if", 66, directiveName);
75
+ globals.invariant(ifArgument.name && ifArgument.name.value === "if", 68, directiveName);
76
76
  var ifValue = ifArgument.value;
77
77
  globals.invariant(ifValue &&
78
- (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 67, directiveName);
78
+ (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 69, directiveName);
79
79
  result.push({ directive: directive, ifArgument: ifArgument });
80
80
  });
81
81
  }
@@ -107,7 +107,7 @@ function getFragmentQueryDocument(document, fragmentName) {
107
107
  document.definitions.forEach(function (definition) {
108
108
  if (definition.kind === "OperationDefinition") {
109
109
  throw globals.newInvariantError(
110
- 68,
110
+ 70,
111
111
  definition.operation,
112
112
  definition.name ? " named '".concat(definition.name.value, "'") : ""
113
113
  );
@@ -117,7 +117,7 @@ function getFragmentQueryDocument(document, fragmentName) {
117
117
  }
118
118
  });
119
119
  if (typeof actualFragmentName === "undefined") {
120
- globals.invariant(fragments.length === 1, 69, fragments.length);
120
+ globals.invariant(fragments.length === 1, 71, fragments.length);
121
121
  actualFragmentName = fragments[0].name.value;
122
122
  }
123
123
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -158,7 +158,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
158
158
  return fragmentMap(fragmentName);
159
159
  }
160
160
  var fragment = fragmentMap && fragmentMap[fragmentName];
161
- globals.invariant(fragment, 70, fragmentName);
161
+ globals.invariant(fragment, 72, fragmentName);
162
162
  return fragment || null;
163
163
  }
164
164
  default:
@@ -236,7 +236,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
236
236
  argObj[name.value] = null;
237
237
  }
238
238
  else {
239
- throw globals.newInvariantError(79, name.value, value.kind);
239
+ throw globals.newInvariantError(81, name.value, value.kind);
240
240
  }
241
241
  }
242
242
  function storeKeyNameFromField(field, variables) {
@@ -383,16 +383,16 @@ function isInlineFragment(selection) {
383
383
  }
384
384
 
385
385
  function checkDocument(doc) {
386
- globals.invariant(doc && doc.kind === "Document", 71);
386
+ globals.invariant(doc && doc.kind === "Document", 73);
387
387
  var operations = doc.definitions
388
388
  .filter(function (d) { return d.kind !== "FragmentDefinition"; })
389
389
  .map(function (definition) {
390
390
  if (definition.kind !== "OperationDefinition") {
391
- throw globals.newInvariantError(72, definition.kind);
391
+ throw globals.newInvariantError(74, definition.kind);
392
392
  }
393
393
  return definition;
394
394
  });
395
- globals.invariant(operations.length <= 1, 73, operations.length);
395
+ globals.invariant(operations.length <= 1, 75, operations.length);
396
396
  return doc;
397
397
  }
398
398
  function getOperationDefinition(doc) {
@@ -415,14 +415,14 @@ function getFragmentDefinitions(doc) {
415
415
  }
416
416
  function getQueryDefinition(doc) {
417
417
  var queryDef = getOperationDefinition(doc);
418
- globals.invariant(queryDef && queryDef.operation === "query", 74);
418
+ globals.invariant(queryDef && queryDef.operation === "query", 76);
419
419
  return queryDef;
420
420
  }
421
421
  function getFragmentDefinition(doc) {
422
- globals.invariant(doc.kind === "Document", 75);
423
- globals.invariant(doc.definitions.length <= 1, 76);
422
+ globals.invariant(doc.kind === "Document", 77);
423
+ globals.invariant(doc.definitions.length <= 1, 78);
424
424
  var fragmentDef = doc.definitions[0];
425
- globals.invariant(fragmentDef.kind === "FragmentDefinition", 77);
425
+ globals.invariant(fragmentDef.kind === "FragmentDefinition", 79);
426
426
  return fragmentDef;
427
427
  }
428
428
  function getMainDefinition(queryDoc) {
@@ -445,7 +445,7 @@ function getMainDefinition(queryDoc) {
445
445
  if (fragmentDefinition) {
446
446
  return fragmentDefinition;
447
447
  }
448
- throw globals.newInvariantError(78);
448
+ throw globals.newInvariantError(80);
449
449
  }
450
450
  function getDefaultValues(definition) {
451
451
  var defaultValues = Object.create(null);
@@ -517,7 +517,7 @@ var DocumentTransform = (function () {
517
517
  return;
518
518
  var cacheKeys = this.getCacheKey(document);
519
519
  if (cacheKeys) {
520
- globals.invariant(Array.isArray(cacheKeys), 63);
520
+ globals.invariant(Array.isArray(cacheKeys), 65);
521
521
  return this.stableCacheKeys.lookupArray(cacheKeys);
522
522
  }
523
523
  };
@@ -613,7 +613,7 @@ function removeDirectivesFromDocument(directives, doc) {
613
613
  return getInUseByFragmentName(ancestor.name.value);
614
614
  }
615
615
  }
616
- globalThis.__DEV__ !== false && globals.invariant.error(80);
616
+ globalThis.__DEV__ !== false && globals.invariant.error(82);
617
617
  return null;
618
618
  };
619
619
  var operationCount = 0;
@@ -800,7 +800,7 @@ var connectionRemoveConfig = {
800
800
  if (willRemove) {
801
801
  if (!directive.arguments ||
802
802
  !directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
803
- globalThis.__DEV__ !== false && globals.invariant.warn(81);
803
+ globalThis.__DEV__ !== false && globals.invariant.warn(83);
804
804
  }
805
805
  }
806
806
  return willRemove;
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = "3.8.5";
1
+ export var version = "3.8.7";
2
2
  //# sourceMappingURL=version.js.map