@apollo/client 4.0.10 → 4.0.11
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/CHANGELOG.md +13 -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/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +16 -1
- package/__cjs/core/ObservableQuery.cjs +18 -7
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +1 -0
- package/__cjs/core/QueryManager.cjs +13 -13
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/invariantErrorCodes.cjs +39 -33
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +1 -0
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.cjs +7 -4
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -0
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/utilities/internal/constants.cjs +13 -0
- package/__cjs/utilities/internal/constants.cjs.map +1 -0
- package/__cjs/utilities/internal/constants.d.cts +10 -0
- package/__cjs/utilities/internal/index.cjs +4 -2
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +1 -0
- package/__cjs/version.cjs +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/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.d.ts +16 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +1 -0
- package/core/ObservableQuery.js +19 -8
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +13 -13
- package/core/QueryManager.js.map +1 -1
- package/invariantErrorCodes.js +39 -33
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useLazyQuery.js +2 -1
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useQuery.js +8 -5
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSuspenseQuery.js +2 -0
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.js +2 -1
- package/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/react/hooks-compiled/useQuery.js +9 -5
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useSuspenseQuery.js +3 -1
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/utilities/internal/constants.d.ts +10 -0
- package/utilities/internal/constants.js +10 -0
- package/utilities/internal/constants.js.map +1 -0
- package/utilities/internal/index.d.ts +1 -0
- package/utilities/internal/index.js +1 -0
- package/utilities/internal/index.js.map +1 -1
- package/version.js +1 -1
|
@@ -258,6 +258,7 @@ export declare namespace ObservableQuery {
|
|
|
258
258
|
export declare class ObservableQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables> implements Subscribable<ObservableQuery.Result<MaybeMasked<TData>>>, InteropObservable<ObservableQuery.Result<MaybeMasked<TData>>> {
|
|
259
259
|
readonly options: ObservableQuery.Options<TData, TVariables>;
|
|
260
260
|
readonly queryName?: string;
|
|
261
|
+
private variablesUnknown;
|
|
261
262
|
/**
|
|
262
263
|
* @internal will be read and written from `QueryInfo`
|
|
263
264
|
*
|
|
@@ -99,7 +99,7 @@ class QueryManager {
|
|
|
99
99
|
*/
|
|
100
100
|
stop() {
|
|
101
101
|
this.obsQueries.forEach((oq) => oq.stop());
|
|
102
|
-
this.cancelPendingFetches((0, invariant_1.newInvariantError)(
|
|
102
|
+
this.cancelPendingFetches((0, invariant_1.newInvariantError)(84));
|
|
103
103
|
}
|
|
104
104
|
cancelPendingFetches(error) {
|
|
105
105
|
this.fetchCancelFns.forEach((cancel) => cancel(error));
|
|
@@ -114,7 +114,7 @@ class QueryManager {
|
|
|
114
114
|
if (environment_1.__DEV__) {
|
|
115
115
|
(0, invariant_1.invariant)(
|
|
116
116
|
this.localState,
|
|
117
|
-
|
|
117
|
+
85,
|
|
118
118
|
(0, internal_1.getOperationName)(mutation, "(anonymous)")
|
|
119
119
|
);
|
|
120
120
|
}
|
|
@@ -353,7 +353,7 @@ class QueryManager {
|
|
|
353
353
|
// depend on values that previously existed in the data portion of the
|
|
354
354
|
// store. So, we cancel the promises and observers that we have issued
|
|
355
355
|
// so far and not yet resolved (in the case of queries).
|
|
356
|
-
this.cancelPendingFetches((0, invariant_1.newInvariantError)(
|
|
356
|
+
this.cancelPendingFetches((0, invariant_1.newInvariantError)(86));
|
|
357
357
|
this.obsQueries.forEach((observableQuery) => {
|
|
358
358
|
// Set loading to true so listeners don't trigger unless they want
|
|
359
359
|
// results with partial data.
|
|
@@ -423,10 +423,10 @@ class QueryManager {
|
|
|
423
423
|
if (!included) {
|
|
424
424
|
const queryName = queryNames.get(nameOrQueryString);
|
|
425
425
|
if (queryName) {
|
|
426
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
426
|
+
__DEV__ && invariant_1.invariant.warn(87, queryName);
|
|
427
427
|
}
|
|
428
428
|
else {
|
|
429
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
429
|
+
__DEV__ && invariant_1.invariant.warn(88);
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
});
|
|
@@ -455,7 +455,7 @@ class QueryManager {
|
|
|
455
455
|
if (environment_1.__DEV__) {
|
|
456
456
|
(0, invariant_1.invariant)(
|
|
457
457
|
!this.getDocumentInfo(query).hasClientExports || this.localState,
|
|
458
|
-
|
|
458
|
+
89,
|
|
459
459
|
(0, internal_1.getOperationName)(query, "(anonymous)")
|
|
460
460
|
);
|
|
461
461
|
}
|
|
@@ -599,14 +599,14 @@ class QueryManager {
|
|
|
599
599
|
if (environment_1.__DEV__) {
|
|
600
600
|
(0, invariant_1.invariant)(
|
|
601
601
|
this.localState,
|
|
602
|
-
|
|
602
|
+
90,
|
|
603
603
|
operation[0].toUpperCase() + operation.slice(1),
|
|
604
604
|
operationName ?? "(anonymous)"
|
|
605
605
|
);
|
|
606
606
|
}
|
|
607
607
|
(0, invariant_1.invariant)(
|
|
608
608
|
!hasIncrementalDirective,
|
|
609
|
-
|
|
609
|
+
91,
|
|
610
610
|
operation[0].toUpperCase() + operation.slice(1),
|
|
611
611
|
operationName ?? "(anonymous)"
|
|
612
612
|
);
|
|
@@ -775,7 +775,7 @@ class QueryManager {
|
|
|
775
775
|
if (environment_1.__DEV__) {
|
|
776
776
|
(0, invariant_1.invariant)(
|
|
777
777
|
this.localState,
|
|
778
|
-
|
|
778
|
+
92,
|
|
779
779
|
(0, internal_1.getOperationName)(normalized.query, "(anonymous)")
|
|
780
780
|
);
|
|
781
781
|
}
|
|
@@ -812,7 +812,7 @@ class QueryManager {
|
|
|
812
812
|
const includedQueriesByOq = new Map();
|
|
813
813
|
if (include) {
|
|
814
814
|
this.getObservableQueries(include).forEach((oq) => {
|
|
815
|
-
if (oq.options.fetchPolicy === "cache-only") {
|
|
815
|
+
if (oq.options.fetchPolicy === "cache-only" || oq["variablesUnknown"]) {
|
|
816
816
|
return;
|
|
817
817
|
}
|
|
818
818
|
const current = oq.getCurrentResult();
|
|
@@ -951,7 +951,7 @@ class QueryManager {
|
|
|
951
951
|
!this.noCacheWarningsByCause.has(cause)) {
|
|
952
952
|
this.noCacheWarningsByCause.add(cause);
|
|
953
953
|
__DEV__ && invariant_1.invariant.warn(
|
|
954
|
-
|
|
954
|
+
93,
|
|
955
955
|
(0, internal_1.getOperationName)(document, `Unnamed ${operationType ?? "operation"}`)
|
|
956
956
|
);
|
|
957
957
|
}
|
|
@@ -1013,7 +1013,7 @@ class QueryManager {
|
|
|
1013
1013
|
if (environment_1.__DEV__) {
|
|
1014
1014
|
(0, invariant_1.invariant)(
|
|
1015
1015
|
this.localState,
|
|
1016
|
-
|
|
1016
|
+
94,
|
|
1017
1017
|
(0, internal_1.getOperationName)(query, "(anonymous)")
|
|
1018
1018
|
);
|
|
1019
1019
|
}
|
|
@@ -1107,7 +1107,7 @@ function validateDidEmitValue() {
|
|
|
1107
1107
|
didEmitValue = true;
|
|
1108
1108
|
},
|
|
1109
1109
|
complete() {
|
|
1110
|
-
(0, invariant_1.invariant)(didEmitValue,
|
|
1110
|
+
(0, invariant_1.invariant)(didEmitValue, 95);
|
|
1111
1111
|
},
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|