@apollo/client 3.8.0-beta.5 → 3.8.0-beta.6

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 (97) hide show
  1. package/apollo-client.cjs +102 -74
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/inmemory/writeToStore.js.map +1 -1
  5. package/core/ApolloClient.js +4 -3
  6. package/core/LocalState.js +2 -2
  7. package/core/ObservableQuery.d.ts +1 -0
  8. package/core/ObservableQuery.d.ts.map +1 -1
  9. package/core/ObservableQuery.js +9 -5
  10. package/core/ObservableQuery.js.map +1 -1
  11. package/core/QueryManager.d.ts +2 -2
  12. package/core/QueryManager.d.ts.map +1 -1
  13. package/core/QueryManager.js +9 -9
  14. package/core/QueryManager.js.map +1 -1
  15. package/core/core.cjs +25 -20
  16. package/core/core.cjs.map +1 -1
  17. package/core/core.cjs.native.js +25 -20
  18. package/dev/dev.cjs +72 -79
  19. package/dev/dev.cjs.map +1 -1
  20. package/dev/dev.cjs.native.js +72 -79
  21. package/invariantErrorCodes.js +71 -78
  22. package/link/core/ApolloLink.js +2 -2
  23. package/link/core/core.cjs +2 -2
  24. package/link/core/core.cjs.map +1 -1
  25. package/link/core/core.cjs.native.js +2 -2
  26. package/link/http/checkFetcher.js +1 -1
  27. package/link/http/createHttpLink.js +1 -1
  28. package/link/http/http.cjs +3 -3
  29. package/link/http/http.cjs.map +1 -1
  30. package/link/http/http.cjs.native.js +3 -3
  31. package/link/http/serializeFetchParameter.js +1 -1
  32. package/link/persisted-queries/index.js +2 -2
  33. package/link/persisted-queries/persisted-queries.cjs +2 -2
  34. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  35. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  36. package/link/utils/toPromise.js +1 -1
  37. package/link/utils/utils.cjs +2 -2
  38. package/link/utils/utils.cjs.map +1 -1
  39. package/link/utils/utils.cjs.native.js +2 -2
  40. package/link/utils/validateOperation.js +1 -1
  41. package/package.json +10 -10
  42. package/react/cache/QueryReference.d.ts +2 -0
  43. package/react/cache/QueryReference.d.ts.map +1 -1
  44. package/react/cache/QueryReference.js +29 -4
  45. package/react/cache/QueryReference.js.map +1 -1
  46. package/react/context/ApolloConsumer.js +1 -1
  47. package/react/context/ApolloContext.js +1 -1
  48. package/react/context/ApolloProvider.js +1 -1
  49. package/react/context/context.cjs +3 -3
  50. package/react/context/context.cjs.map +1 -1
  51. package/react/context/context.cjs.native.js +3 -3
  52. package/react/hoc/hoc-utils.js +1 -1
  53. package/react/hoc/hoc.cjs +2 -2
  54. package/react/hoc/hoc.cjs.map +1 -1
  55. package/react/hoc/hoc.cjs.native.js +2 -2
  56. package/react/hoc/withApollo.js +1 -1
  57. package/react/hooks/hooks.cjs +43 -21
  58. package/react/hooks/hooks.cjs.map +1 -1
  59. package/react/hooks/hooks.cjs.native.js +43 -21
  60. package/react/hooks/useApolloClient.js +1 -1
  61. package/react/hooks/useBackgroundQuery.js +3 -4
  62. package/react/hooks/useBackgroundQuery.js.map +1 -1
  63. package/react/hooks/useQuery.js +1 -1
  64. package/react/hooks/useReadQuery.js +1 -1
  65. package/react/hooks/useSubscription.js +2 -2
  66. package/react/hooks/useSuspenseCache.js +1 -1
  67. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  68. package/react/hooks/useSuspenseQuery.js +5 -6
  69. package/react/hooks/useSuspenseQuery.js.map +1 -1
  70. package/react/hooks/useSyncExternalStore.js +1 -1
  71. package/react/parser/index.js +5 -5
  72. package/react/parser/parser.cjs +5 -5
  73. package/react/parser/parser.cjs.map +1 -1
  74. package/react/parser/parser.cjs.native.js +5 -5
  75. package/react/react.cjs +29 -4
  76. package/react/react.cjs.map +1 -1
  77. package/react/react.cjs.native.js +29 -4
  78. package/testing/core/core.cjs +1 -1
  79. package/testing/core/core.cjs.map +1 -1
  80. package/testing/core/core.cjs.native.js +1 -1
  81. package/testing/core/mocking/mockLink.js +1 -1
  82. package/utilities/globals/globals.cjs +1 -1
  83. package/utilities/globals/globals.cjs.map +1 -1
  84. package/utilities/globals/globals.cjs.native.js +1 -1
  85. package/utilities/graphql/DocumentTransform.js +1 -1
  86. package/utilities/graphql/directives.js +4 -4
  87. package/utilities/graphql/fragments.js +3 -3
  88. package/utilities/graphql/getFromAST.js +8 -8
  89. package/utilities/graphql/storeUtils.js +1 -1
  90. package/utilities/graphql/transform.js +2 -2
  91. package/utilities/promises/decoration.d.ts.map +1 -1
  92. package/utilities/promises/decoration.js +1 -0
  93. package/utilities/promises/decoration.js.map +1 -1
  94. package/utilities/utilities.cjs +20 -19
  95. package/utilities/utilities.cjs.map +1 -1
  96. package/utilities/utilities.cjs.native.js +20 -19
  97. package/version.js +1 -1
@@ -19,7 +19,7 @@ function shouldInclude(_a, variables) {
19
19
  var evaledValue = false;
20
20
  if (ifArgument.value.kind === 'Variable') {
21
21
  evaledValue = variables && variables[ifArgument.value.name.value];
22
- globals.invariant(evaledValue !== void 0, 66, directive.name.value);
22
+ globals.invariant(evaledValue !== void 0, 65, directive.name.value);
23
23
  }
24
24
  else {
25
25
  evaledValue = ifArgument.value.value;
@@ -66,12 +66,12 @@ function getInclusionDirectives(directives) {
66
66
  return;
67
67
  var directiveArguments = directive.arguments;
68
68
  var directiveName = directive.name.value;
69
- globals.invariant(directiveArguments && directiveArguments.length === 1, 67, directiveName);
69
+ globals.invariant(directiveArguments && directiveArguments.length === 1, 66, directiveName);
70
70
  var ifArgument = directiveArguments[0];
71
- globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 68, directiveName);
71
+ globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 67, directiveName);
72
72
  var ifValue = ifArgument.value;
73
73
  globals.invariant(ifValue &&
74
- (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 69, directiveName);
74
+ (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 68, directiveName);
75
75
  result.push({ directive: directive, ifArgument: ifArgument });
76
76
  });
77
77
  }
@@ -104,7 +104,7 @@ function getFragmentQueryDocument(document, fragmentName) {
104
104
  document.definitions.forEach(function (definition) {
105
105
  if (definition.kind === 'OperationDefinition') {
106
106
  throw globals.newInvariantError(
107
- 70,
107
+ 69,
108
108
  definition.operation,
109
109
  definition.name ? " named '".concat(definition.name.value, "'") : ''
110
110
  );
@@ -114,7 +114,7 @@ function getFragmentQueryDocument(document, fragmentName) {
114
114
  }
115
115
  });
116
116
  if (typeof actualFragmentName === 'undefined') {
117
- globals.invariant(fragments.length === 1, 71, fragments.length);
117
+ globals.invariant(fragments.length === 1, 70, fragments.length);
118
118
  actualFragmentName = fragments[0].name.value;
119
119
  }
120
120
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -155,7 +155,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
155
155
  return fragmentMap(fragmentName);
156
156
  }
157
157
  var fragment = fragmentMap && fragmentMap[fragmentName];
158
- globals.invariant(fragment, 72, fragmentName);
158
+ globals.invariant(fragment, 71, fragmentName);
159
159
  return fragment || null;
160
160
  }
161
161
  default:
@@ -233,7 +233,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
233
233
  argObj[name.value] = null;
234
234
  }
235
235
  else {
236
- throw globals.newInvariantError(81, name.value, value.kind);
236
+ throw globals.newInvariantError(80, name.value, value.kind);
237
237
  }
238
238
  }
239
239
  function storeKeyNameFromField(field, variables) {
@@ -378,16 +378,16 @@ function isInlineFragment(selection) {
378
378
  }
379
379
 
380
380
  function checkDocument(doc) {
381
- globals.invariant(doc && doc.kind === 'Document', 73);
381
+ globals.invariant(doc && doc.kind === 'Document', 72);
382
382
  var operations = doc.definitions
383
383
  .filter(function (d) { return d.kind !== 'FragmentDefinition'; })
384
384
  .map(function (definition) {
385
385
  if (definition.kind !== 'OperationDefinition') {
386
- throw globals.newInvariantError(74, definition.kind);
386
+ throw globals.newInvariantError(73, definition.kind);
387
387
  }
388
388
  return definition;
389
389
  });
390
- globals.invariant(operations.length <= 1, 75, operations.length);
390
+ globals.invariant(operations.length <= 1, 74, operations.length);
391
391
  return doc;
392
392
  }
393
393
  function getOperationDefinition(doc) {
@@ -410,14 +410,14 @@ function getFragmentDefinitions(doc) {
410
410
  }
411
411
  function getQueryDefinition(doc) {
412
412
  var queryDef = getOperationDefinition(doc);
413
- globals.invariant(queryDef && queryDef.operation === 'query', 76);
413
+ globals.invariant(queryDef && queryDef.operation === 'query', 75);
414
414
  return queryDef;
415
415
  }
416
416
  function getFragmentDefinition(doc) {
417
- globals.invariant(doc.kind === 'Document', 77);
418
- globals.invariant(doc.definitions.length <= 1, 78);
417
+ globals.invariant(doc.kind === 'Document', 76);
418
+ globals.invariant(doc.definitions.length <= 1, 77);
419
419
  var fragmentDef = doc.definitions[0];
420
- globals.invariant(fragmentDef.kind === 'FragmentDefinition', 79);
420
+ globals.invariant(fragmentDef.kind === 'FragmentDefinition', 78);
421
421
  return fragmentDef;
422
422
  }
423
423
  function getMainDefinition(queryDoc) {
@@ -440,7 +440,7 @@ function getMainDefinition(queryDoc) {
440
440
  if (fragmentDefinition) {
441
441
  return fragmentDefinition;
442
442
  }
443
- throw globals.newInvariantError(80);
443
+ throw globals.newInvariantError(79);
444
444
  }
445
445
  function getDefaultValues(definition) {
446
446
  var defaultValues = Object.create(null);
@@ -512,7 +512,7 @@ var DocumentTransform = (function () {
512
512
  return;
513
513
  var cacheKeys = this.getCacheKey(document);
514
514
  if (cacheKeys) {
515
- globals.invariant(Array.isArray(cacheKeys), 65);
515
+ globals.invariant(Array.isArray(cacheKeys), 64);
516
516
  return this.stableCacheKeys.lookupArray(cacheKeys);
517
517
  }
518
518
  };
@@ -605,7 +605,7 @@ function removeDirectivesFromDocument(directives, doc) {
605
605
  return getInUseByFragmentName(ancestor.name.value);
606
606
  }
607
607
  }
608
- globals.__DEV__ && globals.invariant.error(82);
608
+ globals.__DEV__ && globals.invariant.error(81);
609
609
  return null;
610
610
  };
611
611
  var operationCount = 0;
@@ -781,7 +781,7 @@ var connectionRemoveConfig = {
781
781
  if (willRemove) {
782
782
  if (!directive.arguments ||
783
783
  !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {
784
- globals.__DEV__ && globals.invariant.warn(83);
784
+ globals.__DEV__ && globals.invariant.warn(82);
785
785
  }
786
786
  }
787
787
  return willRemove;
@@ -1121,6 +1121,7 @@ function createFulfilledPromise(value) {
1121
1121
  }
1122
1122
  function createRejectedPromise(reason) {
1123
1123
  var promise = Promise.reject(reason);
1124
+ promise.catch(function () { });
1124
1125
  promise.status = 'rejected';
1125
1126
  promise.reason = reason;
1126
1127
  return promise;
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = '3.8.0-beta.5';
1
+ export var version = '3.8.0-beta.6';
2
2
  //# sourceMappingURL=version.js.map