@apollo/client 3.9.0-alpha.0 → 3.9.0-alpha.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 (45) hide show
  1. package/apollo-client.cjs +21 -33
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/core/core.cjs +1 -1
  5. package/core/core.cjs.map +1 -1
  6. package/core/core.cjs.native.js +1 -1
  7. package/dev/dev.cjs +25 -19
  8. package/dev/dev.cjs.map +1 -1
  9. package/dev/dev.cjs.native.js +25 -19
  10. package/invariantErrorCodes.js +24 -18
  11. package/package.json +2 -2
  12. package/react/cache/index.d.ts +0 -4
  13. package/react/cache/index.d.ts.map +1 -1
  14. package/react/cache/index.js +0 -14
  15. package/react/cache/index.js.map +1 -1
  16. package/react/index.d.ts +0 -1
  17. package/react/index.d.ts.map +1 -1
  18. package/react/index.js +0 -1
  19. package/react/index.js.map +1 -1
  20. package/react/react.cjs +1 -218
  21. package/react/react.cjs.map +1 -1
  22. package/react/react.cjs.native.js +1 -218
  23. package/react/types/types.d.ts +0 -3
  24. package/react/types/types.d.ts.map +1 -1
  25. package/react/types/types.js.map +1 -1
  26. package/testing/core/core.cjs +9 -1
  27. package/testing/core/core.cjs.map +1 -1
  28. package/testing/core/core.cjs.native.js +9 -1
  29. package/testing/core/mocking/mockLink.d.ts +1 -0
  30. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  31. package/testing/core/mocking/mockLink.js +9 -1
  32. package/testing/core/mocking/mockLink.js.map +1 -1
  33. package/utilities/globals/globals.cjs +1 -1
  34. package/utilities/globals/globals.cjs.map +1 -1
  35. package/utilities/globals/globals.cjs.native.js +1 -1
  36. package/utilities/graphql/DocumentTransform.js +1 -1
  37. package/utilities/graphql/directives.js +4 -4
  38. package/utilities/graphql/fragments.js +3 -3
  39. package/utilities/graphql/getFromAST.js +8 -8
  40. package/utilities/graphql/storeUtils.js +1 -1
  41. package/utilities/graphql/transform.js +2 -2
  42. package/utilities/utilities.cjs +19 -19
  43. package/utilities/utilities.cjs.map +1 -1
  44. package/utilities/utilities.cjs.native.js +19 -19
  45. package/version.js +1 -1
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.9.0-alpha.0";
34
+ var version = "3.9.0-alpha.1";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -127,7 +127,7 @@ function shouldInclude(_a, variables) {
127
127
  if (ifArgument.value.kind === "Variable") {
128
128
  evaledValue =
129
129
  variables && variables[ifArgument.value.name.value];
130
- invariant(evaledValue !== void 0, 64, directive.name.value);
130
+ invariant(evaledValue !== void 0, 65, directive.name.value);
131
131
  }
132
132
  else {
133
133
  evaledValue = ifArgument.value.value;
@@ -162,12 +162,12 @@ function getInclusionDirectives(directives) {
162
162
  return;
163
163
  var directiveArguments = directive.arguments;
164
164
  var directiveName = directive.name.value;
165
- invariant(directiveArguments && directiveArguments.length === 1, 65, directiveName);
165
+ invariant(directiveArguments && directiveArguments.length === 1, 66, directiveName);
166
166
  var ifArgument = directiveArguments[0];
167
- invariant(ifArgument.name && ifArgument.name.value === "if", 66, directiveName);
167
+ invariant(ifArgument.name && ifArgument.name.value === "if", 67, directiveName);
168
168
  var ifValue = ifArgument.value;
169
169
  invariant(ifValue &&
170
- (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 67, directiveName);
170
+ (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 68, directiveName);
171
171
  result.push({ directive: directive, ifArgument: ifArgument });
172
172
  });
173
173
  }
@@ -193,7 +193,7 @@ function getFragmentQueryDocument(document, fragmentName) {
193
193
  document.definitions.forEach(function (definition) {
194
194
  if (definition.kind === "OperationDefinition") {
195
195
  throw newInvariantError(
196
- 68,
196
+ 69,
197
197
  definition.operation,
198
198
  definition.name ? " named '".concat(definition.name.value, "'") : ""
199
199
  );
@@ -203,7 +203,7 @@ function getFragmentQueryDocument(document, fragmentName) {
203
203
  }
204
204
  });
205
205
  if (typeof actualFragmentName === "undefined") {
206
- invariant(fragments.length === 1, 69, fragments.length);
206
+ invariant(fragments.length === 1, 70, fragments.length);
207
207
  actualFragmentName = fragments[0].name.value;
208
208
  }
209
209
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -244,7 +244,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
244
244
  return fragmentMap(fragmentName);
245
245
  }
246
246
  var fragment = fragmentMap && fragmentMap[fragmentName];
247
- invariant(fragment, 70, fragmentName);
247
+ invariant(fragment, 71, fragmentName);
248
248
  return fragment || null;
249
249
  }
250
250
  default:
@@ -322,7 +322,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
322
322
  argObj[name.value] = null;
323
323
  }
324
324
  else {
325
- throw newInvariantError(79, name.value, value.kind);
325
+ throw newInvariantError(80, name.value, value.kind);
326
326
  }
327
327
  }
328
328
  function storeKeyNameFromField(field, variables) {
@@ -469,16 +469,16 @@ function isInlineFragment(selection) {
469
469
  }
470
470
 
471
471
  function checkDocument(doc) {
472
- invariant(doc && doc.kind === "Document", 71);
472
+ invariant(doc && doc.kind === "Document", 72);
473
473
  var operations = doc.definitions
474
474
  .filter(function (d) { return d.kind !== "FragmentDefinition"; })
475
475
  .map(function (definition) {
476
476
  if (definition.kind !== "OperationDefinition") {
477
- throw newInvariantError(72, definition.kind);
477
+ throw newInvariantError(73, definition.kind);
478
478
  }
479
479
  return definition;
480
480
  });
481
- invariant(operations.length <= 1, 73, operations.length);
481
+ invariant(operations.length <= 1, 74, operations.length);
482
482
  return doc;
483
483
  }
484
484
  function getOperationDefinition(doc) {
@@ -501,14 +501,14 @@ function getFragmentDefinitions(doc) {
501
501
  }
502
502
  function getQueryDefinition(doc) {
503
503
  var queryDef = getOperationDefinition(doc);
504
- invariant(queryDef && queryDef.operation === "query", 74);
504
+ invariant(queryDef && queryDef.operation === "query", 75);
505
505
  return queryDef;
506
506
  }
507
507
  function getFragmentDefinition(doc) {
508
- invariant(doc.kind === "Document", 75);
509
- invariant(doc.definitions.length <= 1, 76);
508
+ invariant(doc.kind === "Document", 76);
509
+ invariant(doc.definitions.length <= 1, 77);
510
510
  var fragmentDef = doc.definitions[0];
511
- invariant(fragmentDef.kind === "FragmentDefinition", 77);
511
+ invariant(fragmentDef.kind === "FragmentDefinition", 78);
512
512
  return fragmentDef;
513
513
  }
514
514
  function getMainDefinition(queryDoc) {
@@ -531,7 +531,7 @@ function getMainDefinition(queryDoc) {
531
531
  if (fragmentDefinition) {
532
532
  return fragmentDefinition;
533
533
  }
534
- throw newInvariantError(78);
534
+ throw newInvariantError(79);
535
535
  }
536
536
  function getDefaultValues(definition) {
537
537
  var defaultValues = Object.create(null);
@@ -603,7 +603,7 @@ var DocumentTransform = (function () {
603
603
  return;
604
604
  var cacheKeys = this.getCacheKey(document);
605
605
  if (cacheKeys) {
606
- invariant(Array.isArray(cacheKeys), 63);
606
+ invariant(Array.isArray(cacheKeys), 64);
607
607
  return this.stableCacheKeys.lookupArray(cacheKeys);
608
608
  }
609
609
  };
@@ -699,7 +699,7 @@ function removeDirectivesFromDocument(directives, doc) {
699
699
  return getInUseByFragmentName(ancestor.name.value);
700
700
  }
701
701
  }
702
- globalThis.__DEV__ !== false && invariant.error(80);
702
+ globalThis.__DEV__ !== false && invariant.error(81);
703
703
  return null;
704
704
  };
705
705
  var operationCount = 0;
@@ -7998,7 +7998,7 @@ var InternalQueryReference = (function () {
7998
7998
  return InternalQueryReference;
7999
7999
  }());
8000
8000
 
8001
- var SuspenseCache$1 = (function () {
8001
+ var SuspenseCache = (function () {
8002
8002
  function SuspenseCache(options) {
8003
8003
  if (options === void 0) { options = Object.create(null); }
8004
8004
  this.queryRefs = new trie.Trie(canUseWeakMap);
@@ -8024,22 +8024,11 @@ var suspenseCacheSymbol = Symbol.for("apollo.suspenseCache");
8024
8024
  function getSuspenseCache(client) {
8025
8025
  var _a;
8026
8026
  if (!client[suspenseCacheSymbol]) {
8027
- client[suspenseCacheSymbol] = new SuspenseCache$1((_a = client.defaultOptions.react) === null || _a === void 0 ? void 0 : _a.suspense);
8027
+ client[suspenseCacheSymbol] = new SuspenseCache((_a = client.defaultOptions.react) === null || _a === void 0 ? void 0 : _a.suspense);
8028
8028
  }
8029
8029
  return client[suspenseCacheSymbol];
8030
8030
  }
8031
8031
 
8032
- var SuspenseCache = (function (_super) {
8033
- tslib.__extends(SuspenseCache, _super);
8034
- function SuspenseCache() {
8035
- _super.call(this) || this;
8036
- throw new Error("It is no longer necessary to create a `SuspenseCache` instance and pass it into the `ApolloProvider`.\n" +
8037
- "Please remove this code from your application. \n\n" +
8038
- "This export will be removed with the final 3.8 release.");
8039
- }
8040
- return SuspenseCache;
8041
- }(SuspenseCache$1));
8042
-
8043
8032
  var skipToken = Symbol.for("apollo.skipToken");
8044
8033
 
8045
8034
  function useSuspenseQuery(query, options) {
@@ -8247,7 +8236,6 @@ exports.HttpLink = HttpLink;
8247
8236
  exports.InMemoryCache = InMemoryCache;
8248
8237
  exports.MissingFieldError = MissingFieldError;
8249
8238
  exports.ObservableQuery = ObservableQuery;
8250
- exports.SuspenseCache = SuspenseCache;
8251
8239
  exports.checkFetcher = checkFetcher;
8252
8240
  exports.concat = concat;
8253
8241
  exports.createHttpLink = createHttpLink;