@apollo/client 3.10.3 → 3.10.4
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 +34 -0
- package/apollo-client.cjs +106 -99
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +81 -8
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +81 -8
- package/cache/core/cache.js +8 -4
- package/cache/core/cache.js.map +1 -1
- package/core/ApolloClient.js +2 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.js +1 -1
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js +7 -11
- package/core/QueryInfo.js.map +1 -1
- package/core/core.cjs +5 -7
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +5 -7
- package/dev/dev.cjs +32 -27
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +32 -27
- package/invariantErrorCodes.js +32 -26
- package/package.json +1 -1
- package/react/hooks/hooks.cjs +3 -0
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +3 -0
- package/react/hooks/useBackgroundQuery.d.ts +10 -13
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +2 -2
- package/react/hooks/useLoadableQuery.js +2 -1
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +3 -3
- package/react/hooks/useQueryRefHandlers.js +3 -2
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +2 -2
- package/react/hooks/useReadQuery.js +2 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +68 -6
- package/react/internal/cache/QueryReference.js +4 -0
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/index.d.ts +2 -2
- package/react/internal/index.js +1 -1
- package/react/internal/index.js.map +1 -1
- package/react/internal/internal.cjs +92 -0
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +92 -0
- 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/react/query-preloader/createQueryPreloader.d.ts +6 -6
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/types/types.d.ts +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +4 -4
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +4 -4
- package/testing/core/mocking/mockLink.js +5 -5
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/matchers/toBeDisposed.js +4 -13
- package/testing/matchers/toBeDisposed.js.map +1 -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.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- 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
|
@@ -22,7 +22,7 @@ function shouldInclude(_a, variables) {
|
|
|
22
22
|
if (ifArgument.value.kind === "Variable") {
|
|
23
23
|
evaledValue =
|
|
24
24
|
variables && variables[ifArgument.value.name.value];
|
|
25
|
-
globals.invariant(evaledValue !== void 0,
|
|
25
|
+
globals.invariant(evaledValue !== void 0, 68, directive.name.value);
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
evaledValue = ifArgument.value.value;
|
|
@@ -72,12 +72,12 @@ function getInclusionDirectives(directives) {
|
|
|
72
72
|
return;
|
|
73
73
|
var directiveArguments = directive.arguments;
|
|
74
74
|
var directiveName = directive.name.value;
|
|
75
|
-
globals.invariant(directiveArguments && directiveArguments.length === 1,
|
|
75
|
+
globals.invariant(directiveArguments && directiveArguments.length === 1, 69, directiveName);
|
|
76
76
|
var ifArgument = directiveArguments[0];
|
|
77
|
-
globals.invariant(ifArgument.name && ifArgument.name.value === "if",
|
|
77
|
+
globals.invariant(ifArgument.name && ifArgument.name.value === "if", 70, directiveName);
|
|
78
78
|
var ifValue = ifArgument.value;
|
|
79
79
|
globals.invariant(ifValue &&
|
|
80
|
-
(ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"),
|
|
80
|
+
(ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 71, directiveName);
|
|
81
81
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -110,7 +110,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
110
110
|
document.definitions.forEach(function (definition) {
|
|
111
111
|
if (definition.kind === "OperationDefinition") {
|
|
112
112
|
throw globals.newInvariantError(
|
|
113
|
-
|
|
113
|
+
72,
|
|
114
114
|
definition.operation,
|
|
115
115
|
definition.name ? " named '".concat(definition.name.value, "'") : ""
|
|
116
116
|
);
|
|
@@ -120,7 +120,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
if (typeof actualFragmentName === "undefined") {
|
|
123
|
-
globals.invariant(fragments.length === 1,
|
|
123
|
+
globals.invariant(fragments.length === 1, 73, fragments.length);
|
|
124
124
|
actualFragmentName = fragments[0].name.value;
|
|
125
125
|
}
|
|
126
126
|
var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
|
|
@@ -161,7 +161,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
161
161
|
return fragmentMap(fragmentName);
|
|
162
162
|
}
|
|
163
163
|
var fragment = fragmentMap && fragmentMap[fragmentName];
|
|
164
|
-
globals.invariant(fragment,
|
|
164
|
+
globals.invariant(fragment, 74, fragmentName);
|
|
165
165
|
return fragment || null;
|
|
166
166
|
}
|
|
167
167
|
default:
|
|
@@ -320,7 +320,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
320
320
|
argObj[name.value] = null;
|
|
321
321
|
}
|
|
322
322
|
else {
|
|
323
|
-
throw globals.newInvariantError(
|
|
323
|
+
throw globals.newInvariantError(83, name.value, value.kind);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
function storeKeyNameFromField(field, variables) {
|
|
@@ -454,16 +454,16 @@ function isInlineFragment(selection) {
|
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
function checkDocument(doc) {
|
|
457
|
-
globals.invariant(doc && doc.kind === "Document",
|
|
457
|
+
globals.invariant(doc && doc.kind === "Document", 75);
|
|
458
458
|
var operations = doc.definitions
|
|
459
459
|
.filter(function (d) { return d.kind !== "FragmentDefinition"; })
|
|
460
460
|
.map(function (definition) {
|
|
461
461
|
if (definition.kind !== "OperationDefinition") {
|
|
462
|
-
throw globals.newInvariantError(
|
|
462
|
+
throw globals.newInvariantError(76, definition.kind);
|
|
463
463
|
}
|
|
464
464
|
return definition;
|
|
465
465
|
});
|
|
466
|
-
globals.invariant(operations.length <= 1,
|
|
466
|
+
globals.invariant(operations.length <= 1, 77, operations.length);
|
|
467
467
|
return doc;
|
|
468
468
|
}
|
|
469
469
|
function getOperationDefinition(doc) {
|
|
@@ -486,14 +486,14 @@ function getFragmentDefinitions(doc) {
|
|
|
486
486
|
}
|
|
487
487
|
function getQueryDefinition(doc) {
|
|
488
488
|
var queryDef = getOperationDefinition(doc);
|
|
489
|
-
globals.invariant(queryDef && queryDef.operation === "query",
|
|
489
|
+
globals.invariant(queryDef && queryDef.operation === "query", 78);
|
|
490
490
|
return queryDef;
|
|
491
491
|
}
|
|
492
492
|
function getFragmentDefinition(doc) {
|
|
493
|
-
globals.invariant(doc.kind === "Document",
|
|
494
|
-
globals.invariant(doc.definitions.length <= 1,
|
|
493
|
+
globals.invariant(doc.kind === "Document", 79);
|
|
494
|
+
globals.invariant(doc.definitions.length <= 1, 80);
|
|
495
495
|
var fragmentDef = doc.definitions[0];
|
|
496
|
-
globals.invariant(fragmentDef.kind === "FragmentDefinition",
|
|
496
|
+
globals.invariant(fragmentDef.kind === "FragmentDefinition", 81);
|
|
497
497
|
return fragmentDef;
|
|
498
498
|
}
|
|
499
499
|
function getMainDefinition(queryDoc) {
|
|
@@ -516,7 +516,7 @@ function getMainDefinition(queryDoc) {
|
|
|
516
516
|
if (fragmentDefinition) {
|
|
517
517
|
return fragmentDefinition;
|
|
518
518
|
}
|
|
519
|
-
throw globals.newInvariantError(
|
|
519
|
+
throw globals.newInvariantError(82);
|
|
520
520
|
}
|
|
521
521
|
function getDefaultValues(definition) {
|
|
522
522
|
var defaultValues = Object.create(null);
|
|
@@ -567,7 +567,7 @@ var DocumentTransform = (function () {
|
|
|
567
567
|
makeCacheKey: function (document) {
|
|
568
568
|
var cacheKeys = _this.getCacheKey(document);
|
|
569
569
|
if (cacheKeys) {
|
|
570
|
-
globals.invariant(Array.isArray(cacheKeys),
|
|
570
|
+
globals.invariant(Array.isArray(cacheKeys), 67);
|
|
571
571
|
return stableCacheKeys_1.lookupArray(cacheKeys);
|
|
572
572
|
}
|
|
573
573
|
},
|
|
@@ -697,7 +697,7 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
697
697
|
return getInUseByFragmentName(ancestor.name.value);
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
-
globalThis.__DEV__ !== false && globals.invariant.error(
|
|
700
|
+
globalThis.__DEV__ !== false && globals.invariant.error(84);
|
|
701
701
|
return null;
|
|
702
702
|
};
|
|
703
703
|
var operationCount = 0;
|
|
@@ -887,7 +887,7 @@ var connectionRemoveConfig = {
|
|
|
887
887
|
if (willRemove) {
|
|
888
888
|
if (!directive.arguments ||
|
|
889
889
|
!directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
|
|
890
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
890
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(85);
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
return willRemove;
|
package/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = "3.10.
|
|
1
|
+
export var version = "3.10.4";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|