@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
package/core/QueryManager.js
CHANGED
|
@@ -92,7 +92,7 @@ export class QueryManager {
|
|
|
92
92
|
*/
|
|
93
93
|
stop() {
|
|
94
94
|
this.obsQueries.forEach((oq) => oq.stop());
|
|
95
|
-
this.cancelPendingFetches(newInvariantError(
|
|
95
|
+
this.cancelPendingFetches(newInvariantError(84));
|
|
96
96
|
}
|
|
97
97
|
cancelPendingFetches(error) {
|
|
98
98
|
this.fetchCancelFns.forEach((cancel) => cancel(error));
|
|
@@ -105,7 +105,7 @@ export class QueryManager {
|
|
|
105
105
|
variables = this.getVariables(mutation, variables);
|
|
106
106
|
if (hasClientExports) {
|
|
107
107
|
if (__DEV__) {
|
|
108
|
-
invariant(this.localState,
|
|
108
|
+
invariant(this.localState, 85, getOperationName(mutation, "(anonymous)"));
|
|
109
109
|
}
|
|
110
110
|
variables = await this.localState.getExportedVariables({
|
|
111
111
|
client: this.client,
|
|
@@ -342,7 +342,7 @@ export class QueryManager {
|
|
|
342
342
|
// depend on values that previously existed in the data portion of the
|
|
343
343
|
// store. So, we cancel the promises and observers that we have issued
|
|
344
344
|
// so far and not yet resolved (in the case of queries).
|
|
345
|
-
this.cancelPendingFetches(newInvariantError(
|
|
345
|
+
this.cancelPendingFetches(newInvariantError(86));
|
|
346
346
|
this.obsQueries.forEach((observableQuery) => {
|
|
347
347
|
// Set loading to true so listeners don't trigger unless they want
|
|
348
348
|
// results with partial data.
|
|
@@ -412,10 +412,10 @@ export class QueryManager {
|
|
|
412
412
|
if (!included) {
|
|
413
413
|
const queryName = queryNames.get(nameOrQueryString);
|
|
414
414
|
if (queryName) {
|
|
415
|
-
__DEV__ && invariant.warn(
|
|
415
|
+
__DEV__ && invariant.warn(87, queryName);
|
|
416
416
|
}
|
|
417
417
|
else {
|
|
418
|
-
__DEV__ && invariant.warn(
|
|
418
|
+
__DEV__ && invariant.warn(88);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
});
|
|
@@ -444,7 +444,7 @@ export class QueryManager {
|
|
|
444
444
|
if (__DEV__) {
|
|
445
445
|
invariant(
|
|
446
446
|
!this.getDocumentInfo(query).hasClientExports || this.localState,
|
|
447
|
-
|
|
447
|
+
89,
|
|
448
448
|
getOperationName(query, "(anonymous)")
|
|
449
449
|
);
|
|
450
450
|
}
|
|
@@ -588,14 +588,14 @@ export class QueryManager {
|
|
|
588
588
|
if (__DEV__) {
|
|
589
589
|
invariant(
|
|
590
590
|
this.localState,
|
|
591
|
-
|
|
591
|
+
90,
|
|
592
592
|
operation[0].toUpperCase() + operation.slice(1),
|
|
593
593
|
operationName ?? "(anonymous)"
|
|
594
594
|
);
|
|
595
595
|
}
|
|
596
596
|
invariant(
|
|
597
597
|
!hasIncrementalDirective,
|
|
598
|
-
|
|
598
|
+
91,
|
|
599
599
|
operation[0].toUpperCase() + operation.slice(1),
|
|
600
600
|
operationName ?? "(anonymous)"
|
|
601
601
|
);
|
|
@@ -762,7 +762,7 @@ export class QueryManager {
|
|
|
762
762
|
// we deprecated and removed LocalState.
|
|
763
763
|
if (this.getDocumentInfo(normalized.query).hasClientExports) {
|
|
764
764
|
if (__DEV__) {
|
|
765
|
-
invariant(this.localState,
|
|
765
|
+
invariant(this.localState, 92, getOperationName(normalized.query, "(anonymous)"));
|
|
766
766
|
}
|
|
767
767
|
observable = from(this.localState.getExportedVariables({
|
|
768
768
|
client: this.client,
|
|
@@ -797,7 +797,7 @@ export class QueryManager {
|
|
|
797
797
|
const includedQueriesByOq = new Map();
|
|
798
798
|
if (include) {
|
|
799
799
|
this.getObservableQueries(include).forEach((oq) => {
|
|
800
|
-
if (oq.options.fetchPolicy === "cache-only") {
|
|
800
|
+
if (oq.options.fetchPolicy === "cache-only" || oq["variablesUnknown"]) {
|
|
801
801
|
return;
|
|
802
802
|
}
|
|
803
803
|
const current = oq.getCurrentResult();
|
|
@@ -935,7 +935,7 @@ export class QueryManager {
|
|
|
935
935
|
!isFullyUnmaskedOperation(document) &&
|
|
936
936
|
!this.noCacheWarningsByCause.has(cause)) {
|
|
937
937
|
this.noCacheWarningsByCause.add(cause);
|
|
938
|
-
__DEV__ && invariant.warn(
|
|
938
|
+
__DEV__ && invariant.warn(93, getOperationName(document, `Unnamed ${operationType ?? "operation"}`));
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
return (this.dataMasking ?
|
|
@@ -993,7 +993,7 @@ export class QueryManager {
|
|
|
993
993
|
(diff.complete || returnPartialData) &&
|
|
994
994
|
this.getDocumentInfo(query).hasForcedResolvers) {
|
|
995
995
|
if (__DEV__) {
|
|
996
|
-
invariant(this.localState,
|
|
996
|
+
invariant(this.localState, 94, getOperationName(query, "(anonymous)"));
|
|
997
997
|
}
|
|
998
998
|
onCacheHit();
|
|
999
999
|
return from(this.localState.execute({
|
|
@@ -1084,7 +1084,7 @@ function validateDidEmitValue() {
|
|
|
1084
1084
|
didEmitValue = true;
|
|
1085
1085
|
},
|
|
1086
1086
|
complete() {
|
|
1087
|
-
invariant(didEmitValue,
|
|
1087
|
+
invariant(didEmitValue, 95);
|
|
1088
1088
|
},
|
|
1089
1089
|
});
|
|
1090
1090
|
}
|