@apollo/client 3.8.5 → 3.8.7
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/apollo-client.cjs +114 -74
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +46 -11
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +46 -11
- package/cache/core/types/common.d.ts +2 -2
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +35 -0
- package/cache/inmemory/entityStore.js.map +1 -1
- 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/core/ApolloClient.js +3 -3
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.js +5 -5
- package/core/QueryManager.js +9 -9
- package/core/core.cjs +20 -20
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +20 -20
- package/dev/dev.cjs +97 -82
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +97 -82
- package/dev/loadErrorMessageHandler.js +1 -1
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/invariantErrorCodes.js +95 -80
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/http.cjs +3 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +3 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs +2 -2
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
- package/link/utils/toPromise.js +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js +1 -1
- package/package.json +25 -25
- package/react/cache/QueryReference.d.ts.map +1 -1
- package/react/cache/QueryReference.js +7 -2
- package/react/cache/QueryReference.js.map +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/context/context.cjs +3 -3
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +3 -3
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +2 -2
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -2
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +15 -10
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +15 -10
- package/react/hooks/index.d.ts +1 -0
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useReadQuery.d.ts +7 -4
- package/react/hooks/useReadQuery.d.ts.map +1 -1
- package/react/hooks/useReadQuery.js +1 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +2 -2
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/parser/index.js +5 -5
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +5 -5
- package/testing/core/core.cjs +1 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +1 -1
- package/testing/core/mocking/mockLink.js +1 -1
- package/testing/react/MockedProvider.d.ts +1 -0
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +2 -1
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +2 -1
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +2 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.d.ts +5 -0
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/index.d.ts +1 -1
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js.map +1 -1
- package/utilities/utilities.cjs +19 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +19 -19
- package/version.js +1 -1
|
@@ -20,7 +20,7 @@ function shouldInclude(_a, variables) {
|
|
|
20
20
|
if (ifArgument.value.kind === "Variable") {
|
|
21
21
|
evaledValue =
|
|
22
22
|
variables && variables[ifArgument.value.name.value];
|
|
23
|
-
globals.invariant(evaledValue !== void 0,
|
|
23
|
+
globals.invariant(evaledValue !== void 0, 66, directive.name.value);
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
evaledValue = ifArgument.value.value;
|
|
@@ -70,12 +70,12 @@ function getInclusionDirectives(directives) {
|
|
|
70
70
|
return;
|
|
71
71
|
var directiveArguments = directive.arguments;
|
|
72
72
|
var directiveName = directive.name.value;
|
|
73
|
-
globals.invariant(directiveArguments && directiveArguments.length === 1,
|
|
73
|
+
globals.invariant(directiveArguments && directiveArguments.length === 1, 67, directiveName);
|
|
74
74
|
var ifArgument = directiveArguments[0];
|
|
75
|
-
globals.invariant(ifArgument.name && ifArgument.name.value === "if",
|
|
75
|
+
globals.invariant(ifArgument.name && ifArgument.name.value === "if", 68, directiveName);
|
|
76
76
|
var ifValue = ifArgument.value;
|
|
77
77
|
globals.invariant(ifValue &&
|
|
78
|
-
(ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"),
|
|
78
|
+
(ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 69, directiveName);
|
|
79
79
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -107,7 +107,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
107
107
|
document.definitions.forEach(function (definition) {
|
|
108
108
|
if (definition.kind === "OperationDefinition") {
|
|
109
109
|
throw globals.newInvariantError(
|
|
110
|
-
|
|
110
|
+
70,
|
|
111
111
|
definition.operation,
|
|
112
112
|
definition.name ? " named '".concat(definition.name.value, "'") : ""
|
|
113
113
|
);
|
|
@@ -117,7 +117,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
if (typeof actualFragmentName === "undefined") {
|
|
120
|
-
globals.invariant(fragments.length === 1,
|
|
120
|
+
globals.invariant(fragments.length === 1, 71, fragments.length);
|
|
121
121
|
actualFragmentName = fragments[0].name.value;
|
|
122
122
|
}
|
|
123
123
|
var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
|
|
@@ -158,7 +158,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
158
158
|
return fragmentMap(fragmentName);
|
|
159
159
|
}
|
|
160
160
|
var fragment = fragmentMap && fragmentMap[fragmentName];
|
|
161
|
-
globals.invariant(fragment,
|
|
161
|
+
globals.invariant(fragment, 72, fragmentName);
|
|
162
162
|
return fragment || null;
|
|
163
163
|
}
|
|
164
164
|
default:
|
|
@@ -236,7 +236,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
236
236
|
argObj[name.value] = null;
|
|
237
237
|
}
|
|
238
238
|
else {
|
|
239
|
-
throw globals.newInvariantError(
|
|
239
|
+
throw globals.newInvariantError(81, name.value, value.kind);
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
function storeKeyNameFromField(field, variables) {
|
|
@@ -383,16 +383,16 @@ function isInlineFragment(selection) {
|
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
function checkDocument(doc) {
|
|
386
|
-
globals.invariant(doc && doc.kind === "Document",
|
|
386
|
+
globals.invariant(doc && doc.kind === "Document", 73);
|
|
387
387
|
var operations = doc.definitions
|
|
388
388
|
.filter(function (d) { return d.kind !== "FragmentDefinition"; })
|
|
389
389
|
.map(function (definition) {
|
|
390
390
|
if (definition.kind !== "OperationDefinition") {
|
|
391
|
-
throw globals.newInvariantError(
|
|
391
|
+
throw globals.newInvariantError(74, definition.kind);
|
|
392
392
|
}
|
|
393
393
|
return definition;
|
|
394
394
|
});
|
|
395
|
-
globals.invariant(operations.length <= 1,
|
|
395
|
+
globals.invariant(operations.length <= 1, 75, operations.length);
|
|
396
396
|
return doc;
|
|
397
397
|
}
|
|
398
398
|
function getOperationDefinition(doc) {
|
|
@@ -415,14 +415,14 @@ function getFragmentDefinitions(doc) {
|
|
|
415
415
|
}
|
|
416
416
|
function getQueryDefinition(doc) {
|
|
417
417
|
var queryDef = getOperationDefinition(doc);
|
|
418
|
-
globals.invariant(queryDef && queryDef.operation === "query",
|
|
418
|
+
globals.invariant(queryDef && queryDef.operation === "query", 76);
|
|
419
419
|
return queryDef;
|
|
420
420
|
}
|
|
421
421
|
function getFragmentDefinition(doc) {
|
|
422
|
-
globals.invariant(doc.kind === "Document",
|
|
423
|
-
globals.invariant(doc.definitions.length <= 1,
|
|
422
|
+
globals.invariant(doc.kind === "Document", 77);
|
|
423
|
+
globals.invariant(doc.definitions.length <= 1, 78);
|
|
424
424
|
var fragmentDef = doc.definitions[0];
|
|
425
|
-
globals.invariant(fragmentDef.kind === "FragmentDefinition",
|
|
425
|
+
globals.invariant(fragmentDef.kind === "FragmentDefinition", 79);
|
|
426
426
|
return fragmentDef;
|
|
427
427
|
}
|
|
428
428
|
function getMainDefinition(queryDoc) {
|
|
@@ -445,7 +445,7 @@ function getMainDefinition(queryDoc) {
|
|
|
445
445
|
if (fragmentDefinition) {
|
|
446
446
|
return fragmentDefinition;
|
|
447
447
|
}
|
|
448
|
-
throw globals.newInvariantError(
|
|
448
|
+
throw globals.newInvariantError(80);
|
|
449
449
|
}
|
|
450
450
|
function getDefaultValues(definition) {
|
|
451
451
|
var defaultValues = Object.create(null);
|
|
@@ -517,7 +517,7 @@ var DocumentTransform = (function () {
|
|
|
517
517
|
return;
|
|
518
518
|
var cacheKeys = this.getCacheKey(document);
|
|
519
519
|
if (cacheKeys) {
|
|
520
|
-
globals.invariant(Array.isArray(cacheKeys),
|
|
520
|
+
globals.invariant(Array.isArray(cacheKeys), 65);
|
|
521
521
|
return this.stableCacheKeys.lookupArray(cacheKeys);
|
|
522
522
|
}
|
|
523
523
|
};
|
|
@@ -613,7 +613,7 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
613
613
|
return getInUseByFragmentName(ancestor.name.value);
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
globalThis.__DEV__ !== false && globals.invariant.error(
|
|
616
|
+
globalThis.__DEV__ !== false && globals.invariant.error(82);
|
|
617
617
|
return null;
|
|
618
618
|
};
|
|
619
619
|
var operationCount = 0;
|
|
@@ -800,7 +800,7 @@ var connectionRemoveConfig = {
|
|
|
800
800
|
if (willRemove) {
|
|
801
801
|
if (!directive.arguments ||
|
|
802
802
|
!directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
|
|
803
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
803
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(83);
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
806
|
return willRemove;
|
package/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = "3.8.
|
|
1
|
+
export var version = "3.8.7";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|