@apollo/client 3.10.5 → 3.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/apollo-client.cjs +16 -5
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.d.cts +1 -0
- package/cache/inmemory/writeToStore.d.ts +2 -2
- package/core/QueryManager.d.ts +1 -1
- package/core/core.cjs +1 -1
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +1 -1
- package/core/core.d.cts +1 -0
- package/dev/dev.cjs +10 -2
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +10 -2
- package/dev/dev.d.cts +1 -0
- package/errors/errors.d.cts +1 -0
- package/link/batch/batch.d.cts +1 -0
- package/link/batch-http/batch-http.d.cts +1 -0
- package/link/context/context.d.cts +1 -0
- package/link/core/core.d.cts +1 -0
- package/link/error/error.d.cts +1 -0
- package/link/http/http.d.cts +1 -0
- package/link/http/iterators/nodeStream.d.ts +0 -1
- package/link/persisted-queries/persisted-queries.d.cts +1 -0
- package/link/remove-typename/remove-typename.d.cts +1 -0
- package/link/retry/retry.d.cts +1 -0
- package/link/schema/schema.d.cts +1 -0
- package/link/subscriptions/subscriptions.d.cts +1 -0
- package/link/utils/utils.d.cts +1 -0
- package/link/ws/ws.d.cts +1 -0
- package/package.json +5 -3
- package/react/components/components.d.cts +1 -0
- package/react/context/context.d.cts +1 -0
- package/react/hoc/hoc-utils.d.ts +0 -1
- package/react/hoc/hoc.d.cts +1 -0
- package/react/hooks/hooks.cjs +3 -1
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +3 -1
- package/react/hooks/hooks.d.cts +1 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +0 -1
- package/react/hooks/internal/useLazyRef.d.ts +0 -1
- package/react/hooks/useMutation.js +2 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/internal/internal.cjs +10 -2
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +10 -2
- package/react/internal/internal.d.cts +1 -0
- package/react/parser/parser.d.cts +1 -0
- package/react/react.d.cts +1 -0
- package/react/ssr/ssr.d.cts +1 -0
- package/testing/core/core.d.cts +1 -0
- package/testing/experimental/createSchemaFetch.d.ts +0 -1
- package/testing/experimental/experimental.d.cts +1 -0
- package/testing/internal/disposables/disableActWarnings.d.ts +0 -1
- package/testing/internal/disposables/spyOnConsole.d.ts +0 -2
- package/testing/internal/disposables/withCleanup.d.ts +0 -1
- package/testing/internal/profile/Render.d.ts +0 -1
- package/testing/internal/profile/Render.js +2 -2
- package/testing/internal/profile/Render.js.map +1 -1
- package/testing/testing.d.cts +1 -0
- package/utilities/common/canUse.js +3 -2
- package/utilities/common/canUse.js.map +1 -1
- package/utilities/globals/globals.cjs +10 -2
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +10 -2
- package/utilities/globals/globals.d.cts +1 -0
- package/utilities/globals/invariantWrappers.js +9 -1
- package/utilities/globals/invariantWrappers.js.map +1 -1
- package/utilities/subscriptions/relay/relay.d.cts +1 -0
- package/utilities/subscriptions/shared.d.ts +1 -1
- package/utilities/subscriptions/urql/urql.d.cts +1 -0
- package/utilities/utilities.cjs +3 -2
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +3 -2
- package/utilities/utilities.d.cts +1 -0
- package/version.js +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.d.ts";
|
|
@@ -53,7 +53,15 @@ function newInvariantError(message) {
|
|
|
53
53
|
}
|
|
54
54
|
var ApolloErrorMessageHandler = Symbol.for("ApolloErrorMessageHandler_" + version);
|
|
55
55
|
function stringify(arg) {
|
|
56
|
-
|
|
56
|
+
if (typeof arg == "string") {
|
|
57
|
+
return arg;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
return stringifyForDisplay(arg, 2).slice(0, 1000);
|
|
61
|
+
}
|
|
62
|
+
catch (_a) {
|
|
63
|
+
return "<non-serializable>";
|
|
64
|
+
}
|
|
57
65
|
}
|
|
58
66
|
function getHandledErrorMsg(message, messageArgs) {
|
|
59
67
|
if (messageArgs === void 0) { messageArgs = []; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invariantWrappers.js","sourceRoot":"","sources":["../../../src/utilities/globals/invariantWrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,SAAS,IAAI,CAAC,EAA0C;IACtD,OAAO,UAAU,OAAyB;QAAE,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,6BAAc;;QACxD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,IAAM,IAAI,GAAG,OAAO,CAAC;YACrB,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,GAAG,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC1C,IAAI,GAAG,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QACD,EAAE,eAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;IAChC,CAAC,CAAC;AACJ,CAAC;AAgDD,IAAM,SAAS,GAAqB,MAAM,CAAC,MAAM,CAC/C,SAAS,SAAS,CAChB,SAAc,EACd,OAAyB;IACzB,cAAkB;SAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;QAAlB,6BAAkB;;IAElB,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,iBAAiB,CACf,SAAS,EACT,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CACxE,CAAC;IACJ,CAAC;AACH,CAAC,EACD;IACE,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;IACpC,GAAG,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC;IAChC,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;IAClC,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;CACrC,CACF,CAAC;AAEF;;;;;;;;;GASG;AACH,SAAS,iBAAiB,CACxB,OAAyB;IACzB,wBAA4B;SAA5B,UAA4B,EAA5B,qBAA4B,EAA5B,IAA4B;QAA5B,uCAA4B;;IAE5B,OAAO,IAAI,cAAc,CACvB,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC;QACzC,mBAAmB,CAAC,OAAO,EAAE,cAAc,CAAC,CAC/C,CAAC;AACJ,CAAC;AAED,IAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAC1C,4BAA4B,GAAG,OAAO,CACvC,CAAC;AASF,SAAS,SAAS,CAAC,GAAQ;IACzB,
|
|
1
|
+
{"version":3,"file":"invariantWrappers.js","sourceRoot":"","sources":["../../../src/utilities/globals/invariantWrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,SAAS,IAAI,CAAC,EAA0C;IACtD,OAAO,UAAU,OAAyB;QAAE,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,6BAAc;;QACxD,IAAI,OAAO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C;AAED,IAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAC1C,4BAA4B,GAAG,OAAO,CACvC,CAAC;AASF,SAAS,SAAS,CAAC,GAAQ;IACzB,IAAI,OAAO,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,oBAAoB,CAAC;IAC9B,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CACzB,OAAyB,EACzB,WAA2B;IAA3B,4BAAA,EAAA,gBAA2B;IAE3B,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,OAAO,CACL,MAAM,CAAC,yBAAyB,CAAC;QACjC,MAAM,CAAC,yBAAyB,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CACvE,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,OAAyB,EACzB,WAA2B;IAA3B,4BAAA,EAAA,gBAA2B;IAE3B,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,OAAO,sGAA+F,kBAAkB,CACtH,IAAI,CAAC,SAAS,CAAC;QACb,OAAO,SAAA;QACP,OAAO,SAAA;QACP,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC;KACjC,CAAC,CACH,CAAE,CAAC;AACN,CAAC;AAED,OAAO,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,yBAAyB,GAC1B,CAAC","sourcesContent":["import { invariant as originalInvariant, InvariantError } from \"ts-invariant\";\nimport { version } from \"../../version.js\";\nimport global from \"./global.js\";\nimport type { ErrorCodes } from \"../../invariantErrorCodes.js\";\nimport { stringifyForDisplay } from \"../common/stringifyForDisplay.js\";\n\nfunction wrap(fn: (msg?: string, ...args: any[]) => void) {\n return function (message?: string | number, ...args: any[]) {\n if (typeof message === \"number\") {\n const arg0 = message;\n message = getHandledErrorMsg(arg0);\n if (!message) {\n message = getFallbackErrorMsg(arg0, args);\n args = [];\n }\n }\n fn(...[message].concat(args));\n };\n}\n\ntype LogFunction = {\n /**\n * Logs a `$level` message if the user used `ts-invariant`'s `setVerbosity` to set\n * a verbosity level of `$level` or lower. (defaults to `\"log\"`).\n *\n * The user will either be presented with a link to the documentation for the message,\n * or they can use the `loadDevMessages` to add the message strings to the bundle.\n * The documentation will display the message without argument substitution.\n * Instead, the arguments will be printed on the console after the link.\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 *\n * String substitutions like %s, %o, %d or %f are supported.\n */\n (message?: any, ...optionalParams: unknown[]): void;\n};\n\ntype WrappedInvariant = {\n /**\n * Throws and InvariantError with the given message if the condition is false.\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 *\n * The user will either be presented with a link to the documentation for the message,\n * or they can use the `loadErrorMessages` to add the message strings to the bundle.\n * The documentation will display the message with the arguments substituted.\n *\n * String substitutions with %s are supported and will also return\n * pretty-stringified objects.\n * Excess `optionalParams` will be swallowed.\n */\n (\n condition: any,\n message?: string | number,\n ...optionalParams: unknown[]\n ): asserts condition;\n\n debug: LogFunction;\n log: LogFunction;\n warn: LogFunction;\n error: LogFunction;\n};\nconst invariant: WrappedInvariant = Object.assign(\n function invariant(\n condition: any,\n message?: string | number,\n ...args: unknown[]\n ): asserts condition {\n if (!condition) {\n originalInvariant(\n condition,\n getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args)\n );\n }\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\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(\n message?: string | number,\n ...optionalParams: unknown[]\n) {\n return new InvariantError(\n getHandledErrorMsg(message, optionalParams) ||\n getFallbackErrorMsg(message, optionalParams)\n );\n}\n\nconst ApolloErrorMessageHandler = Symbol.for(\n \"ApolloErrorMessageHandler_\" + version\n);\ndeclare global {\n interface Window {\n [ApolloErrorMessageHandler]?: {\n (message: string | number, args: string[]): string | undefined;\n } & ErrorCodes;\n }\n}\n\nfunction stringify(arg: any) {\n if (typeof arg == \"string\") {\n return arg;\n }\n\n try {\n return stringifyForDisplay(arg, 2).slice(0, 1000);\n } catch {\n return \"<non-serializable>\";\n }\n}\n\nfunction getHandledErrorMsg(\n message?: string | number,\n messageArgs: unknown[] = []\n) {\n if (!message) return;\n return (\n global[ApolloErrorMessageHandler] &&\n global[ApolloErrorMessageHandler](message, messageArgs.map(stringify))\n );\n}\n\nfunction getFallbackErrorMsg(\n message?: string | number,\n messageArgs: unknown[] = []\n) {\n if (!message) return;\n return `An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(\n JSON.stringify({\n version,\n message,\n args: messageArgs.map(stringify),\n })\n )}`;\n}\n\nexport {\n invariant,\n InvariantError,\n newInvariantError,\n ApolloErrorMessageHandler,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.d.ts";
|
|
@@ -4,6 +4,6 @@ export type CreateMultipartSubscriptionOptions = {
|
|
|
4
4
|
};
|
|
5
5
|
export declare function generateOptionsForMultipartSubscription(headers: Record<string, string>): {
|
|
6
6
|
headers: Record<string, any>;
|
|
7
|
-
body?: string
|
|
7
|
+
body?: string;
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.d.ts";
|
package/utilities/utilities.cjs
CHANGED
|
@@ -84,15 +84,16 @@ function getInclusionDirectives(directives) {
|
|
|
84
84
|
return result;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
var isReactNative = globals.maybe(function () { return navigator.product; }) == "ReactNative";
|
|
87
88
|
var canUseWeakMap = typeof WeakMap === "function" &&
|
|
88
|
-
!
|
|
89
|
+
!(isReactNative && !global.HermesInternal);
|
|
89
90
|
var canUseWeakSet = typeof WeakSet === "function";
|
|
90
91
|
var canUseSymbol = typeof Symbol === "function" && typeof Symbol.for === "function";
|
|
91
92
|
var canUseAsyncIteratorSymbol = canUseSymbol && Symbol.asyncIterator;
|
|
92
93
|
var canUseDOM = typeof globals.maybe(function () { return window.document.createElement; }) === "function";
|
|
93
94
|
var usingJSDOM =
|
|
94
95
|
globals.maybe(function () { return navigator.userAgent.indexOf("jsdom") >= 0; }) || false;
|
|
95
|
-
var canUseLayoutEffect = canUseDOM && !usingJSDOM;
|
|
96
|
+
var canUseLayoutEffect = (canUseDOM || isReactNative) && !usingJSDOM;
|
|
96
97
|
|
|
97
98
|
function isNonNullObject(obj) {
|
|
98
99
|
return obj !== null && typeof obj === "object";
|