@apollo/client 4.0.0-alpha.20 → 4.0.0-alpha.21

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 (90) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/__cjs/cache/core/cache.cjs +1 -1
  3. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  4. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  5. package/__cjs/cache/inmemory/policies.cjs +4 -4
  6. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  7. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  8. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  9. package/__cjs/core/ApolloClient.cjs +10 -10
  10. package/__cjs/core/ObservableQuery.cjs +15 -11
  11. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  12. package/__cjs/core/ObservableQuery.d.cts +1 -2
  13. package/__cjs/core/QueryInfo.cjs +223 -34
  14. package/__cjs/core/QueryInfo.cjs.map +1 -1
  15. package/__cjs/core/QueryInfo.d.cts +34 -24
  16. package/__cjs/core/QueryManager.cjs +75 -256
  17. package/__cjs/core/QueryManager.cjs.map +1 -1
  18. package/__cjs/core/QueryManager.d.cts +4 -36
  19. package/__cjs/core/networkStatus.cjs +7 -1
  20. package/__cjs/core/networkStatus.cjs.map +1 -1
  21. package/__cjs/core/networkStatus.d.cts +7 -1
  22. package/__cjs/invariantErrorCodes.cjs +64 -69
  23. package/__cjs/link/core/ApolloLink.cjs +2 -2
  24. package/__cjs/link/http/checkFetcher.cjs +1 -1
  25. package/__cjs/link/http/createHttpLink.cjs +1 -1
  26. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  27. package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
  28. package/__cjs/link/persisted-queries/index.cjs +2 -2
  29. package/__cjs/link/utils/validateOperation.cjs +1 -1
  30. package/__cjs/local-state/LocalState.cjs +10 -10
  31. package/__cjs/masking/maskDefinition.cjs.map +1 -1
  32. package/__cjs/masking/maskFragment.cjs +0 -8
  33. package/__cjs/masking/maskFragment.cjs.map +1 -1
  34. package/__cjs/masking/maskOperation.cjs +0 -8
  35. package/__cjs/masking/maskOperation.cjs.map +1 -1
  36. package/__cjs/masking/utils.cjs +3 -11
  37. package/__cjs/masking/utils.cjs.map +1 -1
  38. package/__cjs/masking/utils.d.cts +0 -1
  39. package/__cjs/react/hooks/useLazyQuery.cjs +1 -2
  40. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  41. package/__cjs/react/hooks/useLazyQuery.d.cts +0 -8
  42. package/__cjs/utilities/index.cjs +1 -16
  43. package/__cjs/utilities/index.cjs.map +1 -1
  44. package/__cjs/utilities/index.d.cts +0 -13
  45. package/__cjs/version.cjs +1 -1
  46. package/cache/core/cache.js +1 -1
  47. package/cache/inmemory/entityStore.js +3 -3
  48. package/cache/inmemory/key-extractor.js +1 -1
  49. package/cache/inmemory/policies.js +4 -4
  50. package/cache/inmemory/policies.js.map +1 -1
  51. package/cache/inmemory/readFromStore.js +2 -2
  52. package/cache/inmemory/writeToStore.js +4 -4
  53. package/core/ApolloClient.js +10 -10
  54. package/core/ObservableQuery.d.ts +1 -2
  55. package/core/ObservableQuery.js +15 -11
  56. package/core/ObservableQuery.js.map +1 -1
  57. package/core/QueryInfo.d.ts +34 -24
  58. package/core/QueryInfo.js +221 -34
  59. package/core/QueryInfo.js.map +1 -1
  60. package/core/QueryManager.d.ts +4 -36
  61. package/core/QueryManager.js +77 -258
  62. package/core/QueryManager.js.map +1 -1
  63. package/core/networkStatus.d.ts +7 -1
  64. package/core/networkStatus.js +7 -1
  65. package/core/networkStatus.js.map +1 -1
  66. package/invariantErrorCodes.js +64 -69
  67. package/link/core/ApolloLink.js +2 -2
  68. package/link/http/checkFetcher.js +1 -1
  69. package/link/http/createHttpLink.js +1 -1
  70. package/link/http/parseAndCheckHttpResponse.js +1 -1
  71. package/link/http/serializeFetchParameter.js +1 -1
  72. package/link/persisted-queries/index.js +2 -2
  73. package/link/utils/validateOperation.js +1 -1
  74. package/local-state/LocalState.js +10 -10
  75. package/masking/maskDefinition.js.map +1 -1
  76. package/masking/maskFragment.js +0 -8
  77. package/masking/maskFragment.js.map +1 -1
  78. package/masking/maskOperation.js +0 -8
  79. package/masking/maskOperation.js.map +1 -1
  80. package/masking/utils.d.ts +0 -1
  81. package/masking/utils.js +3 -10
  82. package/masking/utils.js.map +1 -1
  83. package/package.json +1 -1
  84. package/react/hooks/useLazyQuery.d.ts +0 -8
  85. package/react/hooks/useLazyQuery.js +1 -2
  86. package/react/hooks/useLazyQuery.js.map +1 -1
  87. package/utilities/index.d.ts +0 -13
  88. package/utilities/index.js +0 -12
  89. package/utilities/index.js.map +1 -1
  90. package/version.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 4.0.0-alpha.21
4
+
5
+ ### Major Changes
6
+
7
+ - [#12686](https://github.com/apollographql/apollo-client/pull/12686) [`dc4b1d0`](https://github.com/apollographql/apollo-client/commit/dc4b1d0d2479a37067113b7bd161a550fb8e4df6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - A `@defer` query that has not yet finished streaming is now considered loading and thus the `loading` flag will be `true` until the response has completed. A new `NetworkStatus.streaming` value has been introduced and will be set as the `networkStatus` while the response is streaming.
8
+
9
+ - [#12685](https://github.com/apollographql/apollo-client/pull/12685) [`3b74800`](https://github.com/apollographql/apollo-client/commit/3b748003df89ec69a6ad045fb47bbe9c3e62104c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the check and warning for `cache.fragmentMatches` when applying data masking. `cache.fragmentMatches` is a required API and data masking may crash when `cache.fragmentMatches` does not exist.
10
+
11
+ - [#12684](https://github.com/apollographql/apollo-client/pull/12684) [`e697431`](https://github.com/apollographql/apollo-client/commit/e697431a9995fd1900e625c30a9065edd71111d9) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove `context` from `useLazyQuery` hook options. If used, `context` must now be provided to the `execute` function. `context` will reset to `{}` if not provided as an option to `execute`.
12
+
3
13
  ## 4.0.0-alpha.20
4
14
 
5
15
  ### Major Changes
@@ -94,7 +94,7 @@ class ApolloCache {
94
94
  if (environment_1.__DEV__) {
95
95
  const actualFragmentName = fragmentName || (0, internal_1.getFragmentDefinition)(fragment).name.value;
96
96
  if (!id) {
97
- __DEV__ && invariant_1.invariant.warn(109, actualFragmentName);
97
+ __DEV__ && invariant_1.invariant.warn(108, actualFragmentName);
98
98
  }
99
99
  }
100
100
  const diffOptions = {
@@ -82,7 +82,7 @@ class EntityStore {
82
82
  // then there are no fields to be merged, so we're done.
83
83
  if (!incoming)
84
84
  return;
85
- (0, invariant_1.invariant)(typeof dataId === "string", 95);
85
+ (0, invariant_1.invariant)(typeof dataId === "string", 94);
86
86
  const merged = new internal_1.DeepMerger(storeObjectReconciler).merge(existing, incoming);
87
87
  // Even if merged === existing, existing may have come from a lower
88
88
  // layer, so we always need to set this.data[dataId] on this level.
@@ -182,7 +182,7 @@ class EntityStore {
182
182
  if (environment_1.__DEV__) {
183
183
  const checkReference = (ref) => {
184
184
  if (this.lookup(ref.__ref) === undefined) {
185
- __DEV__ && invariant_1.invariant.warn(96, ref);
185
+ __DEV__ && invariant_1.invariant.warn(95, ref);
186
186
  return true;
187
187
  }
188
188
  };
@@ -211,7 +211,7 @@ class EntityStore {
211
211
  }
212
212
  }
213
213
  if (seenReference && someNonReference !== undefined) {
214
- __DEV__ && invariant_1.invariant.warn(97, someNonReference);
214
+ __DEV__ && invariant_1.invariant.warn(96, someNonReference);
215
215
  break;
216
216
  }
217
217
  }
@@ -41,7 +41,7 @@ function keyFieldsFnFromSpecifier(specifier) {
41
41
  // context.readField for this extraction.
42
42
  extracted = extractKeyPath(object, schemaKeyPath, extractKey);
43
43
  }
44
- (0, invariant_1.invariant)(extracted !== void 0, 98, schemaKeyPath.join("."), object);
44
+ (0, invariant_1.invariant)(extracted !== void 0, 97, schemaKeyPath.join("."), object);
45
45
  return extracted;
46
46
  }));
47
47
  return `${context.typename}:${JSON.stringify(keyObject)}`;
@@ -204,7 +204,7 @@ class Policies {
204
204
  const rootId = "ROOT_" + which.toUpperCase();
205
205
  const old = this.rootTypenamesById[rootId];
206
206
  if (typename !== old) {
207
- (0, invariant_1.invariant)(!old || old === which, 99, which);
207
+ (0, invariant_1.invariant)(!old || old === which, 98, which);
208
208
  // First, delete any old __typename associated with this rootId from
209
209
  // rootIdsByTypename.
210
210
  if (old)
@@ -349,7 +349,7 @@ class Policies {
349
349
  if (supertypeSet.has(supertype)) {
350
350
  if (!typenameSupertypeSet.has(supertype)) {
351
351
  if (checkingFuzzySubtypes) {
352
- __DEV__ && invariant_1.invariant.warn(100, typename, supertype);
352
+ __DEV__ && invariant_1.invariant.warn(99, typename, supertype);
353
353
  }
354
354
  // Record positive results for faster future lookup.
355
355
  // Unfortunately, we cannot safely cache negative results,
@@ -560,7 +560,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
560
560
  }
561
561
  }
562
562
  if (environment_1.__DEV__ && options.from === void 0) {
563
- __DEV__ && invariant_1.invariant.warn(101, (0, internal_1.stringifyForDisplay)(Array.from(readFieldArgs)));
563
+ __DEV__ && invariant_1.invariant.warn(100, (0, internal_1.stringifyForDisplay)(Array.from(readFieldArgs)));
564
564
  }
565
565
  if (void 0 === options.variables) {
566
566
  options.variables = variables;
@@ -570,7 +570,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
570
570
  function makeMergeObjectsFunction(store) {
571
571
  return function mergeObjects(existing, incoming) {
572
572
  if ((0, internal_1.isArray)(existing) || (0, internal_1.isArray)(incoming)) {
573
- throw (0, invariant_1.newInvariantError)(102);
573
+ throw (0, invariant_1.newInvariantError)(101);
574
574
  }
575
575
  // These dynamic checks are necessary because the parameters of a
576
576
  // custom merge function can easily have the any type, so the type