@apollo/client 3.14.0 → 3.14.1
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 +10 -0
- package/apollo-client.cjs +76 -72
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +14 -41
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +14 -41
- package/cache/core/cache.js +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/inmemory/inMemoryCache.js +1 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/core/ApolloClient.js +1 -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 +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +1 -1
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +29 -56
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +29 -56
- package/dev/dev.cjs +49 -53
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +49 -53
- package/invariantErrorCodes.js +48 -53
- package/link/core/ApolloLink.js +1 -1
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/core.cjs +1 -15
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +1 -15
- package/package.json +1 -1
- package/react/components/components.cjs +2 -14
- package/react/components/components.cjs.map +1 -1
- package/react/components/components.cjs.native.js +2 -14
- package/react/hoc/graphql.js +1 -1
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc.cjs +12 -31
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +12 -31
- package/react/hoc/mutation-hoc.js +1 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.js +1 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.js +1 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hooks/hooks.cjs +26 -52
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +26 -52
- package/react/hooks/internal/useWarnRemoved.d.ts +1 -1
- package/react/hooks/internal/useWarnRemoved.js +1 -1
- package/react/hooks/internal/useWarnRemoved.js.map +1 -1
- package/react/hooks/internal/useWarnRemovedOption.d.ts +2 -1
- package/react/hooks/internal/useWarnRemovedOption.js +7 -5
- package/react/hooks/internal/useWarnRemovedOption.js.map +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useBackgroundQuery.js +1 -1
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.js +1 -1
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.js +3 -3
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +3 -3
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useQuery.js +3 -3
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSuspenseQuery.js +3 -3
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +2 -2
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +3 -14
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +3 -14
- package/react/parser/index.js +7 -7
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +9 -29
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +9 -29
- package/react/query-preloader/createQueryPreloader.js +1 -1
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/react.cjs +4 -31
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +4 -31
- 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.d.ts +13 -0
- package/testing/core/mocking/mockLink.js +4 -4
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/internal/disposables/index.d.ts +1 -0
- package/testing/internal/disposables/index.js +1 -0
- package/testing/internal/disposables/index.js.map +1 -1
- package/testing/internal/disposables/withMutedDeprecations.d.ts +4 -0
- package/testing/internal/disposables/withMutedDeprecations.js +13 -0
- package/testing/internal/disposables/withMutedDeprecations.js.map +1 -0
- package/testing/react/MockedProvider.js +1 -1
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +5 -32
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +5 -32
- package/utilities/deprecation/index.d.ts +0 -3
- package/utilities/deprecation/index.js +4 -12
- package/utilities/deprecation/index.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 +7 -7
- 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/index.d.ts +2 -0
- package/utilities/index.js +1 -0
- package/utilities/index.js.map +1 -1
- package/utilities/utilities.cjs +54 -22
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +54 -22
- 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, 105, 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, 106, 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", 107, 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"), 108, directiveName);
|
|
81
81
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -99,13 +99,13 @@ function getFragmentMaskMode(fragment) {
|
|
|
99
99
|
if (globalThis.__DEV__ !== false) {
|
|
100
100
|
if (modeArg) {
|
|
101
101
|
if (modeArg.value.kind === graphql.Kind.VARIABLE) {
|
|
102
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
102
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(109);
|
|
103
103
|
}
|
|
104
104
|
else if (modeArg.value.kind !== graphql.Kind.STRING) {
|
|
105
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
105
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(110);
|
|
106
106
|
}
|
|
107
107
|
else if (modeArg.value.value !== "migrate") {
|
|
108
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
108
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(111, modeArg.value.value);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -144,7 +144,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
144
144
|
document.definitions.forEach(function (definition) {
|
|
145
145
|
if (definition.kind === "OperationDefinition") {
|
|
146
146
|
throw globals.newInvariantError(
|
|
147
|
-
|
|
147
|
+
112,
|
|
148
148
|
definition.operation,
|
|
149
149
|
definition.name ? " named '".concat(definition.name.value, "'") : ""
|
|
150
150
|
);
|
|
@@ -154,7 +154,7 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
if (typeof actualFragmentName === "undefined") {
|
|
157
|
-
globals.invariant(fragments.length === 1,
|
|
157
|
+
globals.invariant(fragments.length === 1, 113, fragments.length);
|
|
158
158
|
actualFragmentName = fragments[0].name.value;
|
|
159
159
|
}
|
|
160
160
|
var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
|
|
@@ -195,7 +195,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
195
195
|
return fragmentMap(fragmentName);
|
|
196
196
|
}
|
|
197
197
|
var fragment = fragmentMap && fragmentMap[fragmentName];
|
|
198
|
-
globals.invariant(fragment,
|
|
198
|
+
globals.invariant(fragment, 114, fragmentName);
|
|
199
199
|
return fragment || null;
|
|
200
200
|
}
|
|
201
201
|
default:
|
|
@@ -368,7 +368,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
368
368
|
argObj[name.value] = null;
|
|
369
369
|
}
|
|
370
370
|
else {
|
|
371
|
-
throw globals.newInvariantError(
|
|
371
|
+
throw globals.newInvariantError(123, name.value, value.kind);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
function storeKeyNameFromField(field, variables) {
|
|
@@ -502,16 +502,16 @@ function isInlineFragment(selection) {
|
|
|
502
502
|
}
|
|
503
503
|
|
|
504
504
|
function checkDocument(doc) {
|
|
505
|
-
globals.invariant(doc && doc.kind === "Document",
|
|
505
|
+
globals.invariant(doc && doc.kind === "Document", 115);
|
|
506
506
|
var operations = doc.definitions
|
|
507
507
|
.filter(function (d) { return d.kind !== "FragmentDefinition"; })
|
|
508
508
|
.map(function (definition) {
|
|
509
509
|
if (definition.kind !== "OperationDefinition") {
|
|
510
|
-
throw globals.newInvariantError(
|
|
510
|
+
throw globals.newInvariantError(116, definition.kind);
|
|
511
511
|
}
|
|
512
512
|
return definition;
|
|
513
513
|
});
|
|
514
|
-
globals.invariant(operations.length <= 1,
|
|
514
|
+
globals.invariant(operations.length <= 1, 117, operations.length);
|
|
515
515
|
return doc;
|
|
516
516
|
}
|
|
517
517
|
function getOperationDefinition(doc) {
|
|
@@ -534,14 +534,14 @@ function getFragmentDefinitions(doc) {
|
|
|
534
534
|
}
|
|
535
535
|
function getQueryDefinition(doc) {
|
|
536
536
|
var queryDef = getOperationDefinition(doc);
|
|
537
|
-
globals.invariant(queryDef && queryDef.operation === "query",
|
|
537
|
+
globals.invariant(queryDef && queryDef.operation === "query", 118);
|
|
538
538
|
return queryDef;
|
|
539
539
|
}
|
|
540
540
|
function getFragmentDefinition(doc) {
|
|
541
|
-
globals.invariant(doc.kind === "Document",
|
|
542
|
-
globals.invariant(doc.definitions.length <= 1,
|
|
541
|
+
globals.invariant(doc.kind === "Document", 119);
|
|
542
|
+
globals.invariant(doc.definitions.length <= 1, 120);
|
|
543
543
|
var fragmentDef = doc.definitions[0];
|
|
544
|
-
globals.invariant(fragmentDef.kind === "FragmentDefinition",
|
|
544
|
+
globals.invariant(fragmentDef.kind === "FragmentDefinition", 121);
|
|
545
545
|
return fragmentDef;
|
|
546
546
|
}
|
|
547
547
|
function getMainDefinition(queryDoc) {
|
|
@@ -564,7 +564,7 @@ function getMainDefinition(queryDoc) {
|
|
|
564
564
|
if (fragmentDefinition) {
|
|
565
565
|
return fragmentDefinition;
|
|
566
566
|
}
|
|
567
|
-
throw globals.newInvariantError(
|
|
567
|
+
throw globals.newInvariantError(122);
|
|
568
568
|
}
|
|
569
569
|
function getDefaultValues(definition) {
|
|
570
570
|
var defaultValues = Object.create(null);
|
|
@@ -615,7 +615,7 @@ var DocumentTransform = (function () {
|
|
|
615
615
|
makeCacheKey: function (document) {
|
|
616
616
|
var cacheKeys = _this.getCacheKey(document);
|
|
617
617
|
if (cacheKeys) {
|
|
618
|
-
globals.invariant(Array.isArray(cacheKeys),
|
|
618
|
+
globals.invariant(Array.isArray(cacheKeys), 104);
|
|
619
619
|
return stableCacheKeys_1.lookupArray(cacheKeys);
|
|
620
620
|
}
|
|
621
621
|
},
|
|
@@ -745,7 +745,7 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
745
745
|
return getInUseByFragmentName(ancestor.name.value);
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
|
-
globalThis.__DEV__ !== false && globals.invariant.error(
|
|
748
|
+
globalThis.__DEV__ !== false && globals.invariant.error(124);
|
|
749
749
|
return null;
|
|
750
750
|
};
|
|
751
751
|
var operationCount = 0;
|
|
@@ -935,7 +935,7 @@ var connectionRemoveConfig = {
|
|
|
935
935
|
if (willRemove) {
|
|
936
936
|
if (!directive.arguments ||
|
|
937
937
|
!directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
|
|
938
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
938
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(125);
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
return willRemove;
|
|
@@ -1715,6 +1715,35 @@ function stripTypename(value) {
|
|
|
1715
1715
|
return omitDeep(value, "__typename");
|
|
1716
1716
|
}
|
|
1717
1717
|
|
|
1718
|
+
var _a;
|
|
1719
|
+
var muteAllDeprecations = Symbol.for("apollo.deprecations");
|
|
1720
|
+
var deprecationsSlot = Symbol.for("apollo.deprecations.slot");
|
|
1721
|
+
var global$1 = globals.global;
|
|
1722
|
+
var slot = ((_a = global$1[deprecationsSlot]) !== null && _a !== void 0 ? _a : (global$1[deprecationsSlot] = new optimism.Slot()));
|
|
1723
|
+
function isMuted(name) {
|
|
1724
|
+
return global$1[muteAllDeprecations] || (slot.getValue() || []).includes(name);
|
|
1725
|
+
}
|
|
1726
|
+
function muteDeprecations(name) {
|
|
1727
|
+
var args = [];
|
|
1728
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1729
|
+
args[_i - 1] = arguments[_i];
|
|
1730
|
+
}
|
|
1731
|
+
return slot.withValue.apply(slot, tslib.__spreadArray([Array.isArray(name) ? name : [name]], args, false));
|
|
1732
|
+
}
|
|
1733
|
+
function warnRemovedOption(options, name, callSite, recommendation) {
|
|
1734
|
+
if (recommendation === void 0) { recommendation = "Please remove this option."; }
|
|
1735
|
+
warnDeprecated(name, function () {
|
|
1736
|
+
if (name in options) {
|
|
1737
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(103, callSite, name, recommendation);
|
|
1738
|
+
}
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
function warnDeprecated(name, cb) {
|
|
1742
|
+
if (!isMuted(name)) {
|
|
1743
|
+
cb();
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1718
1747
|
exports.DEV = globals.DEV;
|
|
1719
1748
|
exports.maybe = globals.maybe;
|
|
1720
1749
|
exports.Observable = zenObservableTs.Observable;
|
|
@@ -1789,6 +1818,7 @@ exports.mergeDeep = mergeDeep;
|
|
|
1789
1818
|
exports.mergeDeepArray = mergeDeepArray;
|
|
1790
1819
|
exports.mergeIncrementalData = mergeIncrementalData;
|
|
1791
1820
|
exports.mergeOptions = mergeOptions;
|
|
1821
|
+
exports.muteDeprecations = muteDeprecations;
|
|
1792
1822
|
exports.offsetLimitPagination = offsetLimitPagination;
|
|
1793
1823
|
exports.omitDeep = omitDeep;
|
|
1794
1824
|
exports.preventUnhandledRejection = preventUnhandledRejection;
|
|
@@ -1805,5 +1835,7 @@ exports.storeKeyNameFromField = storeKeyNameFromField;
|
|
|
1805
1835
|
exports.stringifyForDisplay = stringifyForDisplay;
|
|
1806
1836
|
exports.stripTypename = stripTypename;
|
|
1807
1837
|
exports.valueToObjectRepresentation = valueToObjectRepresentation;
|
|
1838
|
+
exports.warnDeprecated = warnDeprecated;
|
|
1839
|
+
exports.warnRemovedOption = warnRemovedOption;
|
|
1808
1840
|
exports.wrapPromiseWithState = wrapPromiseWithState;
|
|
1809
1841
|
//# sourceMappingURL=utilities.cjs.map
|
package/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = "3.14.
|
|
1
|
+
export var version = "3.14.1";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|