@apollo/client 3.9.0-alpha.2 → 3.9.0-alpha.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 (138) hide show
  1. package/apollo-client.cjs +126 -77
  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.d.ts +2 -0
  18. package/core/ApolloClient.d.ts.map +1 -1
  19. package/core/ApolloClient.js +12 -4
  20. package/core/ApolloClient.js.map +1 -1
  21. package/core/LocalState.js +2 -2
  22. package/core/ObservableQuery.js +5 -5
  23. package/core/QueryManager.d.ts +4 -2
  24. package/core/QueryManager.d.ts.map +1 -1
  25. package/core/QueryManager.js +13 -12
  26. package/core/QueryManager.js.map +1 -1
  27. package/core/core.cjs +32 -23
  28. package/core/core.cjs.map +1 -1
  29. package/core/core.cjs.native.js +32 -23
  30. package/dev/dev.cjs +98 -83
  31. package/dev/dev.cjs.map +1 -1
  32. package/dev/dev.cjs.native.js +98 -83
  33. package/dev/loadErrorMessageHandler.js +1 -1
  34. package/dev/loadErrorMessageHandler.js.map +1 -1
  35. package/invariantErrorCodes.js +96 -81
  36. package/link/core/ApolloLink.js +2 -2
  37. package/link/core/core.cjs +2 -2
  38. package/link/core/core.cjs.map +1 -1
  39. package/link/core/core.cjs.native.js +2 -2
  40. package/link/http/checkFetcher.js +1 -1
  41. package/link/http/createHttpLink.js +1 -1
  42. package/link/http/http.cjs +3 -3
  43. package/link/http/http.cjs.map +1 -1
  44. package/link/http/http.cjs.native.js +3 -3
  45. package/link/http/serializeFetchParameter.js +1 -1
  46. package/link/persisted-queries/index.js +2 -2
  47. package/link/persisted-queries/persisted-queries.cjs +2 -2
  48. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  49. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  50. package/link/utils/toPromise.js +1 -1
  51. package/link/utils/utils.cjs +2 -2
  52. package/link/utils/utils.cjs.map +1 -1
  53. package/link/utils/utils.cjs.native.js +2 -2
  54. package/link/utils/validateOperation.js +1 -1
  55. package/package.json +26 -25
  56. package/react/cache/QueryReference.d.ts.map +1 -1
  57. package/react/cache/QueryReference.js +7 -2
  58. package/react/cache/QueryReference.js.map +1 -1
  59. package/react/context/ApolloConsumer.js +1 -1
  60. package/react/context/ApolloContext.js +1 -1
  61. package/react/context/ApolloProvider.js +1 -1
  62. package/react/context/context.cjs +3 -3
  63. package/react/context/context.cjs.map +1 -1
  64. package/react/context/context.cjs.native.js +3 -3
  65. package/react/hoc/hoc-utils.js +1 -1
  66. package/react/hoc/hoc.cjs +2 -2
  67. package/react/hoc/hoc.cjs.map +1 -1
  68. package/react/hoc/hoc.cjs.native.js +2 -2
  69. package/react/hoc/withApollo.js +1 -1
  70. package/react/hooks/hooks.cjs +15 -10
  71. package/react/hooks/hooks.cjs.map +1 -1
  72. package/react/hooks/hooks.cjs.native.js +15 -10
  73. package/react/hooks/index.d.ts +1 -0
  74. package/react/hooks/index.d.ts.map +1 -1
  75. package/react/hooks/index.js.map +1 -1
  76. package/react/hooks/useApolloClient.js +1 -1
  77. package/react/hooks/useQuery.js +1 -1
  78. package/react/hooks/useReadQuery.d.ts +7 -4
  79. package/react/hooks/useReadQuery.d.ts.map +1 -1
  80. package/react/hooks/useReadQuery.js +1 -1
  81. package/react/hooks/useReadQuery.js.map +1 -1
  82. package/react/hooks/useSubscription.js +2 -2
  83. package/react/hooks/useSuspenseQuery.js +2 -2
  84. package/react/hooks/useSyncExternalStore.js +1 -1
  85. package/react/parser/index.js +5 -5
  86. package/react/parser/parser.cjs +5 -5
  87. package/react/parser/parser.cjs.map +1 -1
  88. package/react/parser/parser.cjs.native.js +5 -5
  89. package/testing/core/core.cjs +2 -2
  90. package/testing/core/core.cjs.map +1 -1
  91. package/testing/core/core.cjs.native.js +2 -2
  92. package/testing/core/mocking/mockLink.js +2 -2
  93. package/testing/react/MockedProvider.d.ts +1 -0
  94. package/testing/react/MockedProvider.d.ts.map +1 -1
  95. package/testing/react/MockedProvider.js +2 -1
  96. package/testing/react/MockedProvider.js.map +1 -1
  97. package/testing/testing.cjs +2 -1
  98. package/testing/testing.cjs.map +1 -1
  99. package/testing/testing.cjs.native.js +2 -1
  100. package/utilities/globals/globals.cjs +1 -1
  101. package/utilities/globals/globals.cjs.map +1 -1
  102. package/utilities/globals/globals.cjs.native.js +1 -1
  103. package/utilities/graphql/DocumentTransform.js +1 -1
  104. package/utilities/graphql/directives.js +4 -4
  105. package/utilities/graphql/fragments.js +3 -3
  106. package/utilities/graphql/getFromAST.js +8 -8
  107. package/utilities/graphql/storeUtils.d.ts +5 -0
  108. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  109. package/utilities/graphql/storeUtils.js +1 -1
  110. package/utilities/graphql/storeUtils.js.map +1 -1
  111. package/utilities/graphql/transform.js +2 -2
  112. package/utilities/index.d.ts +1 -1
  113. package/utilities/index.d.ts.map +1 -1
  114. package/utilities/index.js.map +1 -1
  115. package/utilities/subscriptions/relay/index.d.ts +6 -0
  116. package/utilities/subscriptions/relay/index.d.ts.map +1 -0
  117. package/utilities/subscriptions/relay/index.js +43 -0
  118. package/utilities/subscriptions/relay/index.js.map +1 -0
  119. package/utilities/subscriptions/relay/package.json +8 -0
  120. package/utilities/subscriptions/relay/relay.cjs +368 -0
  121. package/utilities/subscriptions/relay/relay.cjs.map +1 -0
  122. package/utilities/subscriptions/relay/relay.cjs.native.js +368 -0
  123. package/utilities/subscriptions/shared.d.ts +9 -0
  124. package/utilities/subscriptions/shared.d.ts.map +1 -0
  125. package/utilities/subscriptions/shared.js +7 -0
  126. package/utilities/subscriptions/shared.js.map +1 -0
  127. package/utilities/subscriptions/urql/index.d.ts +7 -0
  128. package/utilities/subscriptions/urql/index.d.ts.map +1 -0
  129. package/utilities/subscriptions/urql/index.js +40 -0
  130. package/utilities/subscriptions/urql/index.js.map +1 -0
  131. package/utilities/subscriptions/urql/package.json +8 -0
  132. package/utilities/subscriptions/urql/urql.cjs +364 -0
  133. package/utilities/subscriptions/urql/urql.cjs.map +1 -0
  134. package/utilities/subscriptions/urql/urql.cjs.native.js +364 -0
  135. package/utilities/utilities.cjs +19 -19
  136. package/utilities/utilities.cjs.map +1 -1
  137. package/utilities/utilities.cjs.native.js +19 -19
  138. 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, 65, directive.name.value);
23
+ globals.invariant(evaledValue !== void 0, 67, 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, 66, directiveName);
73
+ globals.invariant(directiveArguments && directiveArguments.length === 1, 68, directiveName);
74
74
  var ifArgument = directiveArguments[0];
75
- globals.invariant(ifArgument.name && ifArgument.name.value === "if", 67, directiveName);
75
+ globals.invariant(ifArgument.name && ifArgument.name.value === "if", 69, directiveName);
76
76
  var ifValue = ifArgument.value;
77
77
  globals.invariant(ifValue &&
78
- (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 68, directiveName);
78
+ (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 70, 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
- 69,
110
+ 71,
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, 70, fragments.length);
120
+ globals.invariant(fragments.length === 1, 72, 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, 71, fragmentName);
161
+ globals.invariant(fragment, 73, fragmentName);
162
162
  return fragment || null;
163
163
  }
164
164
  default:
@@ -273,7 +273,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
273
273
  argObj[name.value] = null;
274
274
  }
275
275
  else {
276
- throw globals.newInvariantError(80, name.value, value.kind);
276
+ throw globals.newInvariantError(82, name.value, value.kind);
277
277
  }
278
278
  }
279
279
  function storeKeyNameFromField(field, variables) {
@@ -407,16 +407,16 @@ function isInlineFragment(selection) {
407
407
  }
408
408
 
409
409
  function checkDocument(doc) {
410
- globals.invariant(doc && doc.kind === "Document", 72);
410
+ globals.invariant(doc && doc.kind === "Document", 74);
411
411
  var operations = doc.definitions
412
412
  .filter(function (d) { return d.kind !== "FragmentDefinition"; })
413
413
  .map(function (definition) {
414
414
  if (definition.kind !== "OperationDefinition") {
415
- throw globals.newInvariantError(73, definition.kind);
415
+ throw globals.newInvariantError(75, definition.kind);
416
416
  }
417
417
  return definition;
418
418
  });
419
- globals.invariant(operations.length <= 1, 74, operations.length);
419
+ globals.invariant(operations.length <= 1, 76, operations.length);
420
420
  return doc;
421
421
  }
422
422
  function getOperationDefinition(doc) {
@@ -439,14 +439,14 @@ function getFragmentDefinitions(doc) {
439
439
  }
440
440
  function getQueryDefinition(doc) {
441
441
  var queryDef = getOperationDefinition(doc);
442
- globals.invariant(queryDef && queryDef.operation === "query", 75);
442
+ globals.invariant(queryDef && queryDef.operation === "query", 77);
443
443
  return queryDef;
444
444
  }
445
445
  function getFragmentDefinition(doc) {
446
- globals.invariant(doc.kind === "Document", 76);
447
- globals.invariant(doc.definitions.length <= 1, 77);
446
+ globals.invariant(doc.kind === "Document", 78);
447
+ globals.invariant(doc.definitions.length <= 1, 79);
448
448
  var fragmentDef = doc.definitions[0];
449
- globals.invariant(fragmentDef.kind === "FragmentDefinition", 78);
449
+ globals.invariant(fragmentDef.kind === "FragmentDefinition", 80);
450
450
  return fragmentDef;
451
451
  }
452
452
  function getMainDefinition(queryDoc) {
@@ -469,7 +469,7 @@ function getMainDefinition(queryDoc) {
469
469
  if (fragmentDefinition) {
470
470
  return fragmentDefinition;
471
471
  }
472
- throw globals.newInvariantError(79);
472
+ throw globals.newInvariantError(81);
473
473
  }
474
474
  function getDefaultValues(definition) {
475
475
  var defaultValues = Object.create(null);
@@ -541,7 +541,7 @@ var DocumentTransform = (function () {
541
541
  return;
542
542
  var cacheKeys = this.getCacheKey(document);
543
543
  if (cacheKeys) {
544
- globals.invariant(Array.isArray(cacheKeys), 64);
544
+ globals.invariant(Array.isArray(cacheKeys), 66);
545
545
  return this.stableCacheKeys.lookupArray(cacheKeys);
546
546
  }
547
547
  };
@@ -637,7 +637,7 @@ function removeDirectivesFromDocument(directives, doc) {
637
637
  return getInUseByFragmentName(ancestor.name.value);
638
638
  }
639
639
  }
640
- globalThis.__DEV__ !== false && globals.invariant.error(81);
640
+ globalThis.__DEV__ !== false && globals.invariant.error(83);
641
641
  return null;
642
642
  };
643
643
  var operationCount = 0;
@@ -824,7 +824,7 @@ var connectionRemoveConfig = {
824
824
  if (willRemove) {
825
825
  if (!directive.arguments ||
826
826
  !directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
827
- globalThis.__DEV__ !== false && globals.invariant.warn(82);
827
+ globalThis.__DEV__ !== false && globals.invariant.warn(84);
828
828
  }
829
829
  }
830
830
  return willRemove;
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = "3.9.0-alpha.2";
1
+ export var version = "3.9.0-alpha.3";
2
2
  //# sourceMappingURL=version.js.map