diff --git a/.changeset/early-tips-vanish.md b/.changeset/early-tips-vanish.md new file mode 100644 index 00000000000..3c794284f8e --- /dev/null +++ b/.changeset/early-tips-vanish.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": patch +--- + +`createSchemaFetch`: simulate serialized errors instead of an `ApolloError` instance diff --git a/package-lock.json b/package-lock.json index 25422172c98..c9065d07452 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2233,38 +2233,6 @@ } } }, - "node_modules/@jest/core/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/core/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/core/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/@jest/environment": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", @@ -3567,38 +3535,6 @@ "pretty-format": "^29.0.0" } }, - "node_modules/@types/jest/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@types/jest/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@types/jest/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/@types/jsdom": { "version": "20.0.0", "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.0.tgz", @@ -8109,18 +8045,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-circus/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/jest-circus/node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -8136,26 +8060,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-circus/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-circus/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-cli": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", @@ -8234,18 +8138,6 @@ } } }, - "node_modules/jest-config/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/jest-config/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -8266,26 +8158,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-config/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-config/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-diff": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", @@ -8301,38 +8173,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-diff/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-diff/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-diff/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-docblock": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", @@ -8361,38 +8201,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-each/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-each/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-environment-jsdom": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz", @@ -8499,38 +8307,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-leak-detector/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-leak-detector/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-leak-detector/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-matcher-utils": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", @@ -8546,38 +8322,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-matcher-utils/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-message-util": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", @@ -8598,38 +8342,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-message-util/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-message-util/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-mock": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", @@ -8844,38 +8556,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-snapshot/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-snapshot/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-snapshot/node_modules/semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -8922,18 +8602,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-validate/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/jest-validate/node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -8946,26 +8614,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-validate/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-validate/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/jest-watcher": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", @@ -10435,17 +10083,17 @@ } }, "node_modules/pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" + "react-is": "^18.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/pretty-format/node_modules/ansi-styles": { @@ -10461,9 +10109,9 @@ } }, "node_modules/pretty-format/node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, "node_modules/prompts": { diff --git a/package.json b/package.json index 7fead782a5e..6bea971ff0a 100644 --- a/package.json +++ b/package.json @@ -204,5 +204,8 @@ "**/*.js.map", "**/*.d.ts", "**/*.json" - ] + ], + "overrides": { + "pretty-format": "^29.7.0" + } } diff --git a/patches/pretty-format+29.7.0.patch b/patches/pretty-format+29.7.0.patch new file mode 100644 index 00000000000..d3d733f80fb --- /dev/null +++ b/patches/pretty-format+29.7.0.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/pretty-format/build/index.js b/node_modules/pretty-format/build/index.js +index 8d3a562..879eed7 100644 +--- a/node_modules/pretty-format/build/index.js ++++ b/node_modules/pretty-format/build/index.js +@@ -103,6 +103,9 @@ function printBasicValue(val, printFunctionName, escapeRegex, escapeString) { + if (val === null) { + return 'null'; + } ++ if (val.name === 'ApolloError' || val.name === 'GraphQLError') { ++ return null ++ } + const typeOf = typeof val; + if (typeOf === 'number') { + return printNumber(val); diff --git a/src/__tests__/ApolloClient.ts b/src/__tests__/ApolloClient.ts index 599a29f9a39..bcf9978ef90 100644 --- a/src/__tests__/ApolloClient.ts +++ b/src/__tests__/ApolloClient.ts @@ -2735,7 +2735,9 @@ describe("ApolloClient", () => { expect(invariantDebugSpy).toHaveBeenCalledTimes(1); expect(invariantDebugSpy).toHaveBeenCalledWith( "In client.refetchQueries, Promise.all promise rejected with error %o", - new ApolloError({ errorMessage: "refetch failed" }) + new ApolloError({ + networkError: new Error("refetch failed"), + }) ); resolve(); } catch (err) { diff --git a/src/__tests__/__snapshots__/graphqlSubscriptions.ts.snap b/src/__tests__/__snapshots__/graphqlSubscriptions.ts.snap index c32d90c0954..cec1ed33bf9 100644 --- a/src/__tests__/__snapshots__/graphqlSubscriptions.ts.snap +++ b/src/__tests__/__snapshots__/graphqlSubscriptions.ts.snap @@ -1,5 +1,67 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`GraphQL Subscriptions should throw an error if the result has errors on it 1`] = `[ApolloError: This is an error]`; +exports[`GraphQL Subscriptions should throw an error if the result has errors on it 1`] = ` +ApolloError { + "cause": Object { + "locations": Array [ + Object { + "column": 3, + "line": 2, + }, + ], + "message": "This is an error", + "path": Array [ + "result", + ], + }, + "clientErrors": Array [], + "extraInfo": undefined, + "graphQLErrors": Array [ + Object { + "locations": Array [ + Object { + "column": 3, + "line": 2, + }, + ], + "message": "This is an error", + "path": Array [ + "result", + ], + }, + ], + "message": "This is an error", + "name": "ApolloError", + "networkError": null, + "protocolErrors": Array [], +} +`; -exports[`GraphQL Subscriptions should throw an error if the result has protocolErrors on it 1`] = `[ApolloError: cannot read message from websocket]`; +exports[`GraphQL Subscriptions should throw an error if the result has protocolErrors on it 1`] = ` +ApolloError { + "cause": Object { + "extensions": Array [ + Object { + "code": "WEBSOCKET_MESSAGE_ERROR", + }, + ], + "message": "cannot read message from websocket", + }, + "clientErrors": Array [], + "extraInfo": undefined, + "graphQLErrors": Array [], + "message": "cannot read message from websocket", + "name": "ApolloError", + "networkError": null, + "protocolErrors": Array [ + Object { + "extensions": Array [ + Object { + "code": "WEBSOCKET_MESSAGE_ERROR", + }, + ], + "message": "cannot read message from websocket", + }, + ], +} +`; diff --git a/src/__tests__/client.ts b/src/__tests__/client.ts index c16b01d593e..fd49358b6d4 100644 --- a/src/__tests__/client.ts +++ b/src/__tests__/client.ts @@ -2855,7 +2855,7 @@ describe("client", () => { const lastError = observable.getLastError(); expect(lastError).toBeInstanceOf(ApolloError); - expect(lastError!.networkError).toEqual(error); + expect(lastError!.networkError).toEqual((error as any).networkError); const lastResult = observable.getLastResult(); expect(lastResult).toBeTruthy(); diff --git a/src/config/jest/areApolloErrorsEqual.ts b/src/config/jest/areApolloErrorsEqual.ts new file mode 100644 index 00000000000..0724c023986 --- /dev/null +++ b/src/config/jest/areApolloErrorsEqual.ts @@ -0,0 +1,26 @@ +import type { ApolloError } from "../../errors/index.js"; +import type { Tester } from "@jest/expect-utils"; +function isApolloError(e: any): e is ApolloError { + return e instanceof Error && e.name == "ApolloError"; +} + +export const areApolloErrorsEqual: Tester = function (a, b, customTesters) { + const isAApolloError = isApolloError(a); + const isBApolloError = isApolloError(b); + + if (isAApolloError && isBApolloError) { + return ( + a.message === b.message && + this.equals(a.graphQLErrors, b.graphQLErrors, customTesters) && + this.equals(a.protocolErrors, b.protocolErrors, customTesters) && + this.equals(a.clientErrors, b.clientErrors, customTesters) && + this.equals(a.networkError, b.networkError, customTesters) && + this.equals(a.cause, b.cause, customTesters) && + this.equals(a.extraInfo, b.extraInfo, customTesters) + ); + } else if (isAApolloError === isBApolloError) { + return undefined; + } else { + return false; + } +}; diff --git a/src/config/jest/areGraphQlErrorsEqual.ts b/src/config/jest/areGraphQlErrorsEqual.ts new file mode 100644 index 00000000000..44b681228ed --- /dev/null +++ b/src/config/jest/areGraphQlErrorsEqual.ts @@ -0,0 +1,12 @@ +import { GraphQLError } from "graphql"; +import type { Tester } from "@jest/expect-utils"; + +export const areGraphQLErrorsEqual: Tester = function (a, b, customTesters) { + if (a instanceof GraphQLError || b instanceof GraphQLError) { + return this.equals( + a instanceof GraphQLError ? a.toJSON() : a, + b instanceof GraphQLError ? b.toJSON() : b, + customTesters + ); + } +}; diff --git a/src/config/jest/setup.ts b/src/config/jest/setup.ts index f5ad519835f..f5b6a3e2496 100644 --- a/src/config/jest/setup.ts +++ b/src/config/jest/setup.ts @@ -2,6 +2,8 @@ import gql from "graphql-tag"; import "@testing-library/jest-dom"; import { loadErrorMessageHandler } from "../../dev/loadErrorMessageHandler.js"; import "../../testing/matchers/index.js"; +import { areApolloErrorsEqual } from "./areApolloErrorsEqual.js"; +import { areGraphQLErrorsEqual } from "./areGraphQlErrorsEqual.js"; // Turn off warnings for repeated fragment names gql.disableFragmentWarnings(); @@ -27,3 +29,6 @@ if (!Symbol.asyncDispose) { value: Symbol("asyncDispose"), }); } + +// @ts-ignore +expect.addEqualityTesters([areApolloErrorsEqual, areGraphQLErrorsEqual]); diff --git a/src/core/__tests__/ObservableQuery.ts b/src/core/__tests__/ObservableQuery.ts index 98c1f735026..b103fb38915 100644 --- a/src/core/__tests__/ObservableQuery.ts +++ b/src/core/__tests__/ObservableQuery.ts @@ -92,6 +92,9 @@ describe("ObservableQuery", () => { const error = new GraphQLError("is offline.", undefined, null, null, [ "people_one", ]); + const wrappedError = new ApolloError({ + graphQLErrors: [error], + }); const createQueryManager = ({ link }: { link: ApolloLink }) => { return new QueryManager({ @@ -2136,9 +2139,9 @@ describe("ObservableQuery", () => { .result() .then(() => reject("Observable did not error when it should have")) .catch((currentError) => { - expect(currentError).toEqual(error); + expect(currentError).toEqual(wrappedError); const lastError = observable.getLastError(); - expect(lastError).toEqual(error); + expect(lastError).toEqual(wrappedError); resolve(); }) .catch(reject); @@ -2177,9 +2180,9 @@ describe("ObservableQuery", () => { ) ) .catch((currentError) => { - expect(currentError).toEqual(error); + expect(currentError).toEqual(wrappedError); const lastError = observable.getLastError(); - expect(lastError).toEqual(error); + expect(lastError).toEqual(wrappedError); resolve(); }) .catch(reject) diff --git a/src/react/components/__tests__/client/Mutation.test.tsx b/src/react/components/__tests__/client/Mutation.test.tsx index fc88f76b44e..7a88e64b5ae 100644 --- a/src/react/components/__tests__/client/Mutation.test.tsx +++ b/src/react/components/__tests__/client/Mutation.test.tsx @@ -305,7 +305,9 @@ describe("General Mutation testing", () => { {(createTodo: any) => { if (!called) { createTodo().catch((error: any) => { - expect(error).toEqual(new Error("Error 1")); + expect(error).toEqual( + new ApolloError({ networkError: new Error("Error 1") }) + ); done = true; }); } @@ -382,9 +384,13 @@ describe("General Mutation testing", () => { const onError = (error: Error) => { if (count === 1) { - expect(error).toEqual(new Error("Error 1")); + expect(error).toEqual( + new ApolloError({ networkError: new Error("Error 1") }) + ); } else if (count === 3) { - expect(error).toEqual(new Error("Error 2")); + expect(error).toEqual( + new ApolloError({ networkError: new Error("Error 2") }) + ); } }; const Component = () => ( @@ -402,7 +408,9 @@ describe("General Mutation testing", () => { expect(result.loading).toEqual(false); expect(result.data).toEqual(undefined); expect(result.called).toEqual(true); - expect(result.error).toEqual(new Error("Error 2")); + expect(result.error).toEqual( + new ApolloError({ networkError: new Error("Error 2") }) + ); } count++; return
; @@ -499,12 +507,16 @@ describe("General Mutation testing", () => { {(createTodo: any, result: any) => { if (count === 0) { createTodo().catch((err: any) => { - expect(err).toEqual(new Error("error occurred")); + expect(err).toEqual( + new ApolloError({ networkError: new Error("error occurred") }) + ); }); } else if (count === 1) { expect(result.loading).toBeTruthy(); } else if (count === 2) { - expect(result.error).toEqual(new Error("error occurred")); + expect(result.error).toEqual( + new ApolloError({ networkError: new Error("error occurred") }) + ); } count++; return ; diff --git a/src/react/components/__tests__/client/Query.test.tsx b/src/react/components/__tests__/client/Query.test.tsx index 9182e61e19e..d8027c0c509 100644 --- a/src/react/components/__tests__/client/Query.test.tsx +++ b/src/react/components/__tests__/client/Query.test.tsx @@ -213,7 +213,9 @@ describe("Query component", () => { return null; } try { - expect(result.error).toEqual(new Error("error occurred")); + expect(result.error).toEqual( + new ApolloError({ networkError: new Error("error occurred") }) + ); finished = true; } catch (error) { reject(error); diff --git a/src/react/components/__tests__/client/Subscription.test.tsx b/src/react/components/__tests__/client/Subscription.test.tsx index ec4deaa629c..1604623810f 100644 --- a/src/react/components/__tests__/client/Subscription.test.tsx +++ b/src/react/components/__tests__/client/Subscription.test.tsx @@ -2,7 +2,7 @@ import React from "react"; import gql from "graphql-tag"; import { render, waitFor } from "@testing-library/react"; -import { ApolloClient } from "../../../../core"; +import { ApolloClient, ApolloError } from "../../../../core"; import { InMemoryCache as Cache } from "../../../../cache"; import { ApolloProvider } from "../../../context"; import { ApolloLink, DocumentNode, Operation } from "../../../../link/core"; @@ -390,7 +390,9 @@ itAsync("renders an error", (resolve, reject) => { expect(error).toBeUndefined(); } else if (count === 1) { expect(loading).toBe(false); - expect(error).toEqual(new Error("error occurred")); + expect(error).toEqual( + new ApolloError({ protocolErrors: [new Error("error occurred")] }) + ); expect(data).toBeUndefined(); } } catch (error) { diff --git a/src/react/hooks/__tests__/useLazyQuery.test.tsx b/src/react/hooks/__tests__/useLazyQuery.test.tsx index 08f94df5c60..df38ea6adc0 100644 --- a/src/react/hooks/__tests__/useLazyQuery.test.tsx +++ b/src/react/hooks/__tests__/useLazyQuery.test.tsx @@ -1069,14 +1069,14 @@ describe("useLazyQuery Hook", () => { { request: { query: helloQuery }, result: { - errors: [new GraphQLError("error 1")], + errors: [{ message: "error 1" }], }, delay: 20, }, { request: { query: helloQuery }, result: { - errors: [new GraphQLError("error 2")], + errors: [{ message: "error 2" }], }, delay: 20, }, @@ -1111,7 +1111,9 @@ describe("useLazyQuery Hook", () => { const [, result] = await ProfiledHook.takeSnapshot(); expect(result.loading).toBe(false); expect(result.data).toBeUndefined(); - expect(result.error).toEqual(new Error("error 1")); + expect(result.error).toEqual( + new ApolloError({ graphQLErrors: [{ message: "error 1" }] }) + ); } await executePromise.then((result) => { @@ -1126,14 +1128,18 @@ describe("useLazyQuery Hook", () => { const [, result] = await ProfiledHook.takeSnapshot(); expect(result.loading).toBe(true); expect(result.data).toBeUndefined(); - expect(result.error).toEqual(new Error("error 1")); + expect(result.error).toEqual( + new ApolloError({ graphQLErrors: [{ message: "error 1" }] }) + ); } { const [, result] = await ProfiledHook.takeSnapshot(); expect(result.loading).toBe(false); expect(result.data).toBeUndefined(); - expect(result.error).toEqual(new Error("error 2")); + expect(result.error).toEqual( + new ApolloError({ graphQLErrors: [{ message: "error 2" }] }) + ); } }); diff --git a/src/react/hooks/__tests__/useMutation.test.tsx b/src/react/hooks/__tests__/useMutation.test.tsx index 452b1ad77de..da26fd2c87d 100644 --- a/src/react/hooks/__tests__/useMutation.test.tsx +++ b/src/react/hooks/__tests__/useMutation.test.tsx @@ -8,6 +8,7 @@ import fetchMock from "fetch-mock"; import { ApolloClient, + ApolloError, ApolloLink, ApolloQueryResult, Cache, @@ -346,7 +347,7 @@ describe("useMutation Hook", () => { variables, }, result: { - errors: [new GraphQLError(CREATE_TODO_ERROR)], + errors: [{ message: CREATE_TODO_ERROR }], }, }, ]; @@ -371,7 +372,9 @@ describe("useMutation Hook", () => { throw new Error("function did not error"); }); - expect(fetchError).toEqual(new GraphQLError(CREATE_TODO_ERROR)); + expect(fetchError).toEqual( + new ApolloError({ graphQLErrors: [{ message: CREATE_TODO_ERROR }] }) + ); }); it(`should reject when errorPolicy is 'none'`, async () => { @@ -961,14 +964,13 @@ describe("useMutation Hook", () => { expect(fetchResult).toEqual({ data: undefined, - // Not sure why we unwrap errors here. - errors: errors[0], + errors: new ApolloError({ graphQLErrors: errors }), }); expect(onCompleted).toHaveBeenCalledTimes(0); expect(onError).toHaveBeenCalledTimes(1); expect(onError).toHaveBeenCalledWith( - errors[0], + new ApolloError({ graphQLErrors: errors }), expect.objectContaining({ variables }) ); }); @@ -1012,7 +1014,7 @@ describe("useMutation Hook", () => { }); it("should allow updating onError while mutation is executing", async () => { - const errors = [new GraphQLError(CREATE_TODO_ERROR)]; + const errors = [{ message: CREATE_TODO_ERROR }]; const variables = { priority: "Low", description: "Get milk.", @@ -1060,15 +1062,14 @@ describe("useMutation Hook", () => { expect(fetchResult).toEqual({ data: undefined, - // Not sure why we unwrap errors here. - errors: errors[0], + errors: new ApolloError({ graphQLErrors: errors }), }); expect(onCompleted).toHaveBeenCalledTimes(0); expect(onError).toHaveBeenCalledTimes(0); expect(onError1).toHaveBeenCalledTimes(1); expect(onError1).toHaveBeenCalledWith( - errors[0], + new ApolloError({ graphQLErrors: errors }), expect.objectContaining({ variables }) ); }); diff --git a/src/testing/experimental/__tests__/createTestSchema.test.tsx b/src/testing/experimental/__tests__/createTestSchema.test.tsx index 99b579ddde2..60ad1e08bd5 100644 --- a/src/testing/experimental/__tests__/createTestSchema.test.tsx +++ b/src/testing/experimental/__tests__/createTestSchema.test.tsx @@ -13,7 +13,7 @@ import { spyOnConsole, } from "../../internal/index.js"; import { createTestSchema } from "../createTestSchema.js"; -import { GraphQLError, buildSchema } from "graphql"; +import { buildSchema } from "graphql"; import type { UseSuspenseQueryResult } from "../../../react/index.js"; import { useMutation, useSuspenseQuery } from "../../../react/index.js"; import userEvent from "@testing-library/user-event"; @@ -740,7 +740,9 @@ describe("schema proxy", () => { expect(snapshot.error).toEqual( new ApolloError({ - graphQLErrors: [new GraphQLError("Could not resolve type")], + graphQLErrors: [ + { message: "Could not resolve type", path: ["viewer", "book"] }, + ], }) ); } @@ -816,7 +818,7 @@ describe("schema proxy", () => { expect(snapshot.error).toEqual( new ApolloError({ graphQLErrors: [ - new GraphQLError('Expected { foo: "bar" } to be a GraphQL schema.'), + { message: 'Expected { foo: "bar" } to be a GraphQL schema.' }, ], }) ); diff --git a/src/testing/experimental/createSchemaFetch.ts b/src/testing/experimental/createSchemaFetch.ts index 9f018156cf1..c8eb9374759 100644 --- a/src/testing/experimental/createSchemaFetch.ts +++ b/src/testing/experimental/createSchemaFetch.ts @@ -1,6 +1,6 @@ -import { execute, validate } from "graphql"; +import { execute, GraphQLError, validate } from "graphql"; import type { GraphQLFormattedError, GraphQLSchema } from "graphql"; -import { ApolloError, gql } from "../../core/index.js"; +import { gql } from "../../core/index.js"; import { withCleanup } from "../internal/index.js"; import { wait } from "../core/wait.js"; @@ -63,22 +63,15 @@ const createSchemaFetch = ( const document = gql(body.query); if (mockFetchOpts.validate) { - let validationErrors: readonly Error[] = []; + let validationErrors: readonly GraphQLFormattedError[] = []; try { validationErrors = validate(schema, document); } catch (e) { validationErrors = [ - new ApolloError({ - graphQLErrors: [ - /* - * Technically, these are even `GraphQLError` instances, - * but we try to avoid referencing that type, and `GraphQLError` - * implements the `GraphQLFormattedError` interface. - */ - e as GraphQLFormattedError, - ], - }), + e instanceof Error ? + GraphQLError.prototype.toJSON.apply(e) + : (e as any), ]; } diff --git a/src/testing/react/__tests__/MockedProvider.test.tsx b/src/testing/react/__tests__/MockedProvider.test.tsx index 4ebd0878a43..f4a5caed150 100644 --- a/src/testing/react/__tests__/MockedProvider.test.tsx +++ b/src/testing/react/__tests__/MockedProvider.test.tsx @@ -10,6 +10,7 @@ import { InMemoryCache } from "../../../cache"; import { QueryResult } from "../../../react/types/types"; import { ApolloLink, FetchResult } from "../../../link/core"; import { Observable } from "zen-observable-ts"; +import { ApolloError } from "../../../errors"; const variables = { username: "mock_username", @@ -422,7 +423,9 @@ describe("General use", () => { variables, }); if (!loading) { - expect(error).toEqual(new Error("something went wrong")); + expect(error).toEqual( + new ApolloError({ networkError: new Error("something went wrong") }) + ); finished = true; } return null; diff --git a/src/testing/react/__tests__/__snapshots__/MockedProvider.test.tsx.snap b/src/testing/react/__tests__/__snapshots__/MockedProvider.test.tsx.snap index 6706568ffd2..e6dfab1ab04 100644 --- a/src/testing/react/__tests__/__snapshots__/MockedProvider.test.tsx.snap +++ b/src/testing/react/__tests__/__snapshots__/MockedProvider.test.tsx.snap @@ -8,18 +8,42 @@ Object { `; exports[`General use should error if the query in the mock and component do not match 1`] = ` -[ApolloError: No more mocked responses for the query: query GetUser($username: String!) { +ApolloError { + "cause": [Error: No more mocked responses for the query: query GetUser($username: String!) { user(username: $username) { id __typename } } Expected variables: {"username":"mock_username"} -] +], + "clientErrors": Array [], + "extraInfo": undefined, + "graphQLErrors": Array [], + "message": "No more mocked responses for the query: query GetUser($username: String!) { + user(username: $username) { + id + __typename + } +} +Expected variables: {\\"username\\":\\"mock_username\\"} +", + "name": "ApolloError", + "networkError": [Error: No more mocked responses for the query: query GetUser($username: String!) { + user(username: $username) { + id + __typename + } +} +Expected variables: {"username":"mock_username"} +], + "protocolErrors": Array [], +} `; exports[`General use should error if the variableMatcher returns false 1`] = ` -[ApolloError: No more mocked responses for the query: query GetUser($username: String!) { +ApolloError { + "cause": [Error: No more mocked responses for the query: query GetUser($username: String!) { user(username: $username) { id __typename @@ -29,11 +53,40 @@ Expected variables: {"username":"mock_username"} Failed to match 1 mock for this query. The mocked response had the following variables: {} -] +], + "clientErrors": Array [], + "extraInfo": undefined, + "graphQLErrors": Array [], + "message": "No more mocked responses for the query: query GetUser($username: String!) { + user(username: $username) { + id + __typename + } +} +Expected variables: {\\"username\\":\\"mock_username\\"} + +Failed to match 1 mock for this query. The mocked response had the following variables: + {} +", + "name": "ApolloError", + "networkError": [Error: No more mocked responses for the query: query GetUser($username: String!) { + user(username: $username) { + id + __typename + } +} +Expected variables: {"username":"mock_username"} + +Failed to match 1 mock for this query. The mocked response had the following variables: + {} +], + "protocolErrors": Array [], +} `; exports[`General use should error if the variables do not deep equal 1`] = ` -[ApolloError: No more mocked responses for the query: query GetUser($username: String!) { +ApolloError { + "cause": [Error: No more mocked responses for the query: query GetUser($username: String!) { user(username: $username) { id __typename @@ -43,11 +96,40 @@ Expected variables: {"username":"some_user","age":42} Failed to match 1 mock for this query. The mocked response had the following variables: {"age":13,"username":"some_user"} -] +], + "clientErrors": Array [], + "extraInfo": undefined, + "graphQLErrors": Array [], + "message": "No more mocked responses for the query: query GetUser($username: String!) { + user(username: $username) { + id + __typename + } +} +Expected variables: {\\"username\\":\\"some_user\\",\\"age\\":42} + +Failed to match 1 mock for this query. The mocked response had the following variables: + {\\"age\\":13,\\"username\\":\\"some_user\\"} +", + "name": "ApolloError", + "networkError": [Error: No more mocked responses for the query: query GetUser($username: String!) { + user(username: $username) { + id + __typename + } +} +Expected variables: {"username":"some_user","age":42} + +Failed to match 1 mock for this query. The mocked response had the following variables: + {"age":13,"username":"some_user"} +], + "protocolErrors": Array [], +} `; exports[`General use should error if the variables in the mock and component do not match 1`] = ` -[ApolloError: No more mocked responses for the query: query GetUser($username: String!) { +ApolloError { + "cause": [Error: No more mocked responses for the query: query GetUser($username: String!) { user(username: $username) { id __typename @@ -57,7 +139,35 @@ Expected variables: {"username":"other_user","age":