@apollo/client 3.14.0-rc.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 +44 -0
- package/apollo-client.cjs +85 -77
- 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.d.ts +1 -0
- package/core/ObservableQuery.js +10 -6
- 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 +38 -61
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +38 -61
- 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
- package/.changeset/breezy-lions-rule.md +0 -5
- package/.changeset/chilled-cameras-scream.md +0 -5
- package/.changeset/great-jobs-fetch.md +0 -5
- package/.changeset/great-suns-cover.md +0 -5
- package/.changeset/perfect-donuts-roll.md +0 -5
- package/.changeset/popular-waves-drop.md +0 -5
- package/.changeset/pre.json +0 -20
- package/.changeset/shy-boxes-exercise.md +0 -5
- package/.changeset/shy-dragons-tease.md +0 -5
- package/.changeset/smooth-countries-cough.md +0 -5
- package/.changeset/spotty-walls-repair.md +0 -5
- package/.changeset/tidy-bulldogs-exercise.md +0 -5
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('../utilities/globals');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var core$1 = require('../core');
|
|
9
9
|
var cache = require('../cache');
|
|
10
10
|
var context = require('../react/context');
|
|
11
11
|
var core = require('./core');
|
|
12
|
-
var
|
|
12
|
+
var utilities = require('../utilities');
|
|
13
13
|
|
|
14
14
|
function _interopNamespace(e) {
|
|
15
15
|
if (e && e.__esModule) return e;
|
|
@@ -25,43 +25,16 @@ function _interopNamespace(e) {
|
|
|
25
25
|
|
|
26
26
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
27
|
|
|
28
|
-
var muteAllDeprecations = Symbol.for("apollo.deprecations");
|
|
29
|
-
var global = globals.global;
|
|
30
|
-
var slot = new optimism.Slot();
|
|
31
|
-
function isMuted(name) {
|
|
32
|
-
return global[muteAllDeprecations] || (slot.getValue() || []).includes(name);
|
|
33
|
-
}
|
|
34
|
-
function muteDeprecations(name) {
|
|
35
|
-
var args = [];
|
|
36
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
37
|
-
args[_i - 1] = arguments[_i];
|
|
38
|
-
}
|
|
39
|
-
return slot.withValue.apply(slot, tslib.__spreadArray([Array.isArray(name) ? name : [name]], args, false));
|
|
40
|
-
}
|
|
41
|
-
function warnRemovedOption(options, name, callSite, recommendation) {
|
|
42
|
-
if (recommendation === void 0) { recommendation = "Please remove this option."; }
|
|
43
|
-
warnDeprecated(name, function () {
|
|
44
|
-
if (name in options) {
|
|
45
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(104, callSite, name, recommendation);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function warnDeprecated(name, cb) {
|
|
50
|
-
if (!isMuted(name)) {
|
|
51
|
-
cb();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
28
|
var MockedProvider = (function (_super) {
|
|
56
29
|
tslib.__extends(MockedProvider, _super);
|
|
57
30
|
function MockedProvider(props) {
|
|
58
31
|
var _this = _super.call(this, props) || this;
|
|
59
32
|
var _a = _this.props, mocks = _a.mocks, _b = _a.addTypename, addTypename = _b === void 0 ? true : _b, defaultOptions = _a.defaultOptions, cache$1 = _a.cache, resolvers = _a.resolvers, link = _a.link, showWarnings = _a.showWarnings, devtools = _a.devtools, _c = _a.connectToDevTools, connectToDevTools = _c === void 0 ? false : _c;
|
|
60
33
|
if (globalThis.__DEV__ !== false) {
|
|
61
|
-
warnRemovedOption(_this.props, "connectToDevTools", "MockedProvider", "Please use `devtools.enabled` instead.");
|
|
62
|
-
warnRemovedOption(_this.props, "addTypename", "MockedProvider", "Please remove the `addTypename` prop. For best results, ensure the provided `mocks` include a `__typename` property on all mock objects to ensure the cache more closely behaves like production.");
|
|
34
|
+
utilities.warnRemovedOption(_this.props, "connectToDevTools", "MockedProvider", "Please use `devtools.enabled` instead.");
|
|
35
|
+
utilities.warnRemovedOption(_this.props, "addTypename", "MockedProvider", "Please remove the `addTypename` prop. For best results, ensure the provided `mocks` include a `__typename` property on all mock objects to ensure the cache more closely behaves like production.");
|
|
63
36
|
}
|
|
64
|
-
var client = muteDeprecations(["connectToDevTools", "addTypename"], function () {
|
|
37
|
+
var client = utilities.muteDeprecations(["connectToDevTools", "addTypename"], function () {
|
|
65
38
|
return new core$1.ApolloClient({
|
|
66
39
|
cache: cache$1 || new cache.InMemoryCache({ addTypename: addTypename }),
|
|
67
40
|
defaultOptions: defaultOptions,
|
|
@@ -84,8 +84,5 @@ export type DeprecationName = keyof PossibleDeprecations | NonNullable<PossibleD
|
|
|
84
84
|
export declare function muteDeprecations<TResult, TArgs extends any[], TThis = any>(name: DeprecationName | DeprecationName[], ...args: WithValueArgs<TResult, TArgs, TThis>): TResult;
|
|
85
85
|
export declare function warnRemovedOption<TOptions extends Record<string, any>, CallSite extends keyof PossibleDeprecations>(options: TOptions, name: keyof TOptions & PossibleDeprecations[CallSite][number], callSite: CallSite, recommendation?: string): void;
|
|
86
86
|
export declare function warnDeprecated(name: DeprecationName, cb: () => void): void;
|
|
87
|
-
export declare function withDisabledDeprecations(): {
|
|
88
|
-
[Symbol.dispose](): void;
|
|
89
|
-
};
|
|
90
87
|
export {};
|
|
91
88
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
var _a;
|
|
1
2
|
import { __spreadArray } from "tslib";
|
|
2
3
|
import { Slot } from "optimism";
|
|
3
4
|
import { invariant, global as untypedGlobal } from "../globals/index.js";
|
|
4
5
|
var muteAllDeprecations = Symbol.for("apollo.deprecations");
|
|
6
|
+
var deprecationsSlot = Symbol.for("apollo.deprecations.slot");
|
|
5
7
|
var global = untypedGlobal;
|
|
6
|
-
var slot = new Slot();
|
|
8
|
+
var slot = ((_a = global[deprecationsSlot]) !== null && _a !== void 0 ? _a : (global[deprecationsSlot] = new Slot()));
|
|
7
9
|
function isMuted(name) {
|
|
8
10
|
return global[muteAllDeprecations] || (slot.getValue() || []).includes(name);
|
|
9
11
|
}
|
|
@@ -18,7 +20,7 @@ export function warnRemovedOption(options, name, callSite, recommendation) {
|
|
|
18
20
|
if (recommendation === void 0) { recommendation = "Please remove this option."; }
|
|
19
21
|
warnDeprecated(name, function () {
|
|
20
22
|
if (name in options) {
|
|
21
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
23
|
+
globalThis.__DEV__ !== false && invariant.warn(103, callSite, name, recommendation);
|
|
22
24
|
}
|
|
23
25
|
});
|
|
24
26
|
}
|
|
@@ -27,14 +29,4 @@ export function warnDeprecated(name, cb) {
|
|
|
27
29
|
cb();
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
|
-
export function withDisabledDeprecations() {
|
|
31
|
-
var _a;
|
|
32
|
-
var prev = global[muteAllDeprecations];
|
|
33
|
-
global[muteAllDeprecations] = true;
|
|
34
|
-
return _a = {},
|
|
35
|
-
_a[Symbol.dispose] = function () {
|
|
36
|
-
global[muteAllDeprecations] = prev;
|
|
37
|
-
},
|
|
38
|
-
_a;
|
|
39
|
-
}
|
|
40
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/deprecation/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/deprecation/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKzE,IAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAC9D,IAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAChE,IAAM,MAAM,GAAG,aAGd,CAAC;AAEF,IAAM,IAAI,GAAG,OAAC,MAAM,CAAC,gBAAgB,qCAAvB,MAAM,CAAC,gBAAgB,IAAM,IAAI,IAAI,EAAE,EAAC,CAAC;AA0FvD,SAAS,OAAO,CAAC,IAAqB;IACpC,OAAO,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,IAAyC;IACzC,cAA6C;SAA7C,UAA6C,EAA7C,qBAA6C,EAA7C,IAA6C;QAA7C,6BAA6C;;IAE7C,OAAO,IAAI,CAAC,SAAS,OAAd,IAAI,iBAAW,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAK,IAAI,UAAE;AACtE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAI/B,OAAiB,EACjB,IAA6D,EAC7D,QAAkB,EAClB,cAAqD;IAArD,+BAAA,EAAA,6CAAqD;IAErD,cAAc,CAAC,IAAuB,EAAE;QACtC,IAAI,IAAI,IAAI,OAAO,EAAE,CAAC;YACpB,SAAS,CAAC,IAAI,CACZ,uEAAuE,EACvE,QAAQ,EACR,IAAI,EACJ,cAAc,CACf,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAqB,EAAE,EAAc;IAClE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACnB,EAAE,EAAE,CAAC;IACP,CAAC;AACH,CAAC","sourcesContent":["import { Slot } from \"optimism\";\nimport { invariant, global as untypedGlobal } from \"../globals/index.js\";\n\ntype SlotType<T> =\n typeof Slot<T> extends new (...args: any[]) => infer T ? T : unknown;\n\nconst muteAllDeprecations = Symbol.for(\"apollo.deprecations\");\nconst deprecationsSlot = Symbol.for(\"apollo.deprecations.slot\");\nconst global = untypedGlobal as {\n [muteAllDeprecations]?: boolean;\n [deprecationsSlot]?: SlotType<string[]>;\n};\n\nconst slot = (global[deprecationsSlot] ??= new Slot());\n\ntype WithValueArgs<TResult, TArgs extends any[], TThis> = [\n callback: (this: TThis, ...args: TArgs) => TResult,\n args?: TArgs | undefined,\n thisArg?: TThis | undefined,\n];\n\nexport type PossibleDeprecations = {\n \"cache.readQuery\": [\"canonizeResults\"];\n \"cache.readFragment\": [\"canonizeResults\"];\n \"cache.updateQuery\": [\"canonizeResults\"];\n \"cache.updateFragment\": [\"canonizeResults\"];\n InMemoryCache: [\"addTypename\", \"canonizeResults\"];\n \"cache.read\": [\"canonizeResults\"];\n \"cache.diff\": [\"canonizeResults\"];\n \"cache.gc\": [\"resetResultIdentities\"];\n ApolloClient: [\n \"connectToDevTools\",\n \"uri\",\n \"credentials\",\n \"headers\",\n \"name\",\n \"version\",\n \"typeDefs\",\n ];\n \"client.watchQuery\": [\"canonizeResults\", \"partialRefetch\"];\n \"client.query\": [\"canonizeResults\", \"notifyOnNetworkStatusChange\"];\n setOptions: [\"canonizeResults\"];\n useBackgroundQuery: [\"canonizeResults\"];\n useFragment: [\"canonizeResults\"];\n useLazyQuery: [\n \"canonizeResults\",\n \"variables\",\n \"context\",\n \"onCompleted\",\n \"onError\",\n \"defaultOptions\",\n \"initialFetchPolicy\",\n \"partialRefetch\",\n ];\n \"useLazyQuery.execute\": [\n \"initialFetchPolicy\",\n \"onCompleted\",\n \"onError\",\n \"defaultOptions\",\n \"partialRefetch\",\n \"canonizeResults\",\n \"query\",\n \"ssr\",\n \"client\",\n \"fetchPolicy\",\n \"nextFetchPolicy\",\n \"refetchWritePolicy\",\n \"errorPolicy\",\n \"pollInterval\",\n \"notifyOnNetworkStatusChange\",\n \"returnPartialData\",\n \"skipPollAttempt\",\n ];\n useLoadableQuery: [\"canonizeResults\"];\n useMutation: [\"ignoreResults\"];\n useQuery: [\n \"canonizeResults\",\n \"partialRefetch\",\n \"defaultOptions\",\n \"onCompleted\",\n \"onError\",\n ];\n useSuspenseQuery: [\"canonizeResults\"];\n preloadQuery: [\"canonizeResults\"];\n MockedProvider: [\"connectToDevTools\", \"addTypename\"];\n ObservableQuery: [\n \"observableQuery.result\",\n \"getLastResult\",\n \"getLastError\",\n \"resetLastResults\",\n \"setOptions\",\n ];\n HOC: [\n \"graphql\" | \"withQuery\" | \"withMutation\" | \"withSubscription\",\n \"parser\",\n ];\n RenderProps: [\"<Query />\" | \"<Mutation />\" | \"<Subscription />\"];\n};\n\nexport type DeprecationName =\n | keyof PossibleDeprecations\n | NonNullable<PossibleDeprecations[keyof PossibleDeprecations]>[number];\n\nfunction isMuted(name: DeprecationName) {\n return global[muteAllDeprecations] || (slot.getValue() || []).includes(name);\n}\n\nexport function muteDeprecations<TResult, TArgs extends any[], TThis = any>(\n name: DeprecationName | DeprecationName[],\n ...args: WithValueArgs<TResult, TArgs, TThis>\n) {\n return slot.withValue(Array.isArray(name) ? name : [name], ...args);\n}\n\nexport function warnRemovedOption<\n TOptions extends Record<string, any>,\n CallSite extends keyof PossibleDeprecations,\n>(\n options: TOptions,\n name: keyof TOptions & PossibleDeprecations[CallSite][number],\n callSite: CallSite,\n recommendation: string = \"Please remove this option.\"\n) {\n warnDeprecated(name as DeprecationName, () => {\n if (name in options) {\n invariant.warn(\n \"[%s]: `%s` is deprecated and will be removed in Apollo Client 4.0. %s\",\n callSite,\n name,\n recommendation\n );\n }\n });\n}\n\nexport function warnDeprecated(name: DeprecationName, cb: () => void) {\n if (!isMuted(name)) {\n cb();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.cjs","sources":["../../version.js","maybe.js","global.js","../common/makeUniqueId.js","../common/stringifyForDisplay.js","invariantWrappers.js","index.js"],"sourcesContent":["export var version = \"3.14.0-rc.0\";\n//# sourceMappingURL=version.js.map","export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe.js\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) || // We don't expect the Function constructor ever to be invoked at runtime, as\n// long as at least one of globalThis, window, self, or global is defined, so\n// we are under no obligation to make it easy for static analysis tools to\n// detect syntactic usage of the Function constructor. If you think you can\n// improve your static analysis to detect this obfuscation, think again. This\n// is an arms race you cannot win, at least not in JavaScript.\nmaybe(function () {\n return maybe.constructor(\"return this\")();\n}));\n//# sourceMappingURL=global.js.map","var prefixCounts = new Map();\n// These IDs won't be globally unique, but they will be unique within this\n// process, thanks to the counter, and unguessable thanks to the random suffix.\nexport function makeUniqueId(prefix) {\n var count = prefixCounts.get(prefix) || 1;\n prefixCounts.set(prefix, count + 1);\n return \"\".concat(prefix, \":\").concat(count, \":\").concat(Math.random().toString(36).slice(2));\n}\n//# sourceMappingURL=makeUniqueId.js.map","import { makeUniqueId } from \"./makeUniqueId.js\";\nexport function stringifyForDisplay(value, space) {\n if (space === void 0) { space = 0; }\n var undefId = makeUniqueId(\"stringifyForDisplay\");\n return JSON.stringify(value, function (key, value) {\n return value === void 0 ? undefId : value;\n }, space)\n .split(JSON.stringify(undefId))\n .join(\"<undefined>\");\n}\n//# sourceMappingURL=stringifyForDisplay.js.map","import { invariant as originalInvariant, InvariantError } from \"ts-invariant\";\nimport { version } from \"../../version.js\";\nimport global from \"./global.js\";\nimport { stringifyForDisplay } from \"../common/stringifyForDisplay.js\";\nfunction wrap(fn) {\n return function (message) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof message === \"number\") {\n var arg0 = message;\n message = getHandledErrorMsg(arg0);\n if (!message) {\n message = getFallbackErrorMsg(arg0, args);\n args = [];\n }\n }\n fn.apply(void 0, [message].concat(args));\n };\n}\nvar invariant = Object.assign(function invariant(condition, message) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (!condition) {\n originalInvariant(condition, getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args));\n }\n}, {\n debug: wrap(originalInvariant.debug),\n log: wrap(originalInvariant.log),\n warn: wrap(originalInvariant.warn),\n error: wrap(originalInvariant.error),\n});\n/**\n * Returns an InvariantError.\n *\n * `message` can only be a string, a concatenation of strings, or a ternary statement\n * that results in a string. This will be enforced on build, where the message will\n * be replaced with a message number.\n * String substitutions with %s are supported and will also return\n * pretty-stringified objects.\n * Excess `optionalParams` will be swallowed.\n */\nfunction newInvariantError(message) {\n var optionalParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n optionalParams[_i - 1] = arguments[_i];\n }\n return new InvariantError(getHandledErrorMsg(message, optionalParams) ||\n getFallbackErrorMsg(message, optionalParams));\n}\nvar ApolloErrorMessageHandler = Symbol.for(\"ApolloErrorMessageHandler_\" + version);\nfunction stringify(arg) {\n if (typeof arg == \"string\") {\n return arg;\n }\n try {\n return stringifyForDisplay(arg, 2).slice(0, 1000);\n }\n catch (_a) {\n return \"<non-serializable>\";\n }\n}\nfunction getHandledErrorMsg(message, messageArgs) {\n if (messageArgs === void 0) { messageArgs = []; }\n if (!message)\n return;\n return (global[ApolloErrorMessageHandler] &&\n global[ApolloErrorMessageHandler](message, messageArgs.map(stringify)));\n}\nfunction getFallbackErrorMsg(message, messageArgs) {\n if (messageArgs === void 0) { messageArgs = []; }\n if (!message)\n return;\n return \"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#\".concat(encodeURIComponent(JSON.stringify({\n version: version,\n message: message,\n args: messageArgs.map(stringify),\n })));\n}\nexport { invariant, InvariantError, newInvariantError, ApolloErrorMessageHandler, };\n//# sourceMappingURL=invariantWrappers.js.map","import { invariant, newInvariantError, InvariantError, } from \"./invariantWrappers.js\";\nexport { maybe } from \"./maybe.js\";\nexport { default as global } from \"./global.js\";\nexport { invariant, newInvariantError, InvariantError };\n/**\n * @deprecated we do not use this internally anymore,\n * it is just exported for backwards compatibility\n */\n// this file is extempt from automatic `__DEV__` replacement\n// so we have to write it out here\n// @ts-ignore\nexport var DEV = globalThis.__DEV__ !== false;\nexport { DEV as __DEV__ };\n//# sourceMappingURL=index.js.map"],"names":["originalInvariant","InvariantError","global"],"mappings":";;;;;;AAAO,IAAI,OAAO,GAAG,aAAa;;ACA3B,SAAS,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI;AACR,QAAQ,OAAO,KAAK,EAAE,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,EAAE,EAAE,GAAG;AAClB;;ACJA,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,UAAU,CAAC,EAAE,CAAC;AACzD,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,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,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE;AAClD,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,EAAE,EAAE,WAAW,GAAG,EAAE,CAAC,EAAE;AACrD,IAAI,IAAI,CAAC,OAAO;AAChB,QAAQ,OAAO;AACf,IAAI,QAAQC,QAAM,CAAC,yBAAyB,CAAC;AAC7C,QAAQA,QAAM,CAAC,yBAAyB,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE;AAChF,CAAC;AACD,SAAS,mBAAmB,CAAC,OAAO,EAAE,WAAW,EAAE;AACnD,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,EAAE,EAAE,WAAW,GAAG,EAAE,CAAC,EAAE;AACrD,IAAI,IAAI,CAAC,OAAO;AAChB,QAAQ,OAAO;AACf,IAAI,OAAO,8FAA8F,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC;AACnJ,QAAQ,OAAO,EAAE,OAAO;AACxB,QAAQ,OAAO,EAAE,OAAO;AACxB,QAAQ,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC;AACxC,KAAK,CAAC,CAAC,CAAC,CAAC;AACT;;ACtEU,IAAC,GAAG,GAAG,UAAU,CAAC,OAAO,KAAK;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"globals.cjs","sources":["../../version.js","maybe.js","global.js","../common/makeUniqueId.js","../common/stringifyForDisplay.js","invariantWrappers.js","index.js"],"sourcesContent":["export var version = \"3.14.1\";\n//# sourceMappingURL=version.js.map","export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe.js\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) || // We don't expect the Function constructor ever to be invoked at runtime, as\n// long as at least one of globalThis, window, self, or global is defined, so\n// we are under no obligation to make it easy for static analysis tools to\n// detect syntactic usage of the Function constructor. If you think you can\n// improve your static analysis to detect this obfuscation, think again. This\n// is an arms race you cannot win, at least not in JavaScript.\nmaybe(function () {\n return maybe.constructor(\"return this\")();\n}));\n//# sourceMappingURL=global.js.map","var prefixCounts = new Map();\n// These IDs won't be globally unique, but they will be unique within this\n// process, thanks to the counter, and unguessable thanks to the random suffix.\nexport function makeUniqueId(prefix) {\n var count = prefixCounts.get(prefix) || 1;\n prefixCounts.set(prefix, count + 1);\n return \"\".concat(prefix, \":\").concat(count, \":\").concat(Math.random().toString(36).slice(2));\n}\n//# sourceMappingURL=makeUniqueId.js.map","import { makeUniqueId } from \"./makeUniqueId.js\";\nexport function stringifyForDisplay(value, space) {\n if (space === void 0) { space = 0; }\n var undefId = makeUniqueId(\"stringifyForDisplay\");\n return JSON.stringify(value, function (key, value) {\n return value === void 0 ? undefId : value;\n }, space)\n .split(JSON.stringify(undefId))\n .join(\"<undefined>\");\n}\n//# sourceMappingURL=stringifyForDisplay.js.map","import { invariant as originalInvariant, InvariantError } from \"ts-invariant\";\nimport { version } from \"../../version.js\";\nimport global from \"./global.js\";\nimport { stringifyForDisplay } from \"../common/stringifyForDisplay.js\";\nfunction wrap(fn) {\n return function (message) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof message === \"number\") {\n var arg0 = message;\n message = getHandledErrorMsg(arg0);\n if (!message) {\n message = getFallbackErrorMsg(arg0, args);\n args = [];\n }\n }\n fn.apply(void 0, [message].concat(args));\n };\n}\nvar invariant = Object.assign(function invariant(condition, message) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (!condition) {\n originalInvariant(condition, getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args));\n }\n}, {\n debug: wrap(originalInvariant.debug),\n log: wrap(originalInvariant.log),\n warn: wrap(originalInvariant.warn),\n error: wrap(originalInvariant.error),\n});\n/**\n * Returns an InvariantError.\n *\n * `message` can only be a string, a concatenation of strings, or a ternary statement\n * that results in a string. This will be enforced on build, where the message will\n * be replaced with a message number.\n * String substitutions with %s are supported and will also return\n * pretty-stringified objects.\n * Excess `optionalParams` will be swallowed.\n */\nfunction newInvariantError(message) {\n var optionalParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n optionalParams[_i - 1] = arguments[_i];\n }\n return new InvariantError(getHandledErrorMsg(message, optionalParams) ||\n getFallbackErrorMsg(message, optionalParams));\n}\nvar ApolloErrorMessageHandler = Symbol.for(\"ApolloErrorMessageHandler_\" + version);\nfunction stringify(arg) {\n if (typeof arg == \"string\") {\n return arg;\n }\n try {\n return stringifyForDisplay(arg, 2).slice(0, 1000);\n }\n catch (_a) {\n return \"<non-serializable>\";\n }\n}\nfunction getHandledErrorMsg(message, messageArgs) {\n if (messageArgs === void 0) { messageArgs = []; }\n if (!message)\n return;\n return (global[ApolloErrorMessageHandler] &&\n global[ApolloErrorMessageHandler](message, messageArgs.map(stringify)));\n}\nfunction getFallbackErrorMsg(message, messageArgs) {\n if (messageArgs === void 0) { messageArgs = []; }\n if (!message)\n return;\n return \"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#\".concat(encodeURIComponent(JSON.stringify({\n version: version,\n message: message,\n args: messageArgs.map(stringify),\n })));\n}\nexport { invariant, InvariantError, newInvariantError, ApolloErrorMessageHandler, };\n//# sourceMappingURL=invariantWrappers.js.map","import { invariant, newInvariantError, InvariantError, } from \"./invariantWrappers.js\";\nexport { maybe } from \"./maybe.js\";\nexport { default as global } from \"./global.js\";\nexport { invariant, newInvariantError, InvariantError };\n/**\n * @deprecated we do not use this internally anymore,\n * it is just exported for backwards compatibility\n */\n// this file is extempt from automatic `__DEV__` replacement\n// so we have to write it out here\n// @ts-ignore\nexport var DEV = globalThis.__DEV__ !== false;\nexport { DEV as __DEV__ };\n//# sourceMappingURL=index.js.map"],"names":["originalInvariant","InvariantError","global"],"mappings":";;;;;;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= _this.getCacheKey(document);
|
|
56
56
|
if (cacheKeys) {
|
|
57
|
-
invariant(Array.isArray(cacheKeys),
|
|
57
|
+
invariant(Array.isArray(cacheKeys), 104);
|
|
58
58
|
return stableCacheKeys_1.lookupArray(cacheKeys);
|
|
59
59
|
}
|
|
60
60
|
},
|
|
@@ -11,7 +11,7 @@ export function shouldInclude(_a, variables) {
|
|
|
11
11
|
if (ifArgument.value.kind === "Variable") {
|
|
12
12
|
evaledValue =
|
|
13
13
|
variables && variables[ifArgument.value.name.value];
|
|
14
|
-
invariant(evaledValue !== void 0,
|
|
14
|
+
invariant(evaledValue !== void 0, 105, directive.name.value);
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
17
|
evaledValue = ifArgument.value.value;
|
|
@@ -63,13 +63,13 @@ export function getInclusionDirectives(directives) {
|
|
|
63
63
|
return;
|
|
64
64
|
var directiveArguments = directive.arguments;
|
|
65
65
|
var directiveName = directive.name.value;
|
|
66
|
-
invariant(directiveArguments && directiveArguments.length === 1,
|
|
66
|
+
invariant(directiveArguments && directiveArguments.length === 1, 106, directiveName);
|
|
67
67
|
var ifArgument = directiveArguments[0];
|
|
68
|
-
invariant(ifArgument.name && ifArgument.name.value === "if",
|
|
68
|
+
invariant(ifArgument.name && ifArgument.name.value === "if", 107, directiveName);
|
|
69
69
|
var ifValue = ifArgument.value;
|
|
70
70
|
// means it has to be a variable value if this is a valid @skip or @include directive
|
|
71
71
|
invariant(ifValue &&
|
|
72
|
-
(ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"),
|
|
72
|
+
(ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 108, directiveName);
|
|
73
73
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
74
74
|
});
|
|
75
75
|
}
|
|
@@ -92,13 +92,13 @@ export function getFragmentMaskMode(fragment) {
|
|
|
92
92
|
if (globalThis.__DEV__ !== false) {
|
|
93
93
|
if (modeArg) {
|
|
94
94
|
if (modeArg.value.kind === Kind.VARIABLE) {
|
|
95
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
95
|
+
globalThis.__DEV__ !== false && invariant.warn(109);
|
|
96
96
|
}
|
|
97
97
|
else if (modeArg.value.kind !== Kind.STRING) {
|
|
98
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
98
|
+
globalThis.__DEV__ !== false && invariant.warn(110);
|
|
99
99
|
}
|
|
100
100
|
else if (modeArg.value.value !== "migrate") {
|
|
101
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
101
|
+
globalThis.__DEV__ !== false && invariant.warn(111, modeArg.value.value);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -34,7 +34,7 @@ export function getFragmentQueryDocument(document, fragmentName) {
|
|
|
34
34
|
// define our own operation definition later on.
|
|
35
35
|
if (definition.kind === "OperationDefinition") {
|
|
36
36
|
throw newInvariantError(
|
|
37
|
-
|
|
37
|
+
112,
|
|
38
38
|
definition.operation,
|
|
39
39
|
definition.name ? " named '".concat(definition.name.value, "'") : ""
|
|
40
40
|
);
|
|
@@ -48,7 +48,7 @@ export function getFragmentQueryDocument(document, fragmentName) {
|
|
|
48
48
|
// If the user did not give us a fragment name then let us try to get a
|
|
49
49
|
// name from a single fragment in the definition.
|
|
50
50
|
if (typeof actualFragmentName === "undefined") {
|
|
51
|
-
invariant(fragments.length === 1,
|
|
51
|
+
invariant(fragments.length === 1, 113, fragments.length);
|
|
52
52
|
actualFragmentName = fragments[0].name.value;
|
|
53
53
|
}
|
|
54
54
|
// Generate a query document with an operation that simply spreads the
|
|
@@ -94,7 +94,7 @@ export function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
94
94
|
return fragmentMap(fragmentName);
|
|
95
95
|
}
|
|
96
96
|
var fragment = fragmentMap && fragmentMap[fragmentName];
|
|
97
|
-
invariant(fragment,
|
|
97
|
+
invariant(fragment, 114, fragmentName);
|
|
98
98
|
return fragment || null;
|
|
99
99
|
}
|
|
100
100
|
default:
|
|
@@ -2,16 +2,16 @@ import { invariant, newInvariantError } from "../globals/index.js";
|
|
|
2
2
|
import { valueToObjectRepresentation } from "./storeUtils.js";
|
|
3
3
|
// Checks the document for errors and throws an exception if there is an error.
|
|
4
4
|
export function checkDocument(doc) {
|
|
5
|
-
invariant(doc && doc.kind === "Document",
|
|
5
|
+
invariant(doc && doc.kind === "Document", 115);
|
|
6
6
|
var operations = doc.definitions
|
|
7
7
|
.filter(function (d) { return d.kind !== "FragmentDefinition"; })
|
|
8
8
|
.map(function (definition) {
|
|
9
9
|
if (definition.kind !== "OperationDefinition") {
|
|
10
|
-
throw newInvariantError(
|
|
10
|
+
throw newInvariantError(116, definition.kind);
|
|
11
11
|
}
|
|
12
12
|
return definition;
|
|
13
13
|
});
|
|
14
|
-
invariant(operations.length <= 1,
|
|
14
|
+
invariant(operations.length <= 1, 117, operations.length);
|
|
15
15
|
return doc;
|
|
16
16
|
}
|
|
17
17
|
export function getOperationDefinition(doc) {
|
|
@@ -35,14 +35,14 @@ export function getFragmentDefinitions(doc) {
|
|
|
35
35
|
}
|
|
36
36
|
export function getQueryDefinition(doc) {
|
|
37
37
|
var queryDef = getOperationDefinition(doc);
|
|
38
|
-
invariant(queryDef && queryDef.operation === "query",
|
|
38
|
+
invariant(queryDef && queryDef.operation === "query", 118);
|
|
39
39
|
return queryDef;
|
|
40
40
|
}
|
|
41
41
|
export function getFragmentDefinition(doc) {
|
|
42
|
-
invariant(doc.kind === "Document",
|
|
43
|
-
invariant(doc.definitions.length <= 1,
|
|
42
|
+
invariant(doc.kind === "Document", 119);
|
|
43
|
+
invariant(doc.definitions.length <= 1, 120);
|
|
44
44
|
var fragmentDef = doc.definitions[0];
|
|
45
|
-
invariant(fragmentDef.kind === "FragmentDefinition",
|
|
45
|
+
invariant(fragmentDef.kind === "FragmentDefinition", 121);
|
|
46
46
|
return fragmentDef;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
@@ -72,7 +72,7 @@ export function getMainDefinition(queryDoc) {
|
|
|
72
72
|
if (fragmentDefinition) {
|
|
73
73
|
return fragmentDefinition;
|
|
74
74
|
}
|
|
75
|
-
throw newInvariantError(
|
|
75
|
+
throw newInvariantError(122);
|
|
76
76
|
}
|
|
77
77
|
export function getDefaultValues(definition) {
|
|
78
78
|
var defaultValues = Object.create(null);
|
|
@@ -72,7 +72,7 @@ export function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
72
72
|
argObj[name.value] = null;
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
|
-
throw newInvariantError(
|
|
75
|
+
throw newInvariantError(123, name.value, value.kind);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
export function storeKeyNameFromField(field, variables) {
|
|
@@ -87,7 +87,7 @@ export function removeDirectivesFromDocument(directives, doc) {
|
|
|
87
87
|
return getInUseByFragmentName(ancestor.name.value);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
globalThis.__DEV__ !== false && invariant.error(
|
|
90
|
+
globalThis.__DEV__ !== false && invariant.error(124);
|
|
91
91
|
return null;
|
|
92
92
|
};
|
|
93
93
|
var operationCount = 0;
|
|
@@ -353,7 +353,7 @@ var connectionRemoveConfig = {
|
|
|
353
353
|
if (willRemove) {
|
|
354
354
|
if (!directive.arguments ||
|
|
355
355
|
!directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
|
|
356
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
356
|
+
globalThis.__DEV__ !== false && invariant.warn(125);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
return willRemove;
|
package/utilities/index.d.ts
CHANGED
|
@@ -48,4 +48,6 @@ export type { NoInfer } from "./types/NoInfer.js";
|
|
|
48
48
|
export type { RemoveIndexSignature } from "./types/RemoveIndexSignature.js";
|
|
49
49
|
export { AutoCleanedStrongCache, AutoCleanedWeakCache, cacheSizes, defaultCacheSizes, } from "./caching/index.js";
|
|
50
50
|
export type { CacheSizes } from "./caching/index.js";
|
|
51
|
+
export { muteDeprecations, warnRemovedOption, warnDeprecated, } from "./deprecation/index.js";
|
|
52
|
+
export type { DeprecationName, PossibleDeprecations, } from "./deprecation/index.js";
|
|
51
53
|
//# sourceMappingURL=index.d.ts.map
|
package/utilities/index.js
CHANGED
|
@@ -31,4 +31,5 @@ export { canonicalStringify } from "./common/canonicalStringify.js";
|
|
|
31
31
|
export { omitDeep } from "./common/omitDeep.js";
|
|
32
32
|
export { stripTypename } from "./common/stripTypename.js";
|
|
33
33
|
export { AutoCleanedStrongCache, AutoCleanedWeakCache, cacheSizes, } from "./caching/index.js";
|
|
34
|
+
export { muteDeprecations, warnRemovedOption, warnDeprecated, } from "./deprecation/index.js";
|
|
34
35
|
//# sourceMappingURL=index.js.map
|
package/utilities/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAMhD,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAU3C,OAAO,EACL,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,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,oBAAoB,EACpB,UAAU,GAEX,MAAM,oBAAoB,CAAC","sourcesContent":["export { DEV, maybe } from \"./globals/index.js\";\n\nexport type {\n DirectiveInfo,\n InclusionDirectives,\n} from \"./graphql/directives.js\";\nexport {\n shouldInclude,\n hasDirectives,\n hasAnyDirectives,\n hasAllDirectives,\n hasClientExports,\n getDirectiveNames,\n getInclusionDirectives,\n getFragmentMaskMode,\n} from \"./graphql/directives.js\";\n\nexport type { DocumentTransformCacheKey } from \"./graphql/DocumentTransform.js\";\nexport { DocumentTransform } from \"./graphql/DocumentTransform.js\";\n\nexport type { FragmentMap, FragmentMapFunction } from \"./graphql/fragments.js\";\nexport {\n createFragmentMap,\n getFragmentQueryDocument,\n getFragmentFromSelection,\n isFullyUnmaskedOperation,\n} from \"./graphql/fragments.js\";\n\nexport {\n checkDocument,\n getOperationDefinition,\n getOperationName,\n getFragmentDefinitions,\n getQueryDefinition,\n getFragmentDefinition,\n getMainDefinition,\n getDefaultValues,\n} from \"./graphql/getFromAST.js\";\n\nexport { print } from \"./graphql/print.js\";\n\nexport type {\n StoreObject,\n AsStoreObject,\n Reference,\n StoreValue,\n Directives,\n VariableValue,\n} from \"./graphql/storeUtils.js\";\nexport {\n makeReference,\n isDocumentNode,\n isReference,\n isField,\n isInlineFragment,\n valueToObjectRepresentation,\n storeKeyNameFromField,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getStoreKeyName,\n getTypenameFromResult,\n} from \"./graphql/storeUtils.js\";\n\nexport type {\n RemoveNodeConfig,\n GetNodeConfig,\n RemoveDirectiveConfig,\n GetDirectiveConfig,\n RemoveArgumentsConfig,\n GetFragmentSpreadConfig,\n RemoveFragmentSpreadConfig,\n RemoveFragmentDefinitionConfig,\n RemoveVariableDefinitionConfig,\n} from \"./graphql/transform.js\";\nexport {\n addTypenameToDocument,\n addNonReactiveToNamedFragments,\n buildQueryFromSelectionSet,\n removeDirectivesFromDocument,\n removeConnectionDirectiveFromDocument,\n removeArgumentsFromDocument,\n removeFragmentSpreadFromDocument,\n removeClientSetsFromDocument,\n} from \"./graphql/transform.js\";\n\nexport {\n isMutationOperation,\n isQueryOperation,\n isSubscriptionOperation,\n} from \"./graphql/operations.js\";\n\nexport {\n concatPagination,\n offsetLimitPagination,\n relayStylePagination,\n} from \"./policies/pagination.js\";\n\nexport type {\n Observer,\n ObservableSubscription,\n} from \"./observables/Observable.js\";\nexport { Observable } from \"./observables/Observable.js\";\n\nexport type { PromiseWithState } from \"./promises/decoration.js\";\nexport {\n isStatefulPromise,\n createFulfilledPromise,\n createRejectedPromise,\n wrapPromiseWithState,\n} from \"./promises/decoration.js\";\n\nexport { preventUnhandledRejection } from \"./promises/preventUnhandledRejection.js\";\n\nexport * from \"./common/mergeDeep.js\";\nexport * from \"./common/cloneDeep.js\";\nexport { maybeDeepFreeze } from \"./common/maybeDeepFreeze.js\";\nexport * from \"./observables/iteration.js\";\nexport * from \"./observables/asyncMap.js\";\nexport * from \"./observables/Concast.js\";\nexport * from \"./observables/subclassing.js\";\nexport * from \"./common/arrays.js\";\nexport * from \"./common/objects.js\";\nexport * from \"./common/errorHandling.js\";\nexport * from \"./common/canUse.js\";\nexport * from \"./common/compact.js\";\nexport * from \"./common/makeUniqueId.js\";\nexport * from \"./common/stringifyForDisplay.js\";\nexport * from \"./common/mergeOptions.js\";\nexport * from \"./common/incrementalResult.js\";\n\nexport { canonicalStringify } from \"./common/canonicalStringify.js\";\nexport { omitDeep } from \"./common/omitDeep.js\";\nexport { stripTypename } from \"./common/stripTypename.js\";\n\nexport type * from \"./types/IsStrictlyAny.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { DeepPartial } from \"./types/DeepPartial.js\";\nexport type { OnlyRequiredProperties } from \"./types/OnlyRequiredProperties.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { UnionToIntersection } from \"./types/UnionToIntersection.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\n\nexport {\n AutoCleanedStrongCache,\n AutoCleanedWeakCache,\n cacheSizes,\n defaultCacheSizes,\n} from \"./caching/index.js\";\nexport type { CacheSizes } from \"./caching/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAMhD,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAU3C,OAAO,EACL,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAajC,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC5B,qCAAqC,EACrC,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGzD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAY1D,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,UAAU,GAEX,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,wBAAwB,CAAC","sourcesContent":["export { DEV, maybe } from \"./globals/index.js\";\n\nexport type {\n DirectiveInfo,\n InclusionDirectives,\n} from \"./graphql/directives.js\";\nexport {\n shouldInclude,\n hasDirectives,\n hasAnyDirectives,\n hasAllDirectives,\n hasClientExports,\n getDirectiveNames,\n getInclusionDirectives,\n getFragmentMaskMode,\n} from \"./graphql/directives.js\";\n\nexport type { DocumentTransformCacheKey } from \"./graphql/DocumentTransform.js\";\nexport { DocumentTransform } from \"./graphql/DocumentTransform.js\";\n\nexport type { FragmentMap, FragmentMapFunction } from \"./graphql/fragments.js\";\nexport {\n createFragmentMap,\n getFragmentQueryDocument,\n getFragmentFromSelection,\n isFullyUnmaskedOperation,\n} from \"./graphql/fragments.js\";\n\nexport {\n checkDocument,\n getOperationDefinition,\n getOperationName,\n getFragmentDefinitions,\n getQueryDefinition,\n getFragmentDefinition,\n getMainDefinition,\n getDefaultValues,\n} from \"./graphql/getFromAST.js\";\n\nexport { print } from \"./graphql/print.js\";\n\nexport type {\n StoreObject,\n AsStoreObject,\n Reference,\n StoreValue,\n Directives,\n VariableValue,\n} from \"./graphql/storeUtils.js\";\nexport {\n makeReference,\n isDocumentNode,\n isReference,\n isField,\n isInlineFragment,\n valueToObjectRepresentation,\n storeKeyNameFromField,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getStoreKeyName,\n getTypenameFromResult,\n} from \"./graphql/storeUtils.js\";\n\nexport type {\n RemoveNodeConfig,\n GetNodeConfig,\n RemoveDirectiveConfig,\n GetDirectiveConfig,\n RemoveArgumentsConfig,\n GetFragmentSpreadConfig,\n RemoveFragmentSpreadConfig,\n RemoveFragmentDefinitionConfig,\n RemoveVariableDefinitionConfig,\n} from \"./graphql/transform.js\";\nexport {\n addTypenameToDocument,\n addNonReactiveToNamedFragments,\n buildQueryFromSelectionSet,\n removeDirectivesFromDocument,\n removeConnectionDirectiveFromDocument,\n removeArgumentsFromDocument,\n removeFragmentSpreadFromDocument,\n removeClientSetsFromDocument,\n} from \"./graphql/transform.js\";\n\nexport {\n isMutationOperation,\n isQueryOperation,\n isSubscriptionOperation,\n} from \"./graphql/operations.js\";\n\nexport {\n concatPagination,\n offsetLimitPagination,\n relayStylePagination,\n} from \"./policies/pagination.js\";\n\nexport type {\n Observer,\n ObservableSubscription,\n} from \"./observables/Observable.js\";\nexport { Observable } from \"./observables/Observable.js\";\n\nexport type { PromiseWithState } from \"./promises/decoration.js\";\nexport {\n isStatefulPromise,\n createFulfilledPromise,\n createRejectedPromise,\n wrapPromiseWithState,\n} from \"./promises/decoration.js\";\n\nexport { preventUnhandledRejection } from \"./promises/preventUnhandledRejection.js\";\n\nexport * from \"./common/mergeDeep.js\";\nexport * from \"./common/cloneDeep.js\";\nexport { maybeDeepFreeze } from \"./common/maybeDeepFreeze.js\";\nexport * from \"./observables/iteration.js\";\nexport * from \"./observables/asyncMap.js\";\nexport * from \"./observables/Concast.js\";\nexport * from \"./observables/subclassing.js\";\nexport * from \"./common/arrays.js\";\nexport * from \"./common/objects.js\";\nexport * from \"./common/errorHandling.js\";\nexport * from \"./common/canUse.js\";\nexport * from \"./common/compact.js\";\nexport * from \"./common/makeUniqueId.js\";\nexport * from \"./common/stringifyForDisplay.js\";\nexport * from \"./common/mergeOptions.js\";\nexport * from \"./common/incrementalResult.js\";\n\nexport { canonicalStringify } from \"./common/canonicalStringify.js\";\nexport { omitDeep } from \"./common/omitDeep.js\";\nexport { stripTypename } from \"./common/stripTypename.js\";\n\nexport type * from \"./types/IsStrictlyAny.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { DeepPartial } from \"./types/DeepPartial.js\";\nexport type { OnlyRequiredProperties } from \"./types/OnlyRequiredProperties.js\";\nexport type { Prettify } from \"./types/Prettify.js\";\nexport type { Primitive } from \"./types/Primitive.js\";\nexport type { UnionToIntersection } from \"./types/UnionToIntersection.js\";\nexport type { NoInfer } from \"./types/NoInfer.js\";\nexport type { RemoveIndexSignature } from \"./types/RemoveIndexSignature.js\";\n\nexport {\n AutoCleanedStrongCache,\n AutoCleanedWeakCache,\n cacheSizes,\n defaultCacheSizes,\n} from \"./caching/index.js\";\nexport type { CacheSizes } from \"./caching/index.js\";\n\nexport {\n muteDeprecations,\n warnRemovedOption,\n warnDeprecated,\n} from \"./deprecation/index.js\";\nexport type {\n DeprecationName,\n PossibleDeprecations,\n} from \"./deprecation/index.js\";\n"]}
|
package/utilities/utilities.cjs
CHANGED
|
@@ -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
|