@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.
- package/.changeset/giant-bags-share.md +5 -0
- package/.changeset/nervous-fireants-bow.md +5 -0
- package/.changeset/pre.json +4 -0
- package/.changeset/tame-points-work.md +11 -0
- package/.changeset/tender-swans-flash.md +16 -0
- package/CHANGELOG.md +32 -0
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +4 -4
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs +3 -1
- package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs.map +1 -1
- package/__cjs/config/jest/setup.cjs +6 -0
- package/__cjs/config/jest/setup.cjs.map +1 -1
- package/__cjs/core/ApolloClient.cjs +9 -3
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +5 -5
- package/__cjs/core/LocalState.cjs +2 -2
- package/__cjs/core/ObservableQuery.cjs +15 -10
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +6 -6
- package/__cjs/core/QueryManager.cjs +34 -25
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +4 -4
- package/__cjs/core/types.d.cts +24 -2
- package/__cjs/errors/CombinedGraphQLErrors.cjs +8 -1
- package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedGraphQLErrors.d.cts +7 -2
- package/__cjs/invariantErrorCodes.cjs +110 -88
- package/__cjs/link/core/ApolloLink.cjs +2 -2
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/createHttpLink.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/subscriptions/index.cjs +3 -1
- package/__cjs/link/subscriptions/index.cjs.map +1 -1
- package/__cjs/link/utils/validateOperation.cjs +1 -1
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs +2 -2
- package/__cjs/masking/maskOperation.cjs +1 -1
- package/__cjs/masking/utils.cjs +1 -1
- package/__cjs/react/context/ApolloConsumer.cjs +1 -1
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +4 -4
- package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +3 -3
- package/__cjs/react/hooks/useSubscription.cjs +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -2
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +3 -3
- package/__cjs/react/internal/types.d.cts +2 -2
- package/__cjs/react/parser/index.cjs +5 -5
- package/__cjs/react/ssr/getDataFromTree.cjs +23 -60
- package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
- package/__cjs/react/ssr/getDataFromTree.d.cts +12 -6
- package/__cjs/react/ssr/index.cjs +3 -1
- package/__cjs/react/ssr/index.cjs.map +1 -1
- package/__cjs/react/ssr/index.d.cts +1 -0
- package/__cjs/react/ssr/prerenderStatic.cjs +151 -0
- package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -0
- package/__cjs/react/ssr/prerenderStatic.d.cts +122 -0
- package/__cjs/react/ssr/renderToStringWithData.cjs +11 -5
- package/__cjs/react/ssr/renderToStringWithData.cjs.map +1 -1
- package/__cjs/react/ssr/renderToStringWithData.d.cts +5 -0
- package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
- package/__cjs/react/ssr/useSSRQuery.d.cts +2 -2
- package/__cjs/testing/internal/index.cjs +3 -1
- package/__cjs/testing/internal/index.cjs.map +1 -1
- package/__cjs/testing/internal/index.d.cts +1 -0
- package/__cjs/testing/internal/resetApolloContext.cjs +24 -0
- package/__cjs/testing/internal/resetApolloContext.cjs.map +1 -0
- package/__cjs/testing/internal/resetApolloContext.d.cts +10 -0
- package/__cjs/utilities/internal/index.cjs +3 -1
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +1 -0
- package/__cjs/utilities/internal/toQueryResult.cjs +13 -0
- package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -0
- package/__cjs/utilities/internal/toQueryResult.d.cts +3 -0
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.d.cts +1 -1
- package/cache/core/cache.js +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/config/jest/areCombinedGraphQLErrorsEqual.js +3 -1
- package/config/jest/areCombinedGraphQLErrorsEqual.js.map +1 -1
- package/config/jest/setup.js +6 -0
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.d.ts +5 -5
- package/core/ApolloClient.js +9 -3
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts +6 -6
- package/core/ObservableQuery.js +15 -10
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.d.ts +4 -4
- package/core/QueryManager.js +35 -26
- package/core/QueryManager.js.map +1 -1
- package/core/types.d.ts +24 -2
- package/errors/CombinedGraphQLErrors.d.ts +7 -2
- package/errors/CombinedGraphQLErrors.js +8 -1
- package/errors/CombinedGraphQLErrors.js.map +1 -1
- package/invariantErrorCodes.js +110 -88
- package/link/core/ApolloLink.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/subscriptions/index.js +3 -1
- package/link/subscriptions/index.js.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/utils.js +1 -1
- package/package.json +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useLazyQuery.d.ts +4 -4
- package/react/hooks/useLazyQuery.js +2 -2
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useQuery.d.ts +3 -3
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +1 -1
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.d.ts +3 -3
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/types.d.ts +2 -2
- package/react/parser/index.js +5 -5
- package/react/ssr/getDataFromTree.d.ts +12 -6
- package/react/ssr/getDataFromTree.js +23 -59
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/ssr/index.d.ts +1 -0
- package/react/ssr/index.js +1 -0
- package/react/ssr/index.js.map +1 -1
- package/react/ssr/prerenderStatic.d.ts +122 -0
- package/react/ssr/prerenderStatic.js +147 -0
- package/react/ssr/prerenderStatic.js.map +1 -0
- package/react/ssr/renderToStringWithData.d.ts +5 -0
- package/react/ssr/renderToStringWithData.js +11 -5
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/ssr/useSSRQuery.d.ts +2 -2
- package/react/ssr/useSSRQuery.js.map +1 -1
- package/testing/internal/index.d.ts +1 -0
- package/testing/internal/index.js +2 -1
- package/testing/internal/index.js.map +1 -1
- package/testing/internal/resetApolloContext.d.ts +10 -0
- package/testing/internal/resetApolloContext.js +20 -0
- package/testing/internal/resetApolloContext.js.map +1 -0
- package/utilities/internal/index.d.ts +1 -0
- package/utilities/internal/index.js +2 -1
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/toQueryResult.d.ts +3 -0
- package/utilities/internal/toQueryResult.js +10 -0
- package/utilities/internal/toQueryResult.js.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/__cjs/utilities/types/TODO.cjs +0 -3
- package/__cjs/utilities/types/TODO.cjs.map +0 -1
- package/__cjs/utilities/types/TODO.d.cts +0 -3
- package/utilities/types/TODO.d.ts +0 -3
- package/utilities/types/TODO.js +0 -2
- 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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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)(
|
|
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,
|
|
106
|
-
(0, invariant_1.invariant)(fetchPolicy === "network-only" || fetchPolicy === "no-cache",
|
|
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(
|
|
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(
|
|
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, {
|
|
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((
|
|
494
|
-
...
|
|
491
|
+
.then((value) => ({
|
|
492
|
+
...value,
|
|
495
493
|
data: this.maskOperation({
|
|
496
494
|
document: query,
|
|
497
|
-
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)(
|
|
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(
|
|
610
|
+
__DEV__ && invariant_1.invariant.warn(78, queryName);
|
|
613
611
|
}
|
|
614
612
|
else {
|
|
615
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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
|