@apollo/client 3.13.8 → 3.14.0-alpha.0
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/.changeset/chilled-cameras-scream.md +5 -0
- package/.changeset/great-suns-cover.md +5 -0
- package/.changeset/perfect-donuts-roll.md +5 -0
- package/.changeset/popular-waves-drop.md +5 -0
- package/.changeset/pre.json +16 -0
- package/.changeset/shy-dragons-tease.md +5 -0
- package/.changeset/smooth-countries-cough.md +5 -0
- package/.changeset/spotty-walls-repair.md +5 -0
- package/CHANGELOG.md +20 -0
- package/README.md +80 -31
- package/apollo-client.cjs +354 -132
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +78 -21
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +78 -21
- package/cache/core/cache.js +27 -4
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +4 -4
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +2 -2
- package/cache/inmemory/inMemoryCache.js +15 -4
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/policies.js +18 -13
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +7 -0
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +14 -3
- package/cache/inmemory/types.js.map +1 -1
- package/core/ApolloClient.d.ts +191 -2
- package/core/ApolloClient.js +93 -7
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.js +10 -6
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js +8 -2
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +15 -12
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +93 -30
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +93 -30
- package/core/watchQueryOptions.d.ts +2 -2
- package/dev/dev.cjs +144 -84
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +144 -84
- package/invariantErrorCodes.js +158 -83
- 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/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/masking.cjs +6 -6
- package/masking/masking.cjs.map +1 -1
- package/masking/masking.cjs.native.js +6 -6
- package/masking/utils.js +1 -1
- package/package.json +1 -1
- package/react/components/Mutation.js +5 -0
- package/react/components/Mutation.js.map +1 -1
- package/react/components/Query.js +5 -0
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.js +5 -0
- package/react/components/Subscription.js.map +1 -1
- package/react/components/components.cjs +34 -0
- package/react/components/components.cjs.map +1 -1
- package/react/components/components.cjs.native.js +34 -0
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +7 -2
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +9 -4
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +9 -4
- package/react/hoc/graphql.js +17 -4
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +55 -9
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +55 -9
- package/react/hoc/mutation-hoc.js +8 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.js +8 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.js +8 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +264 -31
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +264 -31
- package/react/hooks/internal/index.d.ts +2 -0
- package/react/hooks/internal/index.js +2 -0
- package/react/hooks/internal/index.js.map +1 -1
- package/react/hooks/internal/useWarnRemoved.d.ts +2 -0
- package/react/hooks/internal/useWarnRemoved.js +14 -0
- package/react/hooks/internal/useWarnRemoved.js.map +1 -0
- package/react/hooks/internal/useWarnRemovedOption.d.ts +2 -0
- package/react/hooks/internal/useWarnRemovedOption.js +14 -0
- package/react/hooks/internal/useWarnRemovedOption.js.map +1 -0
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useBackgroundQuery.js +11 -3
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.js +30 -21
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.js +65 -0
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +12 -5
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.js +5 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +2 -2
- package/react/hooks/useQuery.js +25 -7
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.js +12 -6
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.d.ts +16 -0
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +2 -2
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +2 -2
- package/react/parser/index.d.ts +7 -0
- package/react/parser/index.js +17 -7
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +28 -7
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +28 -7
- package/react/query-preloader/createQueryPreloader.d.ts +2 -1
- package/react/query-preloader/createQueryPreloader.js +14 -5
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/react.cjs +40 -6
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +40 -6
- package/react/types/types.d.ts +303 -9
- package/react/types/types.documentation.d.ts +2 -3
- package/react/types/types.documentation.js.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +2 -2
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +2 -2
- package/testing/core/mocking/mockLink.js +2 -2
- package/testing/react/MockedProvider.d.ts +27 -1
- package/testing/react/MockedProvider.js +16 -10
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +42 -11
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +42 -11
- package/utilities/deprecation/index.d.ts +11 -0
- package/utilities/deprecation/index.js +28 -0
- package/utilities/deprecation/index.js.map +1 -0
- 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/utilities.cjs +22 -22
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +22 -22
- package/version.js +1 -1
|
@@ -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.13.8\";\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,QAAQ;;ACAtB,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,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;AACvC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AAMzC,KAAK,CAAC,YAAY;AAClB,IAAI,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC;AAC9C,CAAC,CAAC;;ACZF,IAAI,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;AAGtB,SAAS,YAAY,CAAC,MAAM,EAAE;AACrC,IAAI,IAAI,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9C,IAAI,YAAY,CA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AAE,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.0-alpha.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,gBAAgB;;ACA9B,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,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;AACvC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,C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C,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;;;;;;;;;;"}
|
|
@@ -54,7 +54,7 @@ var DocumentTransform = /** @class */ (function () {
|
|
|
54
54
|
makeCacheKey: function (document) {
|
|
55
55
|
var cacheKeys = _this.getCacheKey(document);
|
|
56
56
|
if (cacheKeys) {
|
|
57
|
-
invariant(Array.isArray(cacheKeys),
|
|
57
|
+
invariant(Array.isArray(cacheKeys), 92);
|
|
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, 93, 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, 94, directiveName);
|
|
67
67
|
var ifArgument = directiveArguments[0];
|
|
68
|
-
invariant(ifArgument.name && ifArgument.name.value === "if",
|
|
68
|
+
invariant(ifArgument.name && ifArgument.name.value === "if", 95, 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"), 96, 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(97);
|
|
96
96
|
}
|
|
97
97
|
else if (modeArg.value.kind !== Kind.STRING) {
|
|
98
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
98
|
+
globalThis.__DEV__ !== false && invariant.warn(98);
|
|
99
99
|
}
|
|
100
100
|
else if (modeArg.value.value !== "migrate") {
|
|
101
|
-
globalThis.__DEV__ !== false && invariant.warn(
|
|
101
|
+
globalThis.__DEV__ !== false && invariant.warn(99, 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
|
+
100,
|
|
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, 101, 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, 102, 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", 103);
|
|
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(104, definition.kind);
|
|
11
11
|
}
|
|
12
12
|
return definition;
|
|
13
13
|
});
|
|
14
|
-
invariant(operations.length <= 1,
|
|
14
|
+
invariant(operations.length <= 1, 105, 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", 106);
|
|
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", 107);
|
|
43
|
+
invariant(doc.definitions.length <= 1, 108);
|
|
44
44
|
var fragmentDef = doc.definitions[0];
|
|
45
|
-
invariant(fragmentDef.kind === "FragmentDefinition",
|
|
45
|
+
invariant(fragmentDef.kind === "FragmentDefinition", 109);
|
|
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(110);
|
|
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(111, 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(112);
|
|
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(113);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
return willRemove;
|
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, 93, 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, 94, 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", 95, 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"), 96, 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(97);
|
|
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(98);
|
|
106
106
|
}
|
|
107
107
|
else if (modeArg.value.value !== "migrate") {
|
|
108
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(
|
|
108
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(99, 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
|
+
100,
|
|
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, 101, 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, 102, 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(111, 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", 103);
|
|
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(104, definition.kind);
|
|
511
511
|
}
|
|
512
512
|
return definition;
|
|
513
513
|
});
|
|
514
|
-
globals.invariant(operations.length <= 1,
|
|
514
|
+
globals.invariant(operations.length <= 1, 105, 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", 106);
|
|
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", 107);
|
|
542
|
+
globals.invariant(doc.definitions.length <= 1, 108);
|
|
543
543
|
var fragmentDef = doc.definitions[0];
|
|
544
|
-
globals.invariant(fragmentDef.kind === "FragmentDefinition",
|
|
544
|
+
globals.invariant(fragmentDef.kind === "FragmentDefinition", 109);
|
|
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(110);
|
|
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), 92);
|
|
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(112);
|
|
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(113);
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
941
|
return willRemove;
|