@apollo/client 4.3.0-alpha.7 → 4.3.0-alpha.8

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 (132) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/__cjs/cache/core/cache.cjs +25 -1
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +19 -1
  5. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  6. package/__cjs/cache/inmemory/inMemoryCache.cjs +10 -0
  7. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  8. package/__cjs/cache/inmemory/inMemoryCache.d.cts +5 -1
  9. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  10. package/__cjs/cache/inmemory/policies.cjs +5 -5
  11. package/__cjs/cache/inmemory/readFromStore.cjs +3 -3
  12. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  13. package/__cjs/core/ApolloClient.cjs +14 -14
  14. package/__cjs/core/ObservableQuery.cjs +8 -8
  15. package/__cjs/core/QueryInfo.cjs +1 -1
  16. package/__cjs/core/QueryManager.cjs +23 -13
  17. package/__cjs/core/QueryManager.cjs.map +1 -1
  18. package/__cjs/core/RefetchEventManager.cjs +3 -3
  19. package/__cjs/incremental/handlers/graphql17Alpha9.cjs +1 -1
  20. package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
  21. package/__cjs/invariantErrorCodes.cjs +122 -116
  22. package/__cjs/link/core/ApolloLink.cjs +3 -3
  23. package/__cjs/link/http/checkFetcher.cjs +1 -1
  24. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +2 -2
  25. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  26. package/__cjs/link/persisted-queries/index.cjs +2 -2
  27. package/__cjs/link/ws/index.cjs +1 -1
  28. package/__cjs/local-state/LocalState.cjs +11 -11
  29. package/__cjs/masking/maskDefinition.cjs +2 -2
  30. package/__cjs/masking/maskFragment.cjs +2 -2
  31. package/__cjs/masking/maskOperation.cjs +1 -1
  32. package/__cjs/masking/utils.cjs +3 -3
  33. package/__cjs/react/context/ApolloContext.cjs +1 -1
  34. package/__cjs/react/context/ApolloProvider.cjs +1 -1
  35. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
  36. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  37. package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
  38. package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
  39. package/__cjs/react/hooks/useSubscription.cjs +1 -1
  40. package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
  41. package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
  42. package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
  43. package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
  44. package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
  45. package/__cjs/utilities/internal/capitalize.cjs +12 -0
  46. package/__cjs/utilities/internal/capitalize.cjs.map +1 -0
  47. package/__cjs/utilities/internal/capitalize.d.cts +7 -0
  48. package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs +69 -0
  49. package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs.map +1 -0
  50. package/__cjs/utilities/internal/coerceScalarFieldsToParsed.d.cts +9 -0
  51. package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
  52. package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
  53. package/__cjs/utilities/internal/getFragmentFromSelection.cjs.map +1 -1
  54. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
  55. package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
  56. package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
  57. package/__cjs/utilities/internal/index.cjs +6 -2
  58. package/__cjs/utilities/internal/index.cjs.map +1 -1
  59. package/__cjs/utilities/internal/index.d.cts +2 -0
  60. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
  61. package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
  62. package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
  63. package/__cjs/version.cjs +1 -1
  64. package/cache/core/cache.d.ts +19 -1
  65. package/cache/core/cache.js +26 -2
  66. package/cache/core/cache.js.map +1 -1
  67. package/cache/inmemory/entityStore.js +3 -3
  68. package/cache/inmemory/inMemoryCache.d.ts +5 -1
  69. package/cache/inmemory/inMemoryCache.js +10 -0
  70. package/cache/inmemory/inMemoryCache.js.map +1 -1
  71. package/cache/inmemory/key-extractor.js +1 -1
  72. package/cache/inmemory/policies.js +5 -5
  73. package/cache/inmemory/readFromStore.js +3 -3
  74. package/cache/inmemory/writeToStore.js +4 -4
  75. package/core/ApolloClient.js +14 -14
  76. package/core/ObservableQuery.js +8 -8
  77. package/core/QueryInfo.js +1 -1
  78. package/core/QueryManager.js +24 -14
  79. package/core/QueryManager.js.map +1 -1
  80. package/core/RefetchEventManager.js +3 -3
  81. package/incremental/handlers/graphql17Alpha9.js +1 -1
  82. package/incremental/handlers/notImplemented.js +1 -1
  83. package/invariantErrorCodes.js +122 -116
  84. package/link/core/ApolloLink.js +3 -3
  85. package/link/http/checkFetcher.js +1 -1
  86. package/link/http/parseAndCheckHttpResponse.js +2 -2
  87. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  88. package/link/persisted-queries/index.js +2 -2
  89. package/link/ws/index.js +1 -1
  90. package/local-state/LocalState.js +11 -11
  91. package/masking/maskDefinition.js +2 -2
  92. package/masking/maskFragment.js +2 -2
  93. package/masking/maskOperation.js +1 -1
  94. package/masking/utils.js +3 -3
  95. package/package.json +1 -1
  96. package/react/context/ApolloContext.js +1 -1
  97. package/react/context/ApolloProvider.js +1 -1
  98. package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
  99. package/react/hooks/useApolloClient.js +1 -1
  100. package/react/hooks/useLazyQuery.js +2 -2
  101. package/react/hooks/useLoadableQuery.js +2 -2
  102. package/react/hooks/useSubscription.js +1 -1
  103. package/react/hooks/useSyncExternalStore.js +1 -1
  104. package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +2 -2
  105. package/react/hooks-compiled/useApolloClient.js +1 -1
  106. package/react/hooks-compiled/useLazyQuery.js +2 -2
  107. package/react/hooks-compiled/useLoadableQuery.js +2 -2
  108. package/react/hooks-compiled/useSubscription.js +1 -1
  109. package/react/hooks-compiled/useSyncExternalStore.js +1 -1
  110. package/react/internal/cache/QueryReference.js +1 -1
  111. package/react/ssr/prerenderStatic.js +2 -2
  112. package/testing/core/mocking/mockLink.js +4 -4
  113. package/utilities/graphql/DocumentTransform.js +1 -1
  114. package/utilities/internal/capitalize.d.ts +7 -0
  115. package/utilities/internal/capitalize.js +9 -0
  116. package/utilities/internal/capitalize.js.map +1 -0
  117. package/utilities/internal/coerceScalarFieldsToParsed.d.ts +9 -0
  118. package/utilities/internal/coerceScalarFieldsToParsed.js +66 -0
  119. package/utilities/internal/coerceScalarFieldsToParsed.js.map +1 -0
  120. package/utilities/internal/getFragmentDefinition.js +3 -3
  121. package/utilities/internal/getFragmentFromSelection.js +1 -1
  122. package/utilities/internal/getFragmentFromSelection.js.map +1 -1
  123. package/utilities/internal/getFragmentQueryDocument.js +2 -2
  124. package/utilities/internal/getMainDefinition.js +1 -1
  125. package/utilities/internal/getQueryDefinition.js +1 -1
  126. package/utilities/internal/index.d.ts +2 -0
  127. package/utilities/internal/index.js +2 -0
  128. package/utilities/internal/index.js.map +1 -1
  129. package/utilities/internal/removeDirectivesFromDocument.js +1 -1
  130. package/utilities/internal/shouldInclude.js +4 -4
  131. package/utilities/internal/valueToObjectRepresentation.js +1 -1
  132. package/version.js +1 -1
@@ -242,7 +242,7 @@ export class Policies {
242
242
  const rootId = "ROOT_" + which.toUpperCase();
243
243
  const old = this.rootTypenamesById[rootId];
244
244
  if (typename !== old) {
245
- invariant(!old || old === which, 110, which);
245
+ invariant(!old || old === which, 111, which);
246
246
  // First, delete any old __typename associated with this rootId from
247
247
  // rootIdsByTypename.
248
248
  if (old)
@@ -385,7 +385,7 @@ export class Policies {
385
385
  if (supertypeSet.has(supertype)) {
386
386
  if (!typenameSupertypeSet.has(supertype)) {
387
387
  if (checkingFuzzySubtypes) {
388
- __DEV__ && invariant.warn(111, typename, supertype);
388
+ __DEV__ && invariant.warn(112, typename, supertype);
389
389
  }
390
390
  // Record positive results for faster future lookup.
391
391
  // Unfortunately, we cannot safely cache negative results,
@@ -641,7 +641,7 @@ export function normalizeReadFieldOptions(readFieldArgs, objectOrReference, vari
641
641
  }
642
642
  }
643
643
  if (__DEV__ && options.from === void 0) {
644
- __DEV__ && invariant.warn(112, stringifyForDisplay(Array.from(readFieldArgs)));
644
+ __DEV__ && invariant.warn(113, stringifyForDisplay(Array.from(readFieldArgs)));
645
645
  }
646
646
  if (void 0 === options.variables) {
647
647
  options.variables = variables;
@@ -651,7 +651,7 @@ export function normalizeReadFieldOptions(readFieldArgs, objectOrReference, vari
651
651
  function makeMergeObjectsFunction(store) {
652
652
  return function mergeObjects(existing, incoming) {
653
653
  if (isArray(existing) || isArray(incoming)) {
654
- throw newInvariantError(113);
654
+ throw newInvariantError(114);
655
655
  }
656
656
  // These dynamic checks are necessary because the parameters of a
657
657
  // custom merge function can easily have the any type, so the type
@@ -688,6 +688,6 @@ function makeMergeObjectsFunction(store) {
688
688
  };
689
689
  }
690
690
  function warnAboutScalarConfig(typename, fieldName, scalar, kind) {
691
- __DEV__ && invariant.warn(114, `${typename}.${fieldName}`, scalar, kind);
691
+ __DEV__ && invariant.warn(115, `${typename}.${fieldName}`, scalar, kind);
692
692
  }
693
693
  //# sourceMappingURL=policies.js.map
@@ -282,7 +282,7 @@ export class StoreReader {
282
282
  if (typename) {
283
283
  const policy = policies["getFieldPolicy"](typename, fieldName);
284
284
  if (policy?.scalar) {
285
- __DEV__ && invariant.warn(115, `${typename}.${fieldName}`, policy.scalar);
285
+ __DEV__ && invariant.warn(116, `${typename}.${fieldName}`, policy.scalar);
286
286
  }
287
287
  }
288
288
  }
@@ -319,7 +319,7 @@ export class StoreReader {
319
319
  else {
320
320
  const fragment = getFragmentFromSelection(selection, context.lookupFragment);
321
321
  if (!fragment && selection.kind === Kind.FRAGMENT_SPREAD) {
322
- throw newInvariantError(116, selection.name.value);
322
+ throw newInvariantError(117, selection.name.value);
323
323
  }
324
324
  if (fragment && policies.fragmentMatches(fragment, typename)) {
325
325
  const isDeferBoundary = isDeferredFragment(selection, context.variables);
@@ -616,7 +616,7 @@ function assertSelectionSetForIdValue(store, field, fieldValue) {
616
616
  if (isNonNullObject(value)) {
617
617
  invariant(
618
618
  !isReference(value),
619
- 117,
619
+ 118,
620
620
  getTypenameFromStoreObject(store, value),
621
621
  field.name.value
622
622
  );
@@ -68,7 +68,7 @@ export class StoreWriter {
68
68
  path: [],
69
69
  });
70
70
  if (!isReference(ref)) {
71
- throw newInvariantError(118, result);
71
+ throw newInvariantError(119, result);
72
72
  }
73
73
  // So far, the store has not been modified, so now it's time to process
74
74
  // context.incomingById and merge those incoming fields into context.store.
@@ -230,7 +230,7 @@ export class StoreWriter {
230
230
  // provide a default value, so its absence from the written data should
231
231
  // not be cause for alarm.
232
232
  !policies.getReadFunction(typename, field.name.value)) {
233
- invariant.error(119, resultKeyNameFromField(field), result);
233
+ invariant.error(120, resultKeyNameFromField(field), result);
234
234
  }
235
235
  });
236
236
  // Identify the result object, even if dataId was already provided,
@@ -378,7 +378,7 @@ export class StoreWriter {
378
378
  else {
379
379
  const fragment = getFragmentFromSelection(selection, context.lookupFragment);
380
380
  if (!fragment && selection.kind === Kind.FRAGMENT_SPREAD) {
381
- throw newInvariantError(120, selection.name.value);
381
+ throw newInvariantError(121, selection.name.value);
382
382
  }
383
383
  if (fragment &&
384
384
  policies.fragmentMatches(fragment, typename, result, context.variables)) {
@@ -550,7 +550,7 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
550
550
  }
551
551
  });
552
552
  }
553
- __DEV__ && invariant.warn(121, fieldName, parentType, childTypenames.length ?
553
+ __DEV__ && invariant.warn(122, fieldName, parentType, childTypenames.length ?
554
554
  "either ensure all objects of type " +
555
555
  childTypenames.join(" and ") +
556
556
  " have an ID or a custom merge function, or "
@@ -71,8 +71,8 @@ export class ApolloClient {
71
71
  */
72
72
  constructor(options) {
73
73
  if (__DEV__) {
74
- invariant(options.cache, 68);
75
- invariant(options.link, 69);
74
+ invariant(options.cache, 69);
75
+ invariant(options.link, 70);
76
76
  }
77
77
  const { cache, documentTransform, ssrMode = false, ssrForceFetchDelay = 0, queryDeduplication = true, defaultOptions, defaultContext, assumeImmutableResults = cache.assumeImmutableResults, localState, devtools, dataMasking, link, incrementalHandler = new NotImplementedHandler(), experiments = [], refetchEventManager, } = options;
78
78
  this.link = link;
@@ -260,12 +260,12 @@ export class ApolloClient {
260
260
  if (refetchOn) {
261
261
  const operationName = getOperationName(query, "(anonymous)");
262
262
  if (!refetchEventManager) {
263
- __DEV__ && invariant.warn(70, operationName);
263
+ __DEV__ && invariant.warn(71, operationName);
264
264
  }
265
265
  else if (typeof refetchOn === "object") {
266
266
  Object.keys(refetchOn).forEach((source) => {
267
267
  if (!refetchEventManager.hasSource(source)) {
268
- __DEV__ && invariant.warn(71, source, operationName);
268
+ __DEV__ && invariant.warn(72, source, operationName);
269
269
  }
270
270
  });
271
271
  }
@@ -287,13 +287,13 @@ export class ApolloClient {
287
287
  options = mergeOptions(this.defaultOptions.query, options);
288
288
  }
289
289
  if (__DEV__) {
290
- invariant(options.fetchPolicy !== "cache-and-network", 72);
291
- invariant(options.fetchPolicy !== "standby", 73);
292
- invariant(options.query, 74);
293
- invariant(options.query.kind === "Document", 75);
294
- invariant(!options.returnPartialData, 76);
295
- invariant(!options.pollInterval, 77);
296
- invariant(!options.notifyOnNetworkStatusChange, 78);
290
+ invariant(options.fetchPolicy !== "cache-and-network", 73);
291
+ invariant(options.fetchPolicy !== "standby", 74);
292
+ invariant(options.query, 75);
293
+ invariant(options.query.kind === "Document", 76);
294
+ invariant(!options.returnPartialData, 77);
295
+ invariant(!options.pollInterval, 78);
296
+ invariant(!options.notifyOnNetworkStatusChange, 79);
297
297
  }
298
298
  return this.queryManager.query(options);
299
299
  };
@@ -311,9 +311,9 @@ export class ApolloClient {
311
311
  errorPolicy: "none",
312
312
  }, this.defaultOptions.mutate), options);
313
313
  if (__DEV__) {
314
- invariant(optionsWithDefaults.mutation, 79);
314
+ invariant(optionsWithDefaults.mutation, 80);
315
315
  invariant(optionsWithDefaults.fetchPolicy === "network-only" ||
316
- optionsWithDefaults.fetchPolicy === "no-cache", 80);
316
+ optionsWithDefaults.fetchPolicy === "no-cache", 81);
317
317
  }
318
318
  checkDocument(optionsWithDefaults.mutation, OperationTypeNode.MUTATION);
319
319
  return this.queryManager.mutate(optionsWithDefaults);
@@ -519,7 +519,7 @@ export class ApolloClient {
519
519
  // result.queries and result.results instead, you shouldn't have to worry
520
520
  // about preventing uncaught rejections for the Promise.all result.
521
521
  result.catch((error) => {
522
- __DEV__ && invariant.debug(81, error);
522
+ __DEV__ && invariant.debug(82, error);
523
523
  });
524
524
  return result;
525
525
  }
@@ -102,7 +102,7 @@ export class ObservableQuery {
102
102
  // Make sure we don't store "standby" as the initialFetchPolicy.
103
103
  initialFetchPolicy = fetchPolicy === "standby" ? defaultFetchPolicy : (fetchPolicy), } = options;
104
104
  if (options[variablesUnknownSymbol]) {
105
- invariant(fetchPolicy === "standby", 82);
105
+ invariant(fetchPolicy === "standby", 83);
106
106
  this.variablesUnknown = true;
107
107
  }
108
108
  this.lastQuery = transformedQuery;
@@ -411,7 +411,7 @@ export class ObservableQuery {
411
411
  const queryDef = getQueryDefinition(this.query);
412
412
  const vars = queryDef.variableDefinitions;
413
413
  if (!vars || !vars.some((v) => v.variable.name.value === "variables")) {
414
- __DEV__ && invariant.warn(83, variables, queryDef.name?.value || queryDef);
414
+ __DEV__ && invariant.warn(84, variables, queryDef.name?.value || queryDef);
415
415
  }
416
416
  }
417
417
  if (variables && !equal(this.variables, variables)) {
@@ -426,7 +426,7 @@ export class ObservableQuery {
426
426
  fetchMore({ query, variables, context, errorPolicy, updateQuery, }) {
427
427
  invariant(
428
428
  this.options.fetchPolicy !== "cache-only",
429
- 84,
429
+ 85,
430
430
  getOperationName(this.query, "(anonymous)")
431
431
  );
432
432
  const combinedOptions = {
@@ -460,7 +460,7 @@ export class ObservableQuery {
460
460
  let wasUpdated = false;
461
461
  const isCached = this.options.fetchPolicy !== "no-cache";
462
462
  if (!isCached) {
463
- invariant(updateQuery, 85);
463
+ invariant(updateQuery, 86);
464
464
  }
465
465
  const { finalize, pushNotification } = this.pushOperation(NetworkStatus.fetchMore);
466
466
  pushNotification({
@@ -634,7 +634,7 @@ export class ObservableQuery {
634
634
  onError(error);
635
635
  }
636
636
  else {
637
- invariant.error(86, error);
637
+ invariant.error(87, error);
638
638
  }
639
639
  return;
640
640
  }
@@ -885,7 +885,7 @@ export class ObservableQuery {
885
885
  if (!this.didWarnCacheOnlyPolling &&
886
886
  pollInterval &&
887
887
  fetchPolicy === "cache-only") {
888
- __DEV__ && invariant.warn(87, getOperationName(this.query, "(anonymous)"));
888
+ __DEV__ && invariant.warn(88, getOperationName(this.query, "(anonymous)"));
889
889
  this.didWarnCacheOnlyPolling = true;
890
890
  }
891
891
  }
@@ -1511,7 +1511,7 @@ export class ObservableQuery {
1511
1511
  }
1512
1512
  export function logMissingFieldErrors(missing) {
1513
1513
  if (__DEV__ && missing) {
1514
- __DEV__ && invariant.debug(88, missing);
1514
+ __DEV__ && invariant.debug(89, missing);
1515
1515
  }
1516
1516
  }
1517
1517
  function isEqualQuery(a, b) {
@@ -1555,6 +1555,6 @@ function getTrackingOperatorPromise(defaultValue) {
1555
1555
  return { promise, operator };
1556
1556
  }
1557
1557
  function warnOnFeud(query, diff) {
1558
- __DEV__ && invariant.warn(89, getOperationName(query, "(anonymous)"), diff.missing?.missing);
1558
+ __DEV__ && invariant.warn(90, getOperationName(query, "(anonymous)"), diff.missing?.missing);
1559
1559
  }
1560
1560
  //# sourceMappingURL=ObservableQuery.js.map
package/core/QueryInfo.js CHANGED
@@ -363,7 +363,7 @@ export class QueryInfo {
363
363
  }
364
364
  function warnAboutPartialCacheResult(query, networkResult, diff) {
365
365
  __DEV__ && invariant.warn(
366
- 90,
366
+ 91,
367
367
  getOperationName(query, "(anonymous)"),
368
368
  diff.missing?.missing,
369
369
  networkResult,
@@ -9,7 +9,7 @@ import { execute } from "@apollo/client/link";
9
9
  import { maskFragment, maskOperation } from "@apollo/client/masking";
10
10
  import { cacheSizes, DocumentTransform, isNetworkRequestInFlight, print, } from "@apollo/client/utilities";
11
11
  import { __DEV__ } from "@apollo/client/utilities/environment";
12
- import { AutoCleanedWeakCache, checkDocument, extensionsSymbol, filterMap, getDefaultValues, getOperationDefinition, getOperationName, graphQLResultHasError, hasDirectives, hasForcedResolvers, isDocumentNode, isNonNullObject, makeUniqueId, mergeOptions, removeDirectivesFromDocument, streamInfoSymbol, toQueryResult, } from "@apollo/client/utilities/internal";
12
+ import { AutoCleanedWeakCache, checkDocument, coerceScalarFieldsToParsed, extensionsSymbol, filterMap, getDefaultValues, getOperationDefinition, getOperationName, graphQLResultHasError, hasDirectives, hasForcedResolvers, isDocumentNode, isNonNullObject, makeUniqueId, mergeOptions, removeDirectivesFromDocument, streamInfoSymbol, toQueryResult, } from "@apollo/client/utilities/internal";
13
13
  import { invariant, newInvariantError, } from "@apollo/client/utilities/invariant";
14
14
  import { dataStateErrorCache } from "./dataStateErrorCache.js";
15
15
  import { NetworkStatus } from "./networkStatus.js";
@@ -99,7 +99,7 @@ export class QueryManager {
99
99
  */
100
100
  stop() {
101
101
  this.obsQueries.forEach((oq) => oq.stop());
102
- this.cancelPendingFetches(newInvariantError(91));
102
+ this.cancelPendingFetches(newInvariantError(92));
103
103
  }
104
104
  cancelPendingFetches(error) {
105
105
  this.fetchCancelFns.forEach((cancel) => cancel(error));
@@ -112,7 +112,7 @@ export class QueryManager {
112
112
  variables = this.getVariables(mutation, variables);
113
113
  if (hasClientExports) {
114
114
  if (__DEV__) {
115
- invariant(this.localState, 92, getOperationName(mutation, "(anonymous)"));
115
+ invariant(this.localState, 93, getOperationName(mutation, "(anonymous)"));
116
116
  }
117
117
  variables = await this.localState.getExportedVariables({
118
118
  client: this.client,
@@ -345,7 +345,7 @@ export class QueryManager {
345
345
  // depend on values that previously existed in the data portion of the
346
346
  // store. So, we cancel the promises and observers that we have issued
347
347
  // so far and not yet resolved (in the case of queries).
348
- this.cancelPendingFetches(newInvariantError(93));
348
+ this.cancelPendingFetches(newInvariantError(94));
349
349
  this.obsQueries.forEach((observableQuery) => {
350
350
  // Set loading to true so listeners don't trigger unless they want
351
351
  // results with partial data.
@@ -415,10 +415,10 @@ export class QueryManager {
415
415
  if (!included) {
416
416
  const queryName = queryNames.get(nameOrQueryString);
417
417
  if (queryName) {
418
- __DEV__ && invariant.warn(94, queryName);
418
+ __DEV__ && invariant.warn(95, queryName);
419
419
  }
420
420
  else {
421
- __DEV__ && invariant.warn(95);
421
+ __DEV__ && invariant.warn(96);
422
422
  }
423
423
  }
424
424
  });
@@ -447,7 +447,7 @@ export class QueryManager {
447
447
  if (__DEV__) {
448
448
  invariant(
449
449
  !this.getDocumentInfo(query).hasClientExports || this.localState,
450
- 96,
450
+ 97,
451
451
  getOperationName(query, "(anonymous)")
452
452
  );
453
453
  }
@@ -592,14 +592,14 @@ export class QueryManager {
592
592
  if (__DEV__) {
593
593
  invariant(
594
594
  this.localState,
595
- 97,
595
+ 98,
596
596
  operation[0].toUpperCase() + operation.slice(1),
597
597
  operationName ?? "(anonymous)"
598
598
  );
599
599
  }
600
600
  invariant(
601
601
  !hasIncrementalDirective,
602
- 98,
602
+ 99,
603
603
  operation[0].toUpperCase() + operation.slice(1),
604
604
  operationName ?? "(anonymous)"
605
605
  );
@@ -767,7 +767,7 @@ export class QueryManager {
767
767
  // we deprecated and removed LocalState.
768
768
  if (this.getDocumentInfo(normalized.query).hasClientExports) {
769
769
  if (__DEV__) {
770
- invariant(this.localState, 99, getOperationName(normalized.query, "(anonymous)"));
770
+ invariant(this.localState, 100, getOperationName(normalized.query, "(anonymous)"));
771
771
  }
772
772
  observable = from(this.localState.getExportedVariables({
773
773
  client: this.client,
@@ -940,7 +940,7 @@ export class QueryManager {
940
940
  !isFullyUnmaskedOperation(document) &&
941
941
  !this.noCacheWarningsByCause.has(cause)) {
942
942
  this.noCacheWarningsByCause.add(cause);
943
- __DEV__ && invariant.warn(100, getOperationName(document, `Unnamed ${operationType ?? "operation"}`));
943
+ __DEV__ && invariant.warn(101, getOperationName(document, `Unnamed ${operationType ?? "operation"}`));
944
944
  }
945
945
  }
946
946
  return (this.dataMasking ?
@@ -1003,7 +1003,7 @@ export class QueryManager {
1003
1003
  (diff.complete || returnPartialData) &&
1004
1004
  this.getDocumentInfo(query).hasForcedResolvers) {
1005
1005
  if (__DEV__) {
1006
- invariant(this.localState, 101, getOperationName(query, "(anonymous)"));
1006
+ invariant(this.localState, 102, getOperationName(query, "(anonymous)"));
1007
1007
  }
1008
1008
  onCacheHit();
1009
1009
  return from(this.localState.execute({
@@ -1101,7 +1101,17 @@ export class QueryManager {
1101
1101
  }),
1102
1102
  };
1103
1103
  case "no-cache":
1104
- return { fromLink: true, observable: resultsFromLink() };
1104
+ return {
1105
+ fromLink: true,
1106
+ observable: resultsFromLink().pipe(map((notification) => {
1107
+ if (notification.kind === "N" &&
1108
+ notification.value.data != null &&
1109
+ this.cache.configuresScalars()) {
1110
+ notification.value.data = coerceScalarFieldsToParsed(notification.value.data, query, this.cache);
1111
+ }
1112
+ return notification;
1113
+ })),
1114
+ };
1105
1115
  case "standby":
1106
1116
  return { fromLink: false, observable: EMPTY };
1107
1117
  }
@@ -1114,7 +1124,7 @@ function validateDidEmitValue() {
1114
1124
  didEmitValue = true;
1115
1125
  },
1116
1126
  complete() {
1117
- invariant(didEmitValue, 102);
1127
+ invariant(didEmitValue, 103);
1118
1128
  },
1119
1129
  });
1120
1130
  }