@apollo/client 4.0.0-alpha.5 → 4.0.0-alpha.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 (181) hide show
  1. package/.changeset/giant-bags-share.md +5 -0
  2. package/.changeset/nervous-fireants-bow.md +5 -0
  3. package/.changeset/pre.json +4 -0
  4. package/.changeset/tame-points-work.md +11 -0
  5. package/.changeset/tender-swans-flash.md +16 -0
  6. package/CHANGELOG.md +32 -0
  7. package/__cjs/cache/core/cache.cjs +1 -1
  8. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  9. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  10. package/__cjs/cache/inmemory/policies.cjs +4 -4
  11. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  12. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  13. package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs +3 -1
  14. package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs.map +1 -1
  15. package/__cjs/config/jest/setup.cjs +6 -0
  16. package/__cjs/config/jest/setup.cjs.map +1 -1
  17. package/__cjs/core/ApolloClient.cjs +9 -3
  18. package/__cjs/core/ApolloClient.cjs.map +1 -1
  19. package/__cjs/core/ApolloClient.d.cts +5 -5
  20. package/__cjs/core/LocalState.cjs +2 -2
  21. package/__cjs/core/ObservableQuery.cjs +15 -10
  22. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  23. package/__cjs/core/ObservableQuery.d.cts +6 -6
  24. package/__cjs/core/QueryManager.cjs +34 -25
  25. package/__cjs/core/QueryManager.cjs.map +1 -1
  26. package/__cjs/core/QueryManager.d.cts +4 -4
  27. package/__cjs/core/types.d.cts +24 -2
  28. package/__cjs/errors/CombinedGraphQLErrors.cjs +8 -1
  29. package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
  30. package/__cjs/errors/CombinedGraphQLErrors.d.cts +7 -2
  31. package/__cjs/invariantErrorCodes.cjs +110 -88
  32. package/__cjs/link/core/ApolloLink.cjs +2 -2
  33. package/__cjs/link/http/checkFetcher.cjs +1 -1
  34. package/__cjs/link/http/createHttpLink.cjs +1 -1
  35. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  36. package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
  37. package/__cjs/link/persisted-queries/index.cjs +2 -2
  38. package/__cjs/link/subscriptions/index.cjs +3 -1
  39. package/__cjs/link/subscriptions/index.cjs.map +1 -1
  40. package/__cjs/link/utils/validateOperation.cjs +1 -1
  41. package/__cjs/masking/maskDefinition.cjs +2 -2
  42. package/__cjs/masking/maskFragment.cjs +2 -2
  43. package/__cjs/masking/maskOperation.cjs +1 -1
  44. package/__cjs/masking/utils.cjs +1 -1
  45. package/__cjs/react/context/ApolloConsumer.cjs +1 -1
  46. package/__cjs/react/context/ApolloContext.cjs +1 -1
  47. package/__cjs/react/context/ApolloProvider.cjs +1 -1
  48. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  49. package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
  50. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  51. package/__cjs/react/hooks/useLazyQuery.d.cts +4 -4
  52. package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
  53. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  54. package/__cjs/react/hooks/useQuery.d.cts +3 -3
  55. package/__cjs/react/hooks/useSubscription.cjs +1 -1
  56. package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -2
  57. package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
  58. package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
  59. package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
  60. package/__cjs/react/internal/cache/QueryReference.d.cts +3 -3
  61. package/__cjs/react/internal/types.d.cts +2 -2
  62. package/__cjs/react/parser/index.cjs +5 -5
  63. package/__cjs/react/ssr/getDataFromTree.cjs +23 -60
  64. package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
  65. package/__cjs/react/ssr/getDataFromTree.d.cts +12 -6
  66. package/__cjs/react/ssr/index.cjs +3 -1
  67. package/__cjs/react/ssr/index.cjs.map +1 -1
  68. package/__cjs/react/ssr/index.d.cts +1 -0
  69. package/__cjs/react/ssr/prerenderStatic.cjs +151 -0
  70. package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -0
  71. package/__cjs/react/ssr/prerenderStatic.d.cts +122 -0
  72. package/__cjs/react/ssr/renderToStringWithData.cjs +11 -5
  73. package/__cjs/react/ssr/renderToStringWithData.cjs.map +1 -1
  74. package/__cjs/react/ssr/renderToStringWithData.d.cts +5 -0
  75. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
  76. package/__cjs/react/ssr/useSSRQuery.d.cts +2 -2
  77. package/__cjs/testing/internal/index.cjs +3 -1
  78. package/__cjs/testing/internal/index.cjs.map +1 -1
  79. package/__cjs/testing/internal/index.d.cts +1 -0
  80. package/__cjs/testing/internal/resetApolloContext.cjs +24 -0
  81. package/__cjs/testing/internal/resetApolloContext.cjs.map +1 -0
  82. package/__cjs/testing/internal/resetApolloContext.d.cts +10 -0
  83. package/__cjs/utilities/internal/index.cjs +3 -1
  84. package/__cjs/utilities/internal/index.cjs.map +1 -1
  85. package/__cjs/utilities/internal/index.d.cts +1 -0
  86. package/__cjs/utilities/internal/toQueryResult.cjs +13 -0
  87. package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -0
  88. package/__cjs/utilities/internal/toQueryResult.d.cts +3 -0
  89. package/__cjs/version.cjs +1 -1
  90. package/__cjs/version.d.cts +1 -1
  91. package/cache/core/cache.js +1 -1
  92. package/cache/inmemory/entityStore.js +3 -3
  93. package/cache/inmemory/key-extractor.js +1 -1
  94. package/cache/inmemory/policies.js +4 -4
  95. package/cache/inmemory/readFromStore.js +2 -2
  96. package/cache/inmemory/writeToStore.js +4 -4
  97. package/config/jest/areCombinedGraphQLErrorsEqual.js +3 -1
  98. package/config/jest/areCombinedGraphQLErrorsEqual.js.map +1 -1
  99. package/config/jest/setup.js +6 -0
  100. package/config/jest/setup.js.map +1 -1
  101. package/core/ApolloClient.d.ts +5 -5
  102. package/core/ApolloClient.js +9 -3
  103. package/core/ApolloClient.js.map +1 -1
  104. package/core/LocalState.js +2 -2
  105. package/core/ObservableQuery.d.ts +6 -6
  106. package/core/ObservableQuery.js +15 -10
  107. package/core/ObservableQuery.js.map +1 -1
  108. package/core/QueryManager.d.ts +4 -4
  109. package/core/QueryManager.js +35 -26
  110. package/core/QueryManager.js.map +1 -1
  111. package/core/types.d.ts +24 -2
  112. package/errors/CombinedGraphQLErrors.d.ts +7 -2
  113. package/errors/CombinedGraphQLErrors.js +8 -1
  114. package/errors/CombinedGraphQLErrors.js.map +1 -1
  115. package/invariantErrorCodes.js +110 -88
  116. package/link/core/ApolloLink.js +2 -2
  117. package/link/http/checkFetcher.js +1 -1
  118. package/link/http/createHttpLink.js +1 -1
  119. package/link/http/parseAndCheckHttpResponse.js +1 -1
  120. package/link/http/serializeFetchParameter.js +1 -1
  121. package/link/persisted-queries/index.js +2 -2
  122. package/link/subscriptions/index.js +3 -1
  123. package/link/subscriptions/index.js.map +1 -1
  124. package/link/utils/validateOperation.js +1 -1
  125. package/masking/maskDefinition.js +2 -2
  126. package/masking/maskFragment.js +2 -2
  127. package/masking/maskOperation.js +1 -1
  128. package/masking/utils.js +1 -1
  129. package/package.json +1 -1
  130. package/react/context/ApolloConsumer.js +1 -1
  131. package/react/context/ApolloContext.js +1 -1
  132. package/react/context/ApolloProvider.js +1 -1
  133. package/react/hooks/useApolloClient.js +1 -1
  134. package/react/hooks/useLazyQuery.d.ts +4 -4
  135. package/react/hooks/useLazyQuery.js +2 -2
  136. package/react/hooks/useLazyQuery.js.map +1 -1
  137. package/react/hooks/useLoadableQuery.js +2 -2
  138. package/react/hooks/useQuery.d.ts +3 -3
  139. package/react/hooks/useQuery.js.map +1 -1
  140. package/react/hooks/useSubscription.js +1 -1
  141. package/react/hooks/useSuspenseQuery.js +2 -2
  142. package/react/hooks/useSyncExternalStore.js +1 -1
  143. package/react/internal/cache/QueryReference.d.ts +3 -3
  144. package/react/internal/cache/QueryReference.js +1 -1
  145. package/react/internal/cache/QueryReference.js.map +1 -1
  146. package/react/internal/types.d.ts +2 -2
  147. package/react/parser/index.js +5 -5
  148. package/react/ssr/getDataFromTree.d.ts +12 -6
  149. package/react/ssr/getDataFromTree.js +23 -59
  150. package/react/ssr/getDataFromTree.js.map +1 -1
  151. package/react/ssr/index.d.ts +1 -0
  152. package/react/ssr/index.js +1 -0
  153. package/react/ssr/index.js.map +1 -1
  154. package/react/ssr/prerenderStatic.d.ts +122 -0
  155. package/react/ssr/prerenderStatic.js +147 -0
  156. package/react/ssr/prerenderStatic.js.map +1 -0
  157. package/react/ssr/renderToStringWithData.d.ts +5 -0
  158. package/react/ssr/renderToStringWithData.js +11 -5
  159. package/react/ssr/renderToStringWithData.js.map +1 -1
  160. package/react/ssr/useSSRQuery.d.ts +2 -2
  161. package/react/ssr/useSSRQuery.js.map +1 -1
  162. package/testing/internal/index.d.ts +1 -0
  163. package/testing/internal/index.js +2 -1
  164. package/testing/internal/index.js.map +1 -1
  165. package/testing/internal/resetApolloContext.d.ts +10 -0
  166. package/testing/internal/resetApolloContext.js +20 -0
  167. package/testing/internal/resetApolloContext.js.map +1 -0
  168. package/utilities/internal/index.d.ts +1 -0
  169. package/utilities/internal/index.js +2 -1
  170. package/utilities/internal/index.js.map +1 -1
  171. package/utilities/internal/toQueryResult.d.ts +3 -0
  172. package/utilities/internal/toQueryResult.js +10 -0
  173. package/utilities/internal/toQueryResult.js.map +1 -0
  174. package/version.d.ts +1 -1
  175. package/version.js +1 -1
  176. package/__cjs/utilities/types/TODO.cjs +0 -3
  177. package/__cjs/utilities/types/TODO.cjs.map +0 -1
  178. package/__cjs/utilities/types/TODO.d.cts +0 -3
  179. package/utilities/types/TODO.d.ts +0 -3
  180. package/utilities/types/TODO.js +0 -2
  181. package/utilities/types/TODO.js.map +0 -1
@@ -5,7 +5,7 @@ import type { MissingTree } from "@apollo/client/cache";
5
5
  import type { MaybeMasked, Unmasked } from "@apollo/client/masking";
6
6
  import type { QueryInfo } from "./QueryInfo.cjs";
7
7
  import type { QueryManager } from "./QueryManager.cjs";
8
- import type { ApolloQueryResult, ErrorLike, OperationVariables, TypedDocumentNode } from "./types.cjs";
8
+ import type { ApolloQueryResult, ErrorLike, OperationVariables, QueryResult, TypedDocumentNode } from "./types.cjs";
9
9
  import type { FetchMoreQueryOptions, SubscribeToMoreOptions, UpdateQueryMapFn, WatchQueryOptions } from "./watchQueryOptions.cjs";
10
10
  export interface FetchMoreOptions<TData = unknown, TVariables = OperationVariables> {
11
11
  updateQuery?: (previousQueryResult: TData, options: {
@@ -61,7 +61,7 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
61
61
  * @param variables - The new set of variables. If there are missing variables,
62
62
  * the previous values of those variables will be used.
63
63
  */
64
- refetch(variables?: Partial<TVariables>): Promise<ApolloQueryResult<MaybeMasked<TData>>>;
64
+ refetch(variables?: Partial<TVariables>): Promise<QueryResult<TData>>;
65
65
  /**
66
66
  * A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
67
67
  */
@@ -70,7 +70,7 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
70
70
  fetchMoreResult: Unmasked<TFetchData>;
71
71
  variables: TFetchVars;
72
72
  }) => Unmasked<TData>;
73
- }): Promise<ApolloQueryResult<MaybeMasked<TFetchData>>>;
73
+ }): Promise<QueryResult<TFetchData>>;
74
74
  /**
75
75
  * A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
76
76
  *
@@ -97,7 +97,7 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
97
97
  * @param variables - The new set of variables. If there are missing variables,
98
98
  * the previous values of those variables will be used.
99
99
  */
100
- setVariables(variables: TVariables): Promise<ApolloQueryResult<MaybeMasked<TData>>>;
100
+ setVariables(variables: TVariables): Promise<QueryResult<TData>>;
101
101
  /**
102
102
  * A function that enables you to update the query's cached result without executing a followup GraphQL operation.
103
103
  *
@@ -120,7 +120,7 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
120
120
  * Reevaluate the query, optionally against new options. New options will be
121
121
  * merged with the current options when given.
122
122
  */
123
- reobserve(newOptions?: Partial<WatchQueryOptions<TVariables, TData>>): Promise<ApolloQueryResult<MaybeMasked<TData>>>;
123
+ reobserve(newOptions?: Partial<WatchQueryOptions<TVariables, TData>>): Promise<QueryResult<MaybeMasked<TData>>>;
124
124
  private observe;
125
125
  private reportResult;
126
126
  private reportError;
@@ -129,6 +129,6 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
129
129
  private transformDocument;
130
130
  private maskResult;
131
131
  }
132
- export declare function reobserveCacheFirst<TData, TVars extends OperationVariables>(obsQuery: ObservableQuery<TData, TVars>): Promise<ApolloQueryResult<TData>>;
132
+ export declare function reobserveCacheFirst<TData, TVars extends OperationVariables>(obsQuery: ObservableQuery<TData, TVars>): Promise<QueryResult<TData>>;
133
133
  export declare function logMissingFieldErrors(missing: MissingFieldError | MissingTree | undefined): void;
134
134
  //# sourceMappingURL=ObservableQuery.d.cts.map
@@ -95,15 +95,15 @@ class QueryManager {
95
95
  this.queries.forEach((_info, queryId) => {
96
96
  this.removeQuery(queryId);
97
97
  });
98
- this.cancelPendingFetches((0, invariant_1.newInvariantError)(68));
98
+ this.cancelPendingFetches((0, invariant_1.newInvariantError)(74));
99
99
  }
100
100
  cancelPendingFetches(error) {
101
101
  this.fetchCancelFns.forEach((cancel) => cancel(error));
102
102
  this.fetchCancelFns.clear();
103
103
  }
104
104
  async mutate({ mutation, variables, optimisticResponse, updateQueries, refetchQueries = [], awaitRefetchQueries = false, update: updateWithProxyFn, onQueryUpdated, fetchPolicy = this.defaultOptions.mutate?.fetchPolicy || "network-only", errorPolicy = this.defaultOptions.mutate?.errorPolicy || "none", keepRootFields, context, }) {
105
- (0, invariant_1.invariant)(mutation, 69);
106
- (0, invariant_1.invariant)(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 70);
105
+ (0, invariant_1.invariant)(mutation, 75);
106
+ (0, invariant_1.invariant)(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 76);
107
107
  const mutationId = this.generateMutationId();
108
108
  mutation = this.cache.transformForLink(this.transform(mutation));
109
109
  const { hasClientExports } = this.getDocumentInfo(mutation);
@@ -136,10 +136,10 @@ class QueryManager {
136
136
  ...context,
137
137
  optimisticResponse: isOptimistic ? optimisticResponse : void 0,
138
138
  }, variables, {}, false)
139
- .pipe((0, rxjs_1.mergeMap)((result) => {
139
+ .pipe(validateDidEmitValue(), (0, rxjs_1.mergeMap)((result) => {
140
140
  const hasErrors = (0, utilities_4.graphQLResultHasError)(result);
141
141
  if (hasErrors && errorPolicy === "none") {
142
- throw new errors_1.CombinedGraphQLErrors((0, utilities_4.getGraphQLErrorsFromResult)(result));
142
+ throw new errors_1.CombinedGraphQLErrors(result);
143
143
  }
144
144
  if (mutationStoreValue) {
145
145
  mutationStoreValue.loading = false;
@@ -187,7 +187,7 @@ class QueryManager {
187
187
  }),
188
188
  };
189
189
  if ((0, utilities_4.graphQLResultHasError)(storeResult)) {
190
- result.error = new errors_1.CombinedGraphQLErrors((0, utilities_4.getGraphQLErrorsFromResult)(storeResult));
190
+ result.error = new errors_1.CombinedGraphQLErrors(storeResult);
191
191
  }
192
192
  if (storeResult.extensions) {
193
193
  result.extensions = storeResult.extensions;
@@ -401,7 +401,11 @@ class QueryManager {
401
401
  return true;
402
402
  }
403
403
  fetchQuery(queryId, options, networkStatus) {
404
- return (0, rxjs_1.lastValueFrom)(this.fetchObservableWithInfo(queryId, options, networkStatus).observable, { defaultValue: undefined });
404
+ return (0, rxjs_1.lastValueFrom)(this.fetchObservableWithInfo(queryId, options, networkStatus).observable.pipe((0, rxjs_1.map)(internal_1.toQueryResult)), {
405
+ // This default is needed when a `standby` fetch policy is used to avoid
406
+ // an EmptyError from rejecting this promise.
407
+ defaultValue: { data: undefined },
408
+ });
405
409
  }
406
410
  transform(document) {
407
411
  return this.documentTransform.transformDocument(document);
@@ -481,24 +485,18 @@ class QueryManager {
481
485
  });
482
486
  return observable;
483
487
  }
484
- // TODO: catch `EmptyError` and rethrow as network error if `complete`
485
- // notification is emitted without a value.
486
488
  query(options, queryId = this.generateQueryId()) {
487
- (0, invariant_1.invariant)(options.query, 71);
488
- (0, invariant_1.invariant)(options.query.kind === "Document", 72);
489
- (0, invariant_1.invariant)(!options.returnPartialData, 73);
490
- (0, invariant_1.invariant)(!options.pollInterval, 74);
491
489
  const query = this.transform(options.query);
492
490
  return this.fetchQuery(queryId, { ...options, query })
493
- .then((result) => result && {
494
- ...result,
491
+ .then((value) => ({
492
+ ...value,
495
493
  data: this.maskOperation({
496
494
  document: query,
497
- data: result.data,
495
+ data: value?.data,
498
496
  fetchPolicy: options.fetchPolicy,
499
497
  id: queryId,
500
498
  }),
501
- })
499
+ }))
502
500
  .finally(() => this.stopQuery(queryId));
503
501
  }
504
502
  queryIdCounter = 1;
@@ -521,7 +519,7 @@ class QueryManager {
521
519
  // depend on values that previously existed in the data portion of the
522
520
  // store. So, we cancel the promises and observers that we have issued
523
521
  // so far and not yet resolved (in the case of queries).
524
- this.cancelPendingFetches((0, invariant_1.newInvariantError)(75));
522
+ this.cancelPendingFetches((0, invariant_1.newInvariantError)(77));
525
523
  this.queries.forEach((queryInfo) => {
526
524
  if (queryInfo.observableQuery) {
527
525
  // Set loading to true so listeners don't trigger unless they want
@@ -609,10 +607,10 @@ class QueryManager {
609
607
  if (!included) {
610
608
  const queryName = queryNames.get(nameOrQueryString);
611
609
  if (queryName) {
612
- __DEV__ && invariant_1.invariant.warn(76, queryName);
610
+ __DEV__ && invariant_1.invariant.warn(78, queryName);
613
611
  }
614
612
  else {
615
- __DEV__ && invariant_1.invariant.warn(77);
613
+ __DEV__ && invariant_1.invariant.warn(79);
616
614
  }
617
615
  }
618
616
  });
@@ -659,7 +657,7 @@ class QueryManager {
659
657
  data: rawResult.data ?? undefined,
660
658
  };
661
659
  if ((0, utilities_4.graphQLResultHasError)(rawResult)) {
662
- result.error = new errors_1.CombinedGraphQLErrors(rawResult.errors);
660
+ result.error = new errors_1.CombinedGraphQLErrors(rawResult);
663
661
  }
664
662
  else if ((0, errors_1.graphQLResultHasProtocolErrors)(rawResult)) {
665
663
  result.error = rawResult.extensions[errors_2.PROTOCOL_ERRORS_SYMBOL];
@@ -795,7 +793,7 @@ class QueryManager {
795
793
  queryInfo.resetLastWrite();
796
794
  queryInfo.reset();
797
795
  // Throwing here effectively calls observer.error.
798
- throw new errors_1.CombinedGraphQLErrors(graphQLErrors);
796
+ throw new errors_1.CombinedGraphQLErrors(result);
799
797
  }
800
798
  // Use linkDocument rather than queryInfo.document so the
801
799
  // operation/fragments used to write the result are the same as the
@@ -816,7 +814,7 @@ class QueryManager {
816
814
  aqr.data = void 0;
817
815
  }
818
816
  if (hasErrors && errorPolicy !== "ignore") {
819
- aqr.error = new errors_1.CombinedGraphQLErrors(graphQLErrors);
817
+ aqr.error = new errors_1.CombinedGraphQLErrors(result);
820
818
  aqr.networkStatus = networkStatus_js_1.NetworkStatus.error;
821
819
  }
822
820
  return aqr;
@@ -1053,7 +1051,7 @@ class QueryManager {
1053
1051
  !(0, utilities_3.isFullyUnmaskedOperation)(document) &&
1054
1052
  !this.noCacheWarningsByQueryId.has(operationId)) {
1055
1053
  this.noCacheWarningsByQueryId.add(operationId);
1056
- __DEV__ && invariant_1.invariant.warn(78, (0, utilities_4.getOperationName)(document) ??
1054
+ __DEV__ && invariant_1.invariant.warn(80, (0, utilities_4.getOperationName)(document) ??
1057
1055
  `Unnamed ${operationType ?? "operation"}`);
1058
1056
  }
1059
1057
  }
@@ -1143,7 +1141,7 @@ class QueryManager {
1143
1141
  context,
1144
1142
  fetchPolicy,
1145
1143
  errorPolicy,
1146
- });
1144
+ }).pipe(validateDidEmitValue());
1147
1145
  switch (fetchPolicy) {
1148
1146
  default:
1149
1147
  case "cache-first": {
@@ -1233,4 +1231,15 @@ function maybeWrapError(error) {
1233
1231
  }
1234
1232
  return new errors_1.UnconventionalError(error);
1235
1233
  }
1234
+ function validateDidEmitValue() {
1235
+ let didEmitValue = false;
1236
+ return (0, rxjs_1.tap)({
1237
+ next() {
1238
+ didEmitValue = true;
1239
+ },
1240
+ complete() {
1241
+ (0, invariant_1.invariant)(didEmitValue, 81);
1242
+ },
1243
+ });
1244
+ }
1236
1245
  //# sourceMappingURL=QueryManager.cjs.map