@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.
- package/CHANGELOG.md +12 -0
- package/__cjs/cache/core/cache.cjs +25 -1
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +19 -1
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/inMemoryCache.cjs +10 -0
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +5 -1
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +5 -5
- package/__cjs/cache/inmemory/readFromStore.cjs +3 -3
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ApolloClient.cjs +14 -14
- package/__cjs/core/ObservableQuery.cjs +8 -8
- package/__cjs/core/QueryInfo.cjs +1 -1
- package/__cjs/core/QueryManager.cjs +23 -13
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/RefetchEventManager.cjs +3 -3
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs +1 -1
- package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
- package/__cjs/invariantErrorCodes.cjs +122 -116
- package/__cjs/link/core/ApolloLink.cjs +3 -3
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +2 -2
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/ws/index.cjs +1 -1
- package/__cjs/local-state/LocalState.cjs +11 -11
- 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 +3 -3
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
- package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
- package/__cjs/react/hooks/useSubscription.cjs +1 -1
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
- package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
- package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
- package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
- package/__cjs/utilities/internal/capitalize.cjs +12 -0
- package/__cjs/utilities/internal/capitalize.cjs.map +1 -0
- package/__cjs/utilities/internal/capitalize.d.cts +7 -0
- package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs +69 -0
- package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs.map +1 -0
- package/__cjs/utilities/internal/coerceScalarFieldsToParsed.d.cts +9 -0
- package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
- package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
- package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
- package/__cjs/utilities/internal/index.cjs +6 -2
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +2 -0
- package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
- package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
- package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.d.ts +19 -1
- package/cache/core/cache.js +26 -2
- package/cache/core/cache.js.map +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/inMemoryCache.d.ts +5 -1
- package/cache/inmemory/inMemoryCache.js +10 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +5 -5
- package/cache/inmemory/readFromStore.js +3 -3
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.js +14 -14
- package/core/ObservableQuery.js +8 -8
- package/core/QueryInfo.js +1 -1
- package/core/QueryManager.js +24 -14
- package/core/QueryManager.js.map +1 -1
- package/core/RefetchEventManager.js +3 -3
- package/incremental/handlers/graphql17Alpha9.js +1 -1
- package/incremental/handlers/notImplemented.js +1 -1
- package/invariantErrorCodes.js +122 -116
- package/link/core/ApolloLink.js +3 -3
- package/link/http/checkFetcher.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +2 -2
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/ws/index.js +1 -1
- package/local-state/LocalState.js +11 -11
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/utils.js +3 -3
- package/package.json +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useLazyQuery.js +2 -2
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useSubscription.js +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +2 -2
- package/react/hooks-compiled/useApolloClient.js +1 -1
- package/react/hooks-compiled/useLazyQuery.js +2 -2
- package/react/hooks-compiled/useLoadableQuery.js +2 -2
- package/react/hooks-compiled/useSubscription.js +1 -1
- package/react/hooks-compiled/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/ssr/prerenderStatic.js +2 -2
- package/testing/core/mocking/mockLink.js +4 -4
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/internal/capitalize.d.ts +7 -0
- package/utilities/internal/capitalize.js +9 -0
- package/utilities/internal/capitalize.js.map +1 -0
- package/utilities/internal/coerceScalarFieldsToParsed.d.ts +9 -0
- package/utilities/internal/coerceScalarFieldsToParsed.js +66 -0
- package/utilities/internal/coerceScalarFieldsToParsed.js.map +1 -0
- package/utilities/internal/getFragmentDefinition.js +3 -3
- package/utilities/internal/getFragmentFromSelection.js +1 -1
- package/utilities/internal/getFragmentFromSelection.js.map +1 -1
- package/utilities/internal/getFragmentQueryDocument.js +2 -2
- package/utilities/internal/getMainDefinition.js +1 -1
- package/utilities/internal/getQueryDefinition.js +1 -1
- package/utilities/internal/index.d.ts +2 -0
- package/utilities/internal/index.js +2 -0
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/removeDirectivesFromDocument.js +1 -1
- package/utilities/internal/shouldInclude.js +4 -4
- package/utilities/internal/valueToObjectRepresentation.js +1 -1
- package/version.js +1 -1
|
@@ -251,7 +251,7 @@ class Policies {
|
|
|
251
251
|
const rootId = "ROOT_" + which.toUpperCase();
|
|
252
252
|
const old = this.rootTypenamesById[rootId];
|
|
253
253
|
if (typename !== old) {
|
|
254
|
-
(0, invariant_1.invariant)(!old || old === which,
|
|
254
|
+
(0, invariant_1.invariant)(!old || old === which, 111, which);
|
|
255
255
|
// First, delete any old __typename associated with this rootId from
|
|
256
256
|
// rootIdsByTypename.
|
|
257
257
|
if (old)
|
|
@@ -394,7 +394,7 @@ class Policies {
|
|
|
394
394
|
if (supertypeSet.has(supertype)) {
|
|
395
395
|
if (!typenameSupertypeSet.has(supertype)) {
|
|
396
396
|
if (checkingFuzzySubtypes) {
|
|
397
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
397
|
+
__DEV__ && invariant_1.invariant.warn(112, typename, supertype);
|
|
398
398
|
}
|
|
399
399
|
// Record positive results for faster future lookup.
|
|
400
400
|
// Unfortunately, we cannot safely cache negative results,
|
|
@@ -651,7 +651,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
if (environment_1.__DEV__ && options.from === void 0) {
|
|
654
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
654
|
+
__DEV__ && invariant_1.invariant.warn(113, (0, internal_2.stringifyForDisplay)(Array.from(readFieldArgs)));
|
|
655
655
|
}
|
|
656
656
|
if (void 0 === options.variables) {
|
|
657
657
|
options.variables = variables;
|
|
@@ -661,7 +661,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
|
|
|
661
661
|
function makeMergeObjectsFunction(store) {
|
|
662
662
|
return function mergeObjects(existing, incoming) {
|
|
663
663
|
if ((0, internal_2.isArray)(existing) || (0, internal_2.isArray)(incoming)) {
|
|
664
|
-
throw (0, invariant_1.newInvariantError)(
|
|
664
|
+
throw (0, invariant_1.newInvariantError)(114);
|
|
665
665
|
}
|
|
666
666
|
// These dynamic checks are necessary because the parameters of a
|
|
667
667
|
// custom merge function can easily have the any type, so the type
|
|
@@ -698,6 +698,6 @@ function makeMergeObjectsFunction(store) {
|
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
700
|
function warnAboutScalarConfig(typename, fieldName, scalar, kind) {
|
|
701
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
701
|
+
__DEV__ && invariant_1.invariant.warn(115, `${typename}.${fieldName}`, scalar, kind);
|
|
702
702
|
}
|
|
703
703
|
//# sourceMappingURL=policies.cjs.map
|
|
@@ -289,7 +289,7 @@ class StoreReader {
|
|
|
289
289
|
if (typename) {
|
|
290
290
|
const policy = policies["getFieldPolicy"](typename, fieldName);
|
|
291
291
|
if (policy?.scalar) {
|
|
292
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
292
|
+
__DEV__ && invariant_1.invariant.warn(116, `${typename}.${fieldName}`, policy.scalar);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
}
|
|
@@ -326,7 +326,7 @@ class StoreReader {
|
|
|
326
326
|
else {
|
|
327
327
|
const fragment = (0, internal_1.getFragmentFromSelection)(selection, context.lookupFragment);
|
|
328
328
|
if (!fragment && selection.kind === graphql_1.Kind.FRAGMENT_SPREAD) {
|
|
329
|
-
throw (0, invariant_1.newInvariantError)(
|
|
329
|
+
throw (0, invariant_1.newInvariantError)(117, selection.name.value);
|
|
330
330
|
}
|
|
331
331
|
if (fragment && policies.fragmentMatches(fragment, typename)) {
|
|
332
332
|
const isDeferBoundary = (0, internal_1.isDeferredFragment)(selection, context.variables);
|
|
@@ -624,7 +624,7 @@ function assertSelectionSetForIdValue(store, field, fieldValue) {
|
|
|
624
624
|
if ((0, internal_1.isNonNullObject)(value)) {
|
|
625
625
|
(0, invariant_1.invariant)(
|
|
626
626
|
!(0, utilities_1.isReference)(value),
|
|
627
|
-
|
|
627
|
+
118,
|
|
628
628
|
(0, helpers_js_1.getTypenameFromStoreObject)(store, value),
|
|
629
629
|
field.name.value
|
|
630
630
|
);
|
|
@@ -75,7 +75,7 @@ class StoreWriter {
|
|
|
75
75
|
path: [],
|
|
76
76
|
});
|
|
77
77
|
if (!(0, utilities_1.isReference)(ref)) {
|
|
78
|
-
throw (0, invariant_1.newInvariantError)(
|
|
78
|
+
throw (0, invariant_1.newInvariantError)(119, result);
|
|
79
79
|
}
|
|
80
80
|
// So far, the store has not been modified, so now it's time to process
|
|
81
81
|
// context.incomingById and merge those incoming fields into context.store.
|
|
@@ -237,7 +237,7 @@ class StoreWriter {
|
|
|
237
237
|
// provide a default value, so its absence from the written data should
|
|
238
238
|
// not be cause for alarm.
|
|
239
239
|
!policies.getReadFunction(typename, field.name.value)) {
|
|
240
|
-
invariant_1.invariant.error(
|
|
240
|
+
invariant_1.invariant.error(120, (0, internal_1.resultKeyNameFromField)(field), result);
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
243
|
// Identify the result object, even if dataId was already provided,
|
|
@@ -385,7 +385,7 @@ class StoreWriter {
|
|
|
385
385
|
else {
|
|
386
386
|
const fragment = (0, internal_1.getFragmentFromSelection)(selection, context.lookupFragment);
|
|
387
387
|
if (!fragment && selection.kind === graphql_1.Kind.FRAGMENT_SPREAD) {
|
|
388
|
-
throw (0, invariant_1.newInvariantError)(
|
|
388
|
+
throw (0, invariant_1.newInvariantError)(121, selection.name.value);
|
|
389
389
|
}
|
|
390
390
|
if (fragment &&
|
|
391
391
|
policies.fragmentMatches(fragment, typename, result, context.variables)) {
|
|
@@ -558,7 +558,7 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
|
|
|
558
558
|
}
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
561
|
+
__DEV__ && invariant_1.invariant.warn(122, fieldName, parentType, childTypenames.length ?
|
|
562
562
|
"either ensure all objects of type " +
|
|
563
563
|
childTypenames.join(" and ") +
|
|
564
564
|
" have an ID or a custom merge function, or "
|
|
@@ -78,8 +78,8 @@ class ApolloClient {
|
|
|
78
78
|
*/
|
|
79
79
|
constructor(options) {
|
|
80
80
|
if (environment_1.__DEV__) {
|
|
81
|
-
(0, invariant_1.invariant)(options.cache,
|
|
82
|
-
(0, invariant_1.invariant)(options.link,
|
|
81
|
+
(0, invariant_1.invariant)(options.cache, 69);
|
|
82
|
+
(0, invariant_1.invariant)(options.link, 70);
|
|
83
83
|
}
|
|
84
84
|
const { cache, documentTransform, ssrMode = false, ssrForceFetchDelay = 0, queryDeduplication = true, defaultOptions, defaultContext, assumeImmutableResults = cache.assumeImmutableResults, localState, devtools, dataMasking, link, incrementalHandler = new incremental_1.NotImplementedHandler(), experiments = [], refetchEventManager, } = options;
|
|
85
85
|
this.link = link;
|
|
@@ -267,12 +267,12 @@ class ApolloClient {
|
|
|
267
267
|
if (refetchOn) {
|
|
268
268
|
const operationName = (0, internal_1.getOperationName)(query, "(anonymous)");
|
|
269
269
|
if (!refetchEventManager) {
|
|
270
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
270
|
+
__DEV__ && invariant_1.invariant.warn(71, operationName);
|
|
271
271
|
}
|
|
272
272
|
else if (typeof refetchOn === "object") {
|
|
273
273
|
Object.keys(refetchOn).forEach((source) => {
|
|
274
274
|
if (!refetchEventManager.hasSource(source)) {
|
|
275
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
275
|
+
__DEV__ && invariant_1.invariant.warn(72, source, operationName);
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
278
|
}
|
|
@@ -294,13 +294,13 @@ class ApolloClient {
|
|
|
294
294
|
options = (0, internal_1.mergeOptions)(this.defaultOptions.query, options);
|
|
295
295
|
}
|
|
296
296
|
if (environment_1.__DEV__) {
|
|
297
|
-
(0, invariant_1.invariant)(options.fetchPolicy !== "cache-and-network",
|
|
298
|
-
(0, invariant_1.invariant)(options.fetchPolicy !== "standby",
|
|
299
|
-
(0, invariant_1.invariant)(options.query,
|
|
300
|
-
(0, invariant_1.invariant)(options.query.kind === "Document",
|
|
301
|
-
(0, invariant_1.invariant)(!options.returnPartialData,
|
|
302
|
-
(0, invariant_1.invariant)(!options.pollInterval,
|
|
303
|
-
(0, invariant_1.invariant)(!options.notifyOnNetworkStatusChange,
|
|
297
|
+
(0, invariant_1.invariant)(options.fetchPolicy !== "cache-and-network", 73);
|
|
298
|
+
(0, invariant_1.invariant)(options.fetchPolicy !== "standby", 74);
|
|
299
|
+
(0, invariant_1.invariant)(options.query, 75);
|
|
300
|
+
(0, invariant_1.invariant)(options.query.kind === "Document", 76);
|
|
301
|
+
(0, invariant_1.invariant)(!options.returnPartialData, 77);
|
|
302
|
+
(0, invariant_1.invariant)(!options.pollInterval, 78);
|
|
303
|
+
(0, invariant_1.invariant)(!options.notifyOnNetworkStatusChange, 79);
|
|
304
304
|
}
|
|
305
305
|
return this.queryManager.query(options);
|
|
306
306
|
};
|
|
@@ -318,9 +318,9 @@ class ApolloClient {
|
|
|
318
318
|
errorPolicy: "none",
|
|
319
319
|
}, this.defaultOptions.mutate), options);
|
|
320
320
|
if (environment_1.__DEV__) {
|
|
321
|
-
(0, invariant_1.invariant)(optionsWithDefaults.mutation,
|
|
321
|
+
(0, invariant_1.invariant)(optionsWithDefaults.mutation, 80);
|
|
322
322
|
(0, invariant_1.invariant)(optionsWithDefaults.fetchPolicy === "network-only" ||
|
|
323
|
-
optionsWithDefaults.fetchPolicy === "no-cache",
|
|
323
|
+
optionsWithDefaults.fetchPolicy === "no-cache", 81);
|
|
324
324
|
}
|
|
325
325
|
(0, internal_1.checkDocument)(optionsWithDefaults.mutation, graphql_1.OperationTypeNode.MUTATION);
|
|
326
326
|
return this.queryManager.mutate(optionsWithDefaults);
|
|
@@ -526,7 +526,7 @@ class ApolloClient {
|
|
|
526
526
|
// result.queries and result.results instead, you shouldn't have to worry
|
|
527
527
|
// about preventing uncaught rejections for the Promise.all result.
|
|
528
528
|
result.catch((error) => {
|
|
529
|
-
__DEV__ && invariant_1.invariant.debug(
|
|
529
|
+
__DEV__ && invariant_1.invariant.debug(82, error);
|
|
530
530
|
});
|
|
531
531
|
return result;
|
|
532
532
|
}
|
|
@@ -110,7 +110,7 @@ class ObservableQuery {
|
|
|
110
110
|
// Make sure we don't store "standby" as the initialFetchPolicy.
|
|
111
111
|
initialFetchPolicy = fetchPolicy === "standby" ? defaultFetchPolicy : (fetchPolicy), } = options;
|
|
112
112
|
if (options[internal_1.variablesUnknownSymbol]) {
|
|
113
|
-
(0, invariant_1.invariant)(fetchPolicy === "standby",
|
|
113
|
+
(0, invariant_1.invariant)(fetchPolicy === "standby", 83);
|
|
114
114
|
this.variablesUnknown = true;
|
|
115
115
|
}
|
|
116
116
|
this.lastQuery = transformedQuery;
|
|
@@ -419,7 +419,7 @@ class ObservableQuery {
|
|
|
419
419
|
const queryDef = (0, internal_1.getQueryDefinition)(this.query);
|
|
420
420
|
const vars = queryDef.variableDefinitions;
|
|
421
421
|
if (!vars || !vars.some((v) => v.variable.name.value === "variables")) {
|
|
422
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
422
|
+
__DEV__ && invariant_1.invariant.warn(84, variables, queryDef.name?.value || queryDef);
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
if (variables && !(0, equality_1.equal)(this.variables, variables)) {
|
|
@@ -434,7 +434,7 @@ class ObservableQuery {
|
|
|
434
434
|
fetchMore({ query, variables, context, errorPolicy, updateQuery, }) {
|
|
435
435
|
(0, invariant_1.invariant)(
|
|
436
436
|
this.options.fetchPolicy !== "cache-only",
|
|
437
|
-
|
|
437
|
+
85,
|
|
438
438
|
(0, internal_1.getOperationName)(this.query, "(anonymous)")
|
|
439
439
|
);
|
|
440
440
|
const combinedOptions = {
|
|
@@ -468,7 +468,7 @@ class ObservableQuery {
|
|
|
468
468
|
let wasUpdated = false;
|
|
469
469
|
const isCached = this.options.fetchPolicy !== "no-cache";
|
|
470
470
|
if (!isCached) {
|
|
471
|
-
(0, invariant_1.invariant)(updateQuery,
|
|
471
|
+
(0, invariant_1.invariant)(updateQuery, 86);
|
|
472
472
|
}
|
|
473
473
|
const { finalize, pushNotification } = this.pushOperation(networkStatus_js_1.NetworkStatus.fetchMore);
|
|
474
474
|
pushNotification({
|
|
@@ -642,7 +642,7 @@ class ObservableQuery {
|
|
|
642
642
|
onError(error);
|
|
643
643
|
}
|
|
644
644
|
else {
|
|
645
|
-
invariant_1.invariant.error(
|
|
645
|
+
invariant_1.invariant.error(87, error);
|
|
646
646
|
}
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
@@ -893,7 +893,7 @@ class ObservableQuery {
|
|
|
893
893
|
if (!this.didWarnCacheOnlyPolling &&
|
|
894
894
|
pollInterval &&
|
|
895
895
|
fetchPolicy === "cache-only") {
|
|
896
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
896
|
+
__DEV__ && invariant_1.invariant.warn(88, (0, internal_1.getOperationName)(this.query, "(anonymous)"));
|
|
897
897
|
this.didWarnCacheOnlyPolling = true;
|
|
898
898
|
}
|
|
899
899
|
}
|
|
@@ -1520,7 +1520,7 @@ class ObservableQuery {
|
|
|
1520
1520
|
exports.ObservableQuery = ObservableQuery;
|
|
1521
1521
|
function logMissingFieldErrors(missing) {
|
|
1522
1522
|
if (environment_1.__DEV__ && missing) {
|
|
1523
|
-
__DEV__ && invariant_1.invariant.debug(
|
|
1523
|
+
__DEV__ && invariant_1.invariant.debug(89, missing);
|
|
1524
1524
|
}
|
|
1525
1525
|
}
|
|
1526
1526
|
function isEqualQuery(a, b) {
|
|
@@ -1565,7 +1565,7 @@ function getTrackingOperatorPromise(defaultValue) {
|
|
|
1565
1565
|
}
|
|
1566
1566
|
function warnOnFeud(query, diff) {
|
|
1567
1567
|
__DEV__ && invariant_1.invariant.warn(
|
|
1568
|
-
|
|
1568
|
+
90,
|
|
1569
1569
|
(0, internal_1.getOperationName)(query, "(anonymous)"),
|
|
1570
1570
|
diff.missing?.missing
|
|
1571
1571
|
);
|
package/__cjs/core/QueryInfo.cjs
CHANGED
|
@@ -371,7 +371,7 @@ class QueryInfo {
|
|
|
371
371
|
exports.QueryInfo = QueryInfo;
|
|
372
372
|
function warnAboutPartialCacheResult(query, networkResult, diff) {
|
|
373
373
|
__DEV__ && invariant_1.invariant.warn(
|
|
374
|
-
|
|
374
|
+
91,
|
|
375
375
|
(0, internal_1.getOperationName)(query, "(anonymous)"),
|
|
376
376
|
diff.missing?.missing,
|
|
377
377
|
networkResult,
|
|
@@ -106,7 +106,7 @@ class QueryManager {
|
|
|
106
106
|
*/
|
|
107
107
|
stop() {
|
|
108
108
|
this.obsQueries.forEach((oq) => oq.stop());
|
|
109
|
-
this.cancelPendingFetches((0, invariant_1.newInvariantError)(
|
|
109
|
+
this.cancelPendingFetches((0, invariant_1.newInvariantError)(92));
|
|
110
110
|
}
|
|
111
111
|
cancelPendingFetches(error) {
|
|
112
112
|
this.fetchCancelFns.forEach((cancel) => cancel(error));
|
|
@@ -121,7 +121,7 @@ class QueryManager {
|
|
|
121
121
|
if (environment_1.__DEV__) {
|
|
122
122
|
(0, invariant_1.invariant)(
|
|
123
123
|
this.localState,
|
|
124
|
-
|
|
124
|
+
93,
|
|
125
125
|
(0, internal_1.getOperationName)(mutation, "(anonymous)")
|
|
126
126
|
);
|
|
127
127
|
}
|
|
@@ -356,7 +356,7 @@ class QueryManager {
|
|
|
356
356
|
// depend on values that previously existed in the data portion of the
|
|
357
357
|
// store. So, we cancel the promises and observers that we have issued
|
|
358
358
|
// so far and not yet resolved (in the case of queries).
|
|
359
|
-
this.cancelPendingFetches((0, invariant_1.newInvariantError)(
|
|
359
|
+
this.cancelPendingFetches((0, invariant_1.newInvariantError)(94));
|
|
360
360
|
this.obsQueries.forEach((observableQuery) => {
|
|
361
361
|
// Set loading to true so listeners don't trigger unless they want
|
|
362
362
|
// results with partial data.
|
|
@@ -426,10 +426,10 @@ class QueryManager {
|
|
|
426
426
|
if (!included) {
|
|
427
427
|
const queryName = queryNames.get(nameOrQueryString);
|
|
428
428
|
if (queryName) {
|
|
429
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
429
|
+
__DEV__ && invariant_1.invariant.warn(95, queryName);
|
|
430
430
|
}
|
|
431
431
|
else {
|
|
432
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
432
|
+
__DEV__ && invariant_1.invariant.warn(96);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
});
|
|
@@ -458,7 +458,7 @@ class QueryManager {
|
|
|
458
458
|
if (environment_1.__DEV__) {
|
|
459
459
|
(0, invariant_1.invariant)(
|
|
460
460
|
!this.getDocumentInfo(query).hasClientExports || this.localState,
|
|
461
|
-
|
|
461
|
+
97,
|
|
462
462
|
(0, internal_1.getOperationName)(query, "(anonymous)")
|
|
463
463
|
);
|
|
464
464
|
}
|
|
@@ -603,14 +603,14 @@ class QueryManager {
|
|
|
603
603
|
if (environment_1.__DEV__) {
|
|
604
604
|
(0, invariant_1.invariant)(
|
|
605
605
|
this.localState,
|
|
606
|
-
|
|
606
|
+
98,
|
|
607
607
|
operation[0].toUpperCase() + operation.slice(1),
|
|
608
608
|
operationName ?? "(anonymous)"
|
|
609
609
|
);
|
|
610
610
|
}
|
|
611
611
|
(0, invariant_1.invariant)(
|
|
612
612
|
!hasIncrementalDirective,
|
|
613
|
-
|
|
613
|
+
99,
|
|
614
614
|
operation[0].toUpperCase() + operation.slice(1),
|
|
615
615
|
operationName ?? "(anonymous)"
|
|
616
616
|
);
|
|
@@ -780,7 +780,7 @@ class QueryManager {
|
|
|
780
780
|
if (environment_1.__DEV__) {
|
|
781
781
|
(0, invariant_1.invariant)(
|
|
782
782
|
this.localState,
|
|
783
|
-
|
|
783
|
+
100,
|
|
784
784
|
(0, internal_1.getOperationName)(normalized.query, "(anonymous)")
|
|
785
785
|
);
|
|
786
786
|
}
|
|
@@ -956,7 +956,7 @@ class QueryManager {
|
|
|
956
956
|
!this.noCacheWarningsByCause.has(cause)) {
|
|
957
957
|
this.noCacheWarningsByCause.add(cause);
|
|
958
958
|
__DEV__ && invariant_1.invariant.warn(
|
|
959
|
-
|
|
959
|
+
101,
|
|
960
960
|
(0, internal_1.getOperationName)(document, `Unnamed ${operationType ?? "operation"}`)
|
|
961
961
|
);
|
|
962
962
|
}
|
|
@@ -1023,7 +1023,7 @@ class QueryManager {
|
|
|
1023
1023
|
if (environment_1.__DEV__) {
|
|
1024
1024
|
(0, invariant_1.invariant)(
|
|
1025
1025
|
this.localState,
|
|
1026
|
-
|
|
1026
|
+
102,
|
|
1027
1027
|
(0, internal_1.getOperationName)(query, "(anonymous)")
|
|
1028
1028
|
);
|
|
1029
1029
|
}
|
|
@@ -1123,7 +1123,17 @@ class QueryManager {
|
|
|
1123
1123
|
}),
|
|
1124
1124
|
};
|
|
1125
1125
|
case "no-cache":
|
|
1126
|
-
return {
|
|
1126
|
+
return {
|
|
1127
|
+
fromLink: true,
|
|
1128
|
+
observable: resultsFromLink().pipe((0, rxjs_2.map)((notification) => {
|
|
1129
|
+
if (notification.kind === "N" &&
|
|
1130
|
+
notification.value.data != null &&
|
|
1131
|
+
this.cache.configuresScalars()) {
|
|
1132
|
+
notification.value.data = (0, internal_1.coerceScalarFieldsToParsed)(notification.value.data, query, this.cache);
|
|
1133
|
+
}
|
|
1134
|
+
return notification;
|
|
1135
|
+
})),
|
|
1136
|
+
};
|
|
1127
1137
|
case "standby":
|
|
1128
1138
|
return { fromLink: false, observable: rxjs_2.EMPTY };
|
|
1129
1139
|
}
|
|
@@ -1137,7 +1147,7 @@ function validateDidEmitValue() {
|
|
|
1137
1147
|
didEmitValue = true;
|
|
1138
1148
|
},
|
|
1139
1149
|
complete() {
|
|
1140
|
-
(0, invariant_1.invariant)(didEmitValue,
|
|
1150
|
+
(0, invariant_1.invariant)(didEmitValue, 103);
|
|
1141
1151
|
},
|
|
1142
1152
|
});
|
|
1143
1153
|
}
|