From 8c6cdb88206a2771a084b95292eda64508387b06 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:39:26 -0400 Subject: [PATCH 01/35] Committing initial JS Commiting the initial JS work that was done, before making changes to adjust how the field policies are handled from the JS side and add extra validation around lists. --- .../JavaScript/package-lock.json | 191 +++-------- .../GraphQLCompiler/JavaScript/package.json | 6 +- .../__tests__/fieldPolicyDirectiveTests.ts | 306 ++++++++++++++++++ .../sourceDefinitionTransformTests.ts | 10 +- .../GraphQLCompiler/JavaScript/src/index.ts | 4 +- .../utilities/apolloCodegenSchemaExtension.ts | 23 ++ .../src/utilities/fieldPolicyDirective.ts | 196 +++++++++++ .../JavaScript/tsconfig.base.json | 2 +- .../JavaScript/tsconfig.test.base.json | 2 +- 9 files changed, 589 insertions(+), 151 deletions(-) create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json index 97cfebf9e..8b5894598 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json @@ -18,7 +18,7 @@ "@rollup/plugin-terser": "0.4.4", "@rollup/plugin-typescript": "12.1.2", "@types/common-tags": "1.8.4", - "@types/jest": "29.5.14", + "@types/jest": "^29.5.14", "common-tags": "1.8.2", "jest": "29.7.0", "rollup": "4.41.1", @@ -43,13 +43,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dev": true, "dependencies": { - "@babel/highlight": "^7.24.7", - "picocolors": "^1.0.0" + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" @@ -229,18 +230,18 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "dev": true, "engines": { "node": ">=6.9.0" @@ -256,109 +257,26 @@ } }, "node_modules/@babel/helpers": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.8.tgz", - "integrity": "sha512-gV2265Nkcz7weJJfvDoAEVzC1e2OTDpkGbEsebse8koXUJUXPsCMi7sRo/+SPMuMZ9MtUPnGwITTnQnU5YjyaQ==", - "dev": true, - "dependencies": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.8" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.6.tgz", + "integrity": "sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "@babel/template": "^7.27.2", + "@babel/types": "^7.27.6" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@babel/parser": { + "version": "7.27.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.5.tgz", + "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "@babel/types": "^7.27.3" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.8.tgz", - "integrity": "sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==", - "dev": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -544,14 +462,14 @@ } }, "node_modules/@babel/template": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", - "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -579,14 +497,13 @@ } }, "node_modules/@babel/types": { - "version": "7.24.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.9.tgz", - "integrity": "sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ==", + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", + "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1" }, "engines": { "node": ">=6.9.0" @@ -1473,7 +1390,6 @@ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, - "license": "MIT", "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" @@ -1708,9 +1624,9 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "dependencies": { "balanced-match": "^1.0.0", @@ -1969,9 +1885,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -2198,9 +2114,9 @@ } }, "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "dependencies": { "balanced-match": "^1.0.0" @@ -3330,9 +3246,9 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", @@ -3535,9 +3451,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "node_modules/picomatch": { @@ -4003,15 +3919,6 @@ "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json index 591dc4fb9..9bf5fc589 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json @@ -18,14 +18,14 @@ }, "devDependencies": { "@rollup/plugin-node-resolve": "16.0.1", - "@rollup/plugin-typescript": "12.1.2", "@rollup/plugin-replace": "6.0.2", + "@rollup/plugin-terser": "0.4.4", + "@rollup/plugin-typescript": "12.1.2", "@types/common-tags": "1.8.4", - "@types/jest": "29.5.14", + "@types/jest": "^29.5.14", "common-tags": "1.8.2", "jest": "29.7.0", "rollup": "4.41.1", - "@rollup/plugin-terser": "0.4.4", "ts-jest": "29.3.4", "typescript": "5.8.3" } diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts new file mode 100644 index 000000000..52a3e85e7 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts @@ -0,0 +1,306 @@ +import { + GraphQLError, + type GraphQLNamedType, + type GraphQLSchema, + Source, +} from "graphql"; +import { loadSchemaFromSources } from ".."; + +type ObjectWithMeta = GraphQLNamedType & { + _apolloFieldPolicies: Record; +}; + +describe("given SDL without fieldPolicy", () => { + const schemaSDL: string = ` + type Query { + allRectangles(ids: [ID!]): [Rectangle!] + } + + interface Shape { + surface: Int! + } + + type Rectangle { + width: Int! + height: Int! + } + `; + + it("should set empty _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const rect = schema.getTypeMap()["Rectangle"] as ObjectWithMeta; + expect(Object.keys(rect._apolloFieldPolicies)).toHaveLength(0); + + const shape = schema.getTypeMap()["Shape"] as ObjectWithMeta; + expect(Object.keys(shape._apolloFieldPolicies)).toHaveLength(0); + }); +}); + +describe("given SDL with valid fieldPolicy", () => { + const schemaSDL: string = ` + type Query { + allRectangles(withWidth: Int!): [Rectangle!] + } + + type Rectangle { + width: Int! + height: Int! + } + + extend type Query @fieldPolicy(forField: "allRectangles", keyArgs: "withWidth") + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const queryType = schema.getTypeMap()["Query"] as ObjectWithMeta; + expect(queryType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(queryType._apolloFieldPolicies!)).toHaveLength(1); + expect(queryType._apolloFieldPolicies).toHaveProperty("allRectangles"); + expect(queryType._apolloFieldPolicies?.allRectangles).toEqual(["withWidth"]); + }); +}); + +describe("given fieldPolicy on interface extension", () => { + const schemaSDL: string = ` + interface Animal { + allAnimals(ofSpecies: String): [Animal!] + + id: ID! + species: String! + } + + type Dog implements Animal { + allAnimals(ofSpecies: String): [Animal!] + + id: ID! + species: String! + owner: String + } + + extend interface Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const animalType = schema.getTypeMap()["Animal"] as ObjectWithMeta; + expect(animalType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(animalType._apolloFieldPolicies!)).toHaveLength(1); + + const dogType = schema.getTypeMap()["Dog"] as ObjectWithMeta; + expect(dogType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(dogType._apolloFieldPolicies!)).toHaveLength(1); + }); +}); + +describe("given fieldPolicy on interface and object extensions", () => { + const schemaSDL: string = ` + interface Animal { + allAnimals(ofSpecies: String): [Animal!] + + id: ID! + species: String! + } + + type Dog implements Animal { + allAnimals(ofSpecies: String): [Animal!] + + id: ID! + species: String! + owner: String + } + + extend interface Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") + extend type Dog @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") + `; + + it("should set _apolloFieldPolicies property without duplicates.", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const animalType = schema.getTypeMap()["Animal"] as ObjectWithMeta; + expect(animalType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(animalType._apolloFieldPolicies!)).toHaveLength(1); + + const dogType = schema.getTypeMap()["Dog"] as ObjectWithMeta; + expect(dogType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(dogType._apolloFieldPolicies!)).toHaveLength(1); + }); +}); + +describe("given fieldPolicy on interface", () => { + const schemaSDL: string = ` + interface Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") { + allAnimals(ofSpecies: String): [Animal!] + + id: ID! + species: String! + } + + type Dog implements Animal { + allAnimals(ofSpecies: String): [Animal!] + + id: ID! + species: String! + owner: String + } + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const animalType = schema.getTypeMap()["Animal"] as ObjectWithMeta; + expect(animalType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(animalType._apolloFieldPolicies!)).toHaveLength(1); + + const dogType = schema.getTypeMap()["Dog"] as ObjectWithMeta; + expect(dogType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(dogType._apolloFieldPolicies!)).toHaveLength(1); + }); +}); + +describe("given fieldPolicy on interface and object", () => { + const schemaSDL: string = ` + interface Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") { + allAnimals(ofSpecies: String): [Animal!] + + id: ID! + species: String! + } + + type Dog implements Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") { + allAnimals(ofSpecies: String): [Animal!] + + id: ID! + species: String! + owner: String + } + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const animalType = schema.getTypeMap()["Animal"] as ObjectWithMeta; + expect(animalType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(animalType._apolloFieldPolicies!)).toHaveLength(1); + + const dogType = schema.getTypeMap()["Dog"] as ObjectWithMeta; + expect(dogType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(dogType._apolloFieldPolicies!)).toHaveLength(1); + }); +}); + +describe("given field with list inputs and non-list return type", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID]!): Animal! + } + + type Animal { + id: ID! + name: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIDs") + `; + + it("should throw error requiring List return type", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + +describe("given field with list inputs and list return type", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID]!): [Animal!] + } + + type Animal { + id: ID! + name: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds") + `; + + it("should throw error requiring List return type", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const queryType = schema.getTypeMap()["Query"] as ObjectWithMeta; + expect(queryType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(queryType._apolloFieldPolicies!)).toHaveLength(1); + expect(queryType._apolloFieldPolicies).toHaveProperty("allAnimals"); + expect(queryType._apolloFieldPolicies?.allAnimals).toEqual(["withIds"]); + }); +}); + +describe("given field policy with multiple valid keyArgs", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID]!, andSpecies: String!): [Animal!] + } + + type Animal { + id: ID! + name: String! + species: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds andSpecies") + `; + + it("should set _apolloFieldPolicies property", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const queryType = schema.getTypeMap()["Query"] as ObjectWithMeta; + expect(queryType._apolloFieldPolicies).toBeDefined(); + expect(Object.keys(queryType._apolloFieldPolicies!)).toHaveLength(1); + expect(queryType._apolloFieldPolicies).toHaveProperty("allAnimals"); + expect(queryType._apolloFieldPolicies?.allAnimals).toEqual(["withIds", "andSpecies"]); + }); +}); + +describe("given field policy with one invalid keyArg", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID]!, andSpecies: String!): [Animal!] + } + + type Animal { + id: ID! + name: String! + species: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds andName") + `; + + it("should throw error for invalid keyArgs", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts index fe6f1270b..f1716aa43 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts @@ -17,17 +17,21 @@ import { emptyValidationOptions } from "../__testUtils__/validationHelpers"; describe("given schema", () => { const schemaSDL: string = `type Query { - allAnimals: [Animal!] + allAnimals(id: String!): [Animal!] } -interface Animal { +interface Animal @typePolicy(keyFields: "id") { + id: String! species: String! friend: Animal! } interface Pet { name: String! -}`; +} + +extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "id") +`; const schema: GraphQLSchema = loadSchemaFromSources([new Source(schemaSDL, "Test Schema", { line: 1, column: 1 })]); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts index 8c2d65204..9018a6213 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts @@ -22,6 +22,7 @@ import { addExperimentalDeferDirectiveToIntrospectionSchema } from "./utilities/experimentalDeferDirective"; import { addTypePolicyDirectivesToSchema } from "./utilities/typePolicyDirective"; +import { addFieldPolicyDirectivesToSchema } from "./utilities/fieldPolicyDirective"; // We need to export all the classes we want to map to native objects, // so we have access to the constructor functions for type checks. @@ -63,6 +64,7 @@ export function loadSchemaFromSources(sources: Source[]): GraphQLSchema { const schema = buildASTSchema(document, { assumeValid: true, assumeValidSDL: true }) addTypePolicyDirectivesToSchema(schema) + addFieldPolicyDirectivesToSchema(schema) assertValidSchema(schema) return schema @@ -72,7 +74,7 @@ export function loadSchemaFromSources(sources: Source[]): GraphQLSchema { document = addExperimentalDeferDirectiveToIntrospectionSchema(schema, document) schema = extendSchema(schema, document, { assumeValid: true, assumeValidSDL: true }) addTypePolicyDirectivesToSchema(schema) - + addFieldPolicyDirectivesToSchema(schema) assertValidSchema(schema) return schema diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts index 7ef8cbd51..95b3b8ddf 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts @@ -25,6 +25,28 @@ export const directive_typePolicy: DirectiveDefinitionNode = { locations: [nameNode("OBJECT"), nameNode("INTERFACE")] } +export const directive_fieldPolicy: DirectiveDefinitionNode = { + kind: Kind.DIRECTIVE_DEFINITION, + description: stringNode("A directive used by Apollo iOS to map query input data to cache keys of objects."), + name: nameNode("fieldPolicy"), + arguments: [ + { + kind: Kind.INPUT_VALUE_DEFINITION, + description: stringNode("The field you are setting the @fieldPolicy for."), + name: nameNode("forField"), + type: nonNullNode(typeNode(GraphQLString)) + }, + { + kind: Kind.INPUT_VALUE_DEFINITION, + description: stringNode("Set of fields used to compute the cache key."), + name: nameNode("keyArgs"), + type: nonNullNode(typeNode(GraphQLString)) + } + ], + repeatable: true, + locations: [nameNode("OBJECT"), nameNode("INTERFACE")] +} + export const directive_import_statement: DirectiveDefinitionNode = { kind: Kind.DIRECTIVE_DEFINITION, description: stringNode("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."), @@ -45,6 +67,7 @@ const apolloDirectives = [ directive_apollo_client_ios_localCacheMutation, directive_import_statement, directive_typePolicy, + directive_fieldPolicy ] export function addApolloCodegenSchemaExtensionToDocument(document: DocumentNode): DocumentNode { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts new file mode 100644 index 000000000..ffc686e7a --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts @@ -0,0 +1,196 @@ +import { + DirectiveNode, + GraphQLCompositeType, + GraphQLError, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLSchema, + isInterfaceType, + isListType, + isObjectType, + isUnionType, + Kind, + valueFromASTUntyped, +} from "graphql"; +import { directive_fieldPolicy } from "./apolloCodegenSchemaExtension"; + +const directiveName = directive_fieldPolicy.name.value + +// type FieldPolicyDirectiveResult = { +// directive: DirectiveNode; +// source: GraphQLObjectType; +// }; + +export function addFieldPolicyDirectivesToSchema( + schema: GraphQLSchema +) { + const types = schema.getTypeMap(); + + for (const t in types) { + const type = types[t]; + + if (type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) { + (type as any)._apolloFieldPolicies = fieldPoliciesFor(type); + } + } +} + +export function fieldPoliciesFor( + type: GraphQLCompositeType +): Record { + const directives = fieldPolicyDirectivesFor(type) + if (!directives || isUnionType(type)) { + return {}; + } + + const fieldPolicies: Record = {}; + const typeFields = type.getFields() + + for (const directive of directives) { + const forFieldValueNode = directive.arguments?.find( + (b) => b.name.value === "forField" + )?.value + let forField: string | undefined = undefined; + if (forFieldValueNode?.kind === Kind.STRING) { + forField = forFieldValueNode.value + } + + if (!forField) { + throw new GraphQLError( + `@fieldPolicy directive must have a 'forField' value.`, + { nodes: directive } + ); + } + + const keyArgsValueNode = directive.arguments?.find( + (b) => b.name.value === "keyArgs" + )?.value + let keyArgs: string[] | undefined = undefined; + if (keyArgsValueNode?.kind == Kind.STRING) { + const rawArgs = keyArgsValueNode.value.split(" "); + keyArgs = [...new Set(rawArgs.filter(Boolean))]; + } + + if (!keyArgs) { + throw new GraphQLError( + `'keyArgs' must be a space-separated list of identifiers.`, + { nodes: directive } + ); + } + + // check that the field exists + const actualField = typeFields[forField] + if (!actualField) { + throw new GraphQLError( + `Field "${forField}" does not exist on type "${type.name}".`, + { nodes: type.astNode ? [type.astNode, directive] : directive} + ); + } + + // validate the provided key args match an input parameter + const inputs = actualField.astNode?.arguments; + const inputNames = new Set(inputs?.map(input => input.name.value) ?? []); + for (const keyArg of keyArgs) { + if (!inputNames.has(keyArg)) { + throw new GraphQLError( + `@fieldPolicy key argument "${keyArg}" does not exist as an input argument of field "${actualField.name}".`, + { + nodes: actualField.astNode + } + ); + } + } + + // validate that if we have a list input parameter we have a list return type + if (inputs) { + for (const inputArg of inputs) { + if (isListType(inputArg.type)) { + if (!isListType(actualField.type)) { + throw new GraphQLError( + `@fieldPolicy requires fields with List input type to have a List return type.`, + { nodes: actualField.astNode } + ); + } else { + break; + } + } + } + } + + if (!fieldPolicies[forField]) { + fieldPolicies[forField] = keyArgs + } + } + + return fieldPolicies; +} + +function fieldPolicyDirectivesFor( + type: GraphQLCompositeType +): DirectiveNode[] | undefined { + if(!isObjectType(type) && !isInterfaceType(type)) { + return undefined; + } + + const result: DirectiveNode[] = []; + + for (const extension of type.extensionASTNodes ?? []) { + const directive = extension.directives?.find( + (d) => d.name.value === directiveName + ); + if (directive) { + result.push(directive) + } + } + + for (const directive of type.astNode?.directives ?? []) { + if (directive.name.value === directiveName) { + result.push(directive); + } + } + + if("getInterfaces" in type) { + for (const interfaceType of type.getInterfaces()) { + const found = fieldPolicyDirectivesFor(interfaceType); + if (!found) { + continue; + } + + for (const foundDirective of found) { + var duplicate = false; + for (const directive of result) { + if (matchDirectiveArguments(directive, foundDirective)) { + duplicate = true; + break; + } + } + + if (!duplicate) { + result.push(foundDirective); + } + } + } + } + + return result +} + +function matchDirectiveArguments( + first: DirectiveNode, + second: DirectiveNode +): boolean { + return ( + (first.arguments ?? []) + .map((node) => + JSON.stringify([node.name.value, valueFromASTUntyped(node.value)]) + ) + .sort() + .toString() === + (second.arguments ?? []) + .map((node) => + JSON.stringify([node.name.value, valueFromASTUntyped(node.value)]) + ) + .sort() + .toString() + ); +} \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.base.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.base.json index f85872ce1..60ab9fdd9 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.base.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.base.json @@ -15,6 +15,6 @@ "noImplicitReturns": true, "noUnusedLocals": true, "noUnusedParameters": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true }, } \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.test.base.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.test.base.json index 54a491bc8..493d773e1 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.test.base.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/tsconfig.test.base.json @@ -3,5 +3,5 @@ "compilerOptions": { "types": ["node", "jest"], }, - "files": ["./src/__testUtils__/matchers.ts"], + "files": ["./src/__testUtils__/matchers.ts"] } From 2e45dc04e0ab1edb5cdb04a272a346d3cf292e28 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Thu, 31 Jul 2025 13:03:24 -0400 Subject: [PATCH 02/35] Checking in progress to fix codegen build script --- .../AllAnimalsQuery.graphql | 4 +- .../AnimalSchema.graphqls | 2 +- ..._ResultNormalizer_FromResponse_Tests.swift | 40 + .../Templates/SelectionSetTemplate.swift | 4 + .../ApolloCodegenFrontendBundle.swift | 2 +- .../GraphQLCompiler/CompilationResult.swift | 7 + .../GraphQLCompiler/GraphQLSchema.swift | 9 +- .../JavaScript/coverage/clover.xml | 615 ++++++ .../JavaScript/coverage/coverage-final.json | 14 + .../JavaScript/coverage/lcov-report/base.css | 224 +++ .../coverage/lcov-report/block-navigation.js | 87 + .../coverage/lcov-report/favicon.png | Bin 0 -> 445 bytes .../coverage/lcov-report/index.html | 146 ++ .../coverage/lcov-report/prettify.css | 1 + .../coverage/lcov-report/prettify.js | 2 + .../lcov-report/sort-arrow-sprite.png | Bin 0 -> 138 bytes .../JavaScript/coverage/lcov-report/sorter.js | 196 ++ .../lcov-report/src/compiler/index.html | 131 ++ .../lcov-report/src/compiler/index.ts.html | 1720 +++++++++++++++++ .../lcov-report/src/compiler/values.ts.html | 229 +++ .../coverage/lcov-report/src/index.html | 131 ++ .../coverage/lcov-report/src/index.ts.html | 463 +++++ .../apolloCodegenSchemaExtension.ts.html | 334 ++++ .../experimentalDeferDirective.ts.html | 391 ++++ .../utilities/fieldPolicyDirective.ts.html | 709 +++++++ .../lcov-report/src/utilities/graphql.ts.html | 640 ++++++ .../lcov-report/src/utilities/index.html | 236 +++ .../lcov-report/src/utilities/index.ts.html | 97 + .../legacySafelistingTransform.ts.html | 247 +++ .../src/utilities/nodeHelpers.ts.html | 232 +++ .../src/utilities/predicates.ts.html | 127 ++ .../src/utilities/typePolicyDirective.ts.html | 616 ++++++ .../lcov-report/src/validationRules.ts.html | 547 ++++++ .../JavaScript/coverage/lcov.info | 1346 +++++++++++++ .../__tests__/fieldPolicyDirectiveTests.ts | 300 ++- .../sourceDefinitionTransformTests.ts | 7 +- .../src/utilities/fieldPolicyDirective.ts | 51 +- apollo-ios-codegen/Sources/IR/IR+Fields.swift | 1 + apollo-ios/Sources/ApolloAPI/Selection.swift | 20 +- 39 files changed, 9823 insertions(+), 105 deletions(-) create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/clover.xml create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/coverage-final.json create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/base.css create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/block-navigation.js create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/favicon.png create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/index.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.css create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.js create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sort-arrow-sprite.png create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sorter.js create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/values.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/apolloCodegenSchemaExtension.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/experimentalDeferDirective.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/fieldPolicyDirective.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/graphql.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/legacySafelistingTransform.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/nodeHelpers.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/predicates.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/typePolicyDirective.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/validationRules.ts.html create mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov.info diff --git a/Sources/AnimalKingdomAPI/animalkingdom-graphql/AllAnimalsQuery.graphql b/Sources/AnimalKingdomAPI/animalkingdom-graphql/AllAnimalsQuery.graphql index d5ef17e95..d8b16ff3f 100644 --- a/Sources/AnimalKingdomAPI/animalkingdom-graphql/AllAnimalsQuery.graphql +++ b/Sources/AnimalKingdomAPI/animalkingdom-graphql/AllAnimalsQuery.graphql @@ -1,5 +1,5 @@ -query AllAnimalsQuery { - allAnimals { +query AllAnimalsQuery(species: String) { + allAnimals(species: $species) { __typename id height { diff --git a/Sources/AnimalKingdomAPI/animalkingdom-graphql/AnimalSchema.graphqls b/Sources/AnimalKingdomAPI/animalkingdom-graphql/AnimalSchema.graphqls index b2fc323c8..25acde888 100644 --- a/Sources/AnimalKingdomAPI/animalkingdom-graphql/AnimalSchema.graphqls +++ b/Sources/AnimalKingdomAPI/animalkingdom-graphql/AnimalSchema.graphqls @@ -1,5 +1,5 @@ type Query { - allAnimals: [Animal!]! + allAnimals(species: String): [Animal!]! classroomPets: [ClassroomPet] pets(filters: PetSearchFilters!): [Pet!]! findPet(input: PetSearchInput!): [Pet!]! diff --git a/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift b/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift index 89d82b715..f884521ad 100644 --- a/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift +++ b/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift @@ -87,6 +87,46 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { let hero = try XCTUnwrap(records["QUERY_ROOT.hero(episode:JEDI)"]) XCTAssertEqual(hero["name"] as? String, "R2-D2") } + + + + +// func test__fieldPolicy() throws { +// // given +// class GivenSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] {[ +// .field("hero", Hero.self, arguments: [""]) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __selections: [Selection] {[ +// .field("id", String.self), +// .field("name", String.self) +// ]} +// } +// } +// .field(.init(name, alias: alias, type: type._asOutputType, arguments: arguments, fieldPolicy: fieldPolicy)) +// let variables = ["episode": "JEDI"] +// +// let object: JSONObject = [ +// "hero": ["__typename": "Droid", "name": "R2-D2"] +// ] + + // when + let records = try normalizeRecords(GivenSelectionSet.self, with: variables, from: object) + + // then + XCTAssertEqual(records["QUERY_ROOT"]?["hero(episode:JEDI)"] as? CacheReference, + CacheReference("QUERY_ROOT.hero(episode:JEDI)")) + + let hero = try XCTUnwrap(records["QUERY_ROOT.hero(episode:JEDI)"]) + XCTAssertEqual(hero["name"] as? String, "R2-D2") + } + + + + + func test__execute__givenObjectWithNoCacheKey_forFieldWithEnumArgument_normalizesRecordToPathFromQueryRootIncludingArgument() throws { // given diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift index 49bee6bab..68c352c46 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift @@ -346,6 +346,10 @@ struct SelectionSetTemplate { where: { !$0.isEmpty }, { args in ", arguments: " + renderValue(for: args, onFieldNamed: field.name, &deprecatedArguments) })\ + \(ifLet: field.fieldPolicyKeys, + where: { !$0.isEmpty }, { keys in + ", fieldPolicy: .init(keys: [\(keys.joined(separator: ", "))])" + })\ ) """ } diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift index 67fa71bdb..e272f8f23 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift @@ -1 +1 @@ -let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){throw new Error(t??"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}const d={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},f={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION"},h="Name",m="Document",v="OperationDefinition",y="VariableDefinition",g="SelectionSet",T="Field",E="Argument",b="FragmentArgument",N="FragmentSpread",S="InlineFragment",L="FragmentDefinition",w="Variable",I="IntValue",O="FloatValue",k="StringValue",_="BooleanValue",A="NullValue",D="EnumValue",x="ListValue",$="ObjectValue",F="ObjectField",G="Directive",Q="NamedType",C="ListType",R="NonNullType",V="SchemaDefinition",j="OperationTypeDefinition",M="ScalarTypeDefinition",U="ObjectTypeDefinition",P="FieldDefinition",B="InputValueDefinition",J="InterfaceTypeDefinition",q="UnionTypeDefinition",K="EnumTypeDefinition",z="EnumValueDefinition",Y="InputObjectTypeDefinition",H="DirectiveDefinition",W="SchemaExtension",X="ScalarTypeExtension",Z="ObjectTypeExtension",ee="InterfaceTypeExtension",te="UnionTypeExtension",ne="EnumTypeExtension",re="InputObjectTypeExtension";var ie=Object.freeze({__proto__:null,ARGUMENT:E,BOOLEAN:_,DIRECTIVE:G,DIRECTIVE_DEFINITION:H,DOCUMENT:m,ENUM:D,ENUM_TYPE_DEFINITION:K,ENUM_TYPE_EXTENSION:ne,ENUM_VALUE_DEFINITION:z,FIELD:T,FIELD_DEFINITION:P,FLOAT:O,FRAGMENT_ARGUMENT:b,FRAGMENT_DEFINITION:L,FRAGMENT_SPREAD:N,INLINE_FRAGMENT:S,INPUT_OBJECT_TYPE_DEFINITION:Y,INPUT_OBJECT_TYPE_EXTENSION:re,INPUT_VALUE_DEFINITION:B,INT:I,INTERFACE_TYPE_DEFINITION:J,INTERFACE_TYPE_EXTENSION:ee,LIST:x,LIST_TYPE:C,NAME:h,NAMED_TYPE:Q,NON_NULL_TYPE:R,NULL:A,OBJECT:$,OBJECT_FIELD:F,OBJECT_TYPE_DEFINITION:U,OBJECT_TYPE_EXTENSION:Z,OPERATION_DEFINITION:v,OPERATION_TYPE_DEFINITION:j,SCALAR_TYPE_DEFINITION:M,SCALAR_TYPE_EXTENSION:X,SCHEMA_DEFINITION:V,SCHEMA_EXTENSION:W,SELECTION_SET:g,STRING:k,UNION_TYPE_DEFINITION:q,UNION_TYPE_EXTENSION:te,VARIABLE:w,VARIABLE_DEFINITION:y});function oe(e){return 9===e||32===e}function se(e){return e>=48&&e<=57}function ae(e){return e>=97&&e<=122||e>=65&&e<=90}function ce(e){return ae(e)||95===e}function ue(e){return ae(e)||se(e)||95===e}function le(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function pe(e){let t=0;for(;t",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};class Lexer{constructor(e){const t=new Token(fe.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==fe.EOF)do{if(e.next)e=e.next;else{const t=Ee(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===fe.COMMENT);return e}}function he(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function me(e,t){return ve(e.charCodeAt(t))&&ye(e.charCodeAt(t+1))}function ve(e){return e>=55296&&e<=56319}function ye(e){return e>=56320&&e<=57343}function ge(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return fe.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Te(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function Ee(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _e(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ae(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oFe)return"[Array]";const n=Math.min($e,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>Fe)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+Qe(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ce=null!=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Ge(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||xe(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||xe(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Re(e,t){const n=new Parser(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function Ve(e,t){const n=new Parser(e,t);n.expectToken(fe.SOF);const r=n.parseConstValueLiteral();return n.expectToken(fe.EOF),r}class Parser{constructor(e,t={}){const n=function(e){return Ce(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(fe.NAME);return this.node(e,{kind:h,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:m,definitions:this.many(fe.SOF,this.parseDefinition,fe.EOF)})}parseDefinition(){if(this.peek(fe.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===fe.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(fe.BRACE_L))return this.node(e,{kind:v,operation:d.QUERY,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(fe.NAME)&&(n=this.parseName()),this.node(e,{kind:v,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(fe.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(fe.PAREN_L,this.parseVariableDefinition,fe.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:y,variable:this.parseVariable(),type:(this.expectToken(fe.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(fe.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(fe.DOLLAR),this.node(e,{kind:w,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:g,selections:this.many(fe.BRACE_L,this.parseSelection,fe.BRACE_R)})}parseSelection(){return this.peek(fe.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(fe.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:T,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(fe.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(fe.PAREN_L,t,fe.PAREN_R)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(fe.PAREN_L,e,fe.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:E,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(fe.COLON),this.node(e,{kind:b,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(fe.SPREAD);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(fe.NAME)){const t=this.parseFragmentName();return this.peek(fe.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(e,{kind:N,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:N,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:S,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:L,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:L,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case fe.BRACKET_L:return this.parseList(e);case fe.BRACE_L:return this.parseObject(e);case fe.INT:return this.advanceLexer(),this.node(t,{kind:I,value:t.value});case fe.FLOAT:return this.advanceLexer(),this.node(t,{kind:O,value:t.value});case fe.STRING:case fe.BLOCK_STRING:return this.parseStringLiteral();case fe.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_,value:!0});case"false":return this.node(t,{kind:_,value:!1});case"null":return this.node(t,{kind:A});default:return this.node(t,{kind:D,value:t.value})}case fe.DOLLAR:if(e){if(this.expectToken(fe.DOLLAR),this._lexer.token.kind===fe.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k,value:e.value,block:e.kind===fe.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:x,values:this.any(fe.BRACKET_L,(()=>this.parseValueLiteral(e)),fe.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:$,fields:this.any(fe.BRACE_L,(()=>this.parseObjectField(e)),fe.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:F,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(fe.AT);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(fe.AT),this.node(t,{kind:G,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(fe.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(fe.BRACKET_R),t=this.node(e,{kind:C,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(fe.BANG)?this.node(e,{kind:R,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Q,name:this.parseName()})}peekDescription(){return this.peek(fe.STRING)||this.peek(fe.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);return this.node(e,{kind:V,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(fe.COLON);const n=this.parseNamedType();return this.node(e,{kind:j,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:M,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:U,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(fe.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseFieldDefinition,fe.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(fe.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:P,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(fe.PAREN_L,this.parseInputValueDef,fe.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(fe.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(fe.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:B,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:J,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:q,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(fe.EQUALS)?this.delimitedMany(fe.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:K,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(fe.BRACE_L,this.parseEnumValueDefinition,fe.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:z,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${je(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Y,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseInputValueDef,fe.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===fe.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:W,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:X,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Z,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ee,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:te,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ne,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:re,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(fe.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:H,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(fe.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${Me(e)}, found ${je(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==fe.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${je(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===fe.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${je(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==fe.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function je(e){const t=e.value;return Me(e.kind)+(null!=t?` "${t}"`:"")}function Me(e){return function(e){return e===fe.BANG||e===fe.DOLLAR||e===fe.AMP||e===fe.PAREN_L||e===fe.PAREN_R||e===fe.SPREAD||e===fe.COLON||e===fe.EQUALS||e===fe.AT||e===fe.BRACKET_L||e===fe.BRACKET_R||e===fe.BRACE_L||e===fe.PIPE||e===fe.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function Ue(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Pe(e){return Be("and",e)}function Be(e,t){switch(0!==t.length||n(),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}function Je(e){return"object"==typeof e&&"function"==typeof e?.[Symbol.iterator]}function qe(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function Ke(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function ze(e){return 0===e.length?"":` at ${e.map((e=>"number"==typeof e?`[${e}]`:`.${e}`)).join("")}`}const Ye=5;function He(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+Be("or",r.slice(0,Ye).map((e=>`"${e}"`)))+"?"}function We(e){return e}function Xe(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function Ze(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-et,o=t.charCodeAt(r)}while(nt(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const et=48,tt=57;function nt(e){return!isNaN(e)&&et<=e&&e<=tt}function rt(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:Ze(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=it(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=it(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function it(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>mt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=yt("(",mt(e.variableDefinitions,", "),")"),n=mt([e.operation,mt([e.name,t]),mt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+yt(" = ",n)+yt(" ",mt(r," "))},SelectionSet:{leave:({selections:e})=>vt(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=mt([yt("",e,": "),t],"");return mt([Et(o,n),yt(" ",mt(r," ")),yt(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Et("..."+e,t)+yt(" ",mt(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>mt(["...",yt("on ",e),mt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${yt("(",mt(n,", "),")")} on ${t} ${yt("",mt(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||oe(e.charCodeAt(0)))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const p=r&&oe(e.charCodeAt(0));return(u&&!p||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(st,at)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+mt(e,", ")+"]";return t.length>80?"[\n"+gt(mt(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+mt(e,", ")+" }";return t.length>80?vt(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+yt("(",mt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>yt("",e,"\n")+mt(["schema",mt(t," "),vt(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt(["scalar",t,mt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["type",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>yt("",e,"\n")+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+": "+r+yt(" ",mt(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>yt("",e,"\n")+mt([t+": "+n,yt("= ",r),mt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["interface",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>yt("",e,"\n")+mt(["union",t,mt(n," "),yt("= ",mt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>yt("",e,"\n")+mt(["enum",t,mt(n," "),vt(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt([t,mt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>yt("",e,"\n")+mt(["input",t,mt(n," "),vt(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>yt("",e,"\n")+"directive @"+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+(r?" repeatable":"")+" on "+mt(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>mt(["extend schema",mt(e," "),vt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>mt(["extend scalar",e,mt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend type",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend interface",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>mt(["extend union",e,mt(t," "),yt("= ",mt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>mt(["extend enum",e,mt(t," "),vt(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>mt(["extend input",e,mt(t," "),vt(n)]," ")}};function mt(e,t=""){return e?.filter((e=>e)).join(t)??""}function vt(e){return yt("{\n",gt(mt(e,"\n")),"\n}")}function yt(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function gt(e){return yt(" ",e.replaceAll("\n","\n "))}function Tt(e){return e?.some((e=>e.includes("\n")))??!1}function Et(e,t){let n=e+yt("(",mt(t,", "),")");return n.length>80&&(n=e+yt("(\n",gt(mt(t,"\n")),"\n)")),n}function bt(e,t){switch(e.kind){case A:return null;case I:return parseInt(e.value,10);case O:return parseFloat(e.value);case k:case D:case _:return e.value;case x:return e.values.map((e=>bt(e,t)));case $:return Xe(e.fields,(e=>e.name.value),(e=>bt(e.value,t)));case w:return t?.[e.name.value]}}function Nt(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(bt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||xe(0,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&("function"==typeof e.coerceInputValue&&"function"==typeof e.coerceInputLiteral||xe(0,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Jt(e){return Pt(e??[])}function qt(e,t){return Ke(Bt(t),((t,n)=>new GraphQLField(e,n,t)))}class GraphQLField{constructor(e,t,n){this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type;const r=n.args;this.args=r?Object.entries(r).map((([e,t])=>new GraphQLArgument(this,e,t))):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}}class GraphQLArgument{constructor(e,t,n){this.parent=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function Kt(e){return xt(e.type)&&void 0===e.default&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=zt.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function zt(e){return Pt(e)}class GraphQLEnumType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values="function"==typeof e.values?e.values:Object.entries(e.values).map((([e,t])=>new GraphQLEnumValue(this,e,t))),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Object.entries(this._values()).map((([e,t])=>new GraphQLEnumValue(this,e,t)))),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=qe(this.getValues(),(e=>e.name))),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map((e=>[e.value,e]))));const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Ge(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if("string"!=typeof e){const n=Ge(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?"":Yt(this,n)))}const n=this.getValue(e);if(null==n)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==D){const n=ft(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?"":Yt(this,n)),{nodes:e})}const n=this.getValue(e.value);if(null==n){const n=ft(e);throw new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if("string"==typeof e&&this.getValue(e))return{kind:D,value:e}}toConfig(){return{name:this.name,description:this.description,values:Xe(this.getValues(),(e=>e.name),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Yt(e,t){return He("the enum value",rt(t,e.getValues().map((e=>e.name))))}class GraphQLEnumValue{constructor(e,t,n){this.parentEnum=e,this.name=function(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError(`Enum values cannot be named: ${e}`);return Nt(e)}(t),this.description=n.description,this.value=void 0!==n.value?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class GraphQLInputObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=Ht.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:Ke(this.getFields(),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Ht(e,t){return Ke(Bt(t),((t,n)=>new GraphQLInputField(e,n,t)))}class GraphQLInputField{constructor(e,t,n){!("resolve"in n)||xe(0,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function Wt(e){return xt(e.type)&&void 0===e.defaultValue&&void 0===e.default}function Xt(e,t){return e===t||(xt(e)&&xt(t)||!(!Dt(e)||!Dt(t)))&&Xt(e.ofType,t.ofType)}function Zt(e,t,n){return t===n||(xt(n)?!!xt(t)&&Zt(e,t.ofType,n.ofType):xt(t)?Zt(e,t.ofType,n):Dt(n)?!!Dt(t)&&Zt(e,t.ofType,n.ofType):!Dt(t)&&(Rt(n)&&(Ot(t)||wt(t))&&e.isSubType(n,t)))}function en(e,t,n){return t===n||(Rt(t)?Rt(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!Rt(n)&&e.isSubType(n,t))}function tn(e,t,n){return{prev:e,key:t,typename:n}}function nn(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function rn(e,n){if(xt(n)){if(null==e)return;return rn(e,n.ofType)}if(null==e)return{kind:A};if(Dt(n)){if(!Je(e))return rn(e,n.ofType);const t=[];for(const r of e){const e=rn(r,n.ofType);if(!e)return;t.push(e)}return{kind:x,values:t}}if(At(n)){if(!t(e))return;const r=[],i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(n.getFields())){if(void 0===e[t.name]){if(Wt(t))return}else{const n=rn(e[t.name],t.type);if(!n)return;r.push({kind:F,name:{kind:h,value:t.name},value:n})}}return{kind:$,fields:r}}const r=Qt(n);if(r.valueToLiteral)try{return r.valueToLiteral(e)}catch(e){return}return on(e)}function on(e){if(null==e)return{kind:A};switch(typeof e){case"boolean":return{kind:_,value:e};case"string":return{kind:k,value:e,block:!1};case"number":{if(!Number.isFinite(e))return{kind:A};const t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:O,value:t}}case"object":{if(Je(e))return{kind:x,values:Array.from(e,on)};const t=e,n=[];for(const e of Object.keys(t)){const r=t[e];void 0!==r&&n.push({kind:F,name:{kind:h,value:e},value:on(r)})}return{kind:$,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${Ge(e)}.`)}function sn(e,t,n){switch(e.kind){case w:{const r=e.name.value,i=n?.sources[r]?n:t,o=i?.sources[r];if(null==o)return{kind:A};if(void 0===o.value){const e=o.signature.default;if(void 0!==e)return e.literal}return rn(o.value,o.signature.type)}case $:{const r=[];for(const i of e.fields){if(i.value.kind===w){const e=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(void 0===e?.value&&void 0===e?.signature.default)continue}const e=sn(i.value,t,n);r.push({...i,value:e})}return{...e,fields:r}}case x:{const r=[];for(const i of e.values){const e=sn(i,t,n);r.push(e)}return{...e,values:r}}default:return e}}function an(e,t,n,r){return cn(e,t,n,r,void 0)}function cn(e,n,r,i,o){if(xt(n))return void 0===e?void un(r,`Expected a value of non-null type "${n}" to be provided.`,o):null===e?void un(r,`Expected value of non-null type "${n}" not to be null.`,o):cn(e,n.ofType,r,i,o);if(null!=e)if(Dt(n))if(Je(e)){let t=0;for(const s of e)cn(s,n.ofType,r,i,tn(o,t++,void 0))}else cn(e,n.ofType,r,i,o);else if(At(n)){if(!t(e))return void un(r,`Expected value of type "${n}" to be an object, found: ${Ge(e)}.`,o);const s=n.getFields();for(const t of Object.values(s)){const s=e[t.name];void 0===s?Wt(t)&&un(r,`Expected value of type "${n}" to include required field "${t.name}", found: ${Ge(e)}.`,o):cn(s,t.type,r,i,tn(o,t.name,n.name))}const a=Object.keys(e);for(const t of a)if(!Object.hasOwn(s,t)){const i=He(rt(t,Object.keys(s)));un(r,`Expected value of type "${n}" not to include unknown field "${t}"${i?`.${i} Found`:", found"}: ${Ge(e)}.`,o)}if(n.isOneOf){1!==a.length&&un(r,`Exactly one key must be specified for OneOf type "${n}".`,o);const t=a[0];null===e[t]&&un(r,`Field "${t}" for OneOf type "${n}" must be non-null.`,o)}}else{let t,s;Qt(n);try{t=n.coerceInputValue(e,i)}catch(e){if(e instanceof GraphQLError)return void r(e,nn(o));s=e}void 0===t&&un(r,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${Ge(e)}.`,o,s)}}function un(e,t,n,r){e(new GraphQLError(t,{originalError:r}),nn(n))}function ln(e,t,n,r,i,o){return pn({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function pn(e,t,n,r,i){if(t.kind!==w){if(xt(n))return t.kind===A?void fn(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i):pn(e,t,n.ofType,r,i);if(t.kind!==A)if(Dt(n))if(t.kind!==x)pn(e,t,n.ofType,r,i);else{let o=0;for(const s of t.values)pn(e,s,n.ofType,r,tn(i,o++,void 0))}else if(At(n)){if(t.kind!==$)return void fn(e.onError,`Expected value of type "${n}" to be an object, found: ${ft(t)}.`,t,i);const o=n.getFields(),s=qe(t.fields,(e=>e.name.value));for(const a of Object.values(o)){const o=s[a.name];if(void 0===o)Wt(a)&&fn(e.onError,`Expected value of type "${n}" to include required field "${a.name}", found: ${ft(t)}.`,t,i);else{const s=o.value;if(s.kind===w&&!e.static){const r=dn(e,s),o=s.name.value,c=r?.coerced[o];if(n.isOneOf)void 0===c?fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):null===c&&fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(void 0===c&&!Wt(a))continue}pn(e,s,a.type,r,tn(i,a.name,n.name))}}const a=t.fields;for(const s of a){const a=s.name.value;if(!Object.hasOwn(o,a)){const c=r?"":He(rt(a,Object.keys(o)));fn(e.onError,`Expected value of type "${n}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ft(t)}.`,s,i)}}if(n.isOneOf){if(1!==a.length)return void fn(e.onError,`OneOf Input Object "${n}" must specify exactly one key.`,t,i);if(a[0].value.kind===A){const r=a[0].name.value;fn(e.onError,`Field "${n}.${r}" used for OneOf Input Object must be non-null.`,t,tn(i,r,void 0))}}}else{let o,s;Qt(n);try{o=n.coerceInputLiteral?n.coerceInputLiteral(sn(t),r):n.parseLiteral(t,void 0,r)}catch(t){if(t instanceof GraphQLError)return void e.onError(t,nn(i));s=t}void 0===o&&fn(e.onError,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${ft(t)}.`,t,i,s)}}else{if(e.static)return;const r=dn(e,t),o=r?.coerced[t.name.value];xt(n)&&(void 0===o?fn(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):null===o&&fn(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i))}}function dn(e,t){const n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function fn(e,t,n,r,i){e(new GraphQLError(t,{nodes:n,originalError:i}),nn(r))}const hn=2147483647,mn=-2147483648,vn=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Ge(t)}`);if(n>hn||nhn||ehn||t=mn)return{kind:I,value:String(e)}}}),yn=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(t)}`);return n},coerceInputValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==O&&e.kind!==I)throw new GraphQLError(`Float cannot represent non numeric value: ${ft(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){const t=on(e);if(t.kind===O||t.kind===I)return t}}),gn=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError(`String cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"!=typeof e)throw new GraphQLError(`String cannot represent a non string value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==k)throw new GraphQLError(`String cannot represent a non string value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===k)return t}}),Tn=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(t)}`)},coerceInputValue(e){if("boolean"!=typeof e)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===_)return t}}),En=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputLiteral(e){if(e.kind!==k&&e.kind!==I)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+ft(e),{nodes:e});return e.value},valueToLiteral(e){const t=Number.isInteger(e)?String(e):e;if("string"==typeof t)return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:k,value:t,block:!1}}}),bn=Object.freeze([gn,vn,yn,Tn,En]);function Nn(e){return bn.some((({name:t})=>e.name===t))}function Sn(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Ln(e){return Ce(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Nt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=ot(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||xe(0,`@${this.name} locations must be an Array.`);const n=e.args??{};t(n)&&!Array.isArray(n)||xe(0,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(n).map((([e,t])=>new GraphQLArgument(this,e,t)))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const wn=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Included when true."}}}),In=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Skipped when true."}}}),On=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),kn=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{initialCount:{default:{value:0},type:new GraphQLNonNull(vn),description:"Number of items to return immediately"},if:{type:new GraphQLNonNull(Tn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),_n="No longer supported",An=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:new GraphQLNonNull(gn),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:_n}}}}),Dn=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(gn),description:"The URL that specifies the behavior of this scalar."}}}),xn=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[f.INPUT_OBJECT],args:{}}),$n=Object.freeze([wn,In,An,Dn,xn]);function Fn(e){return $n.some((({name:t})=>t===e.name))}function Gn(e,r){if(xt(r)){const t=Gn(e,r.ofType);return t?.kind===A?null:t}if(null===e)return{kind:A};if(void 0===e)return null;if(Dt(r)){const t=r.ofType;if(Je(e)){const n=[];for(const r of e){const e=Gn(r,t);null!=e&&n.push(e)}return{kind:x,values:n}}return Gn(e,t)}if(At(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=Gn(e[t.name],t.type);r&&n.push({kind:F,name:{kind:h,value:t.name},value:r})}return{kind:$,fields:n}}if(Gt(r)){const t=r.coerceOutputValue(e);if(null==t)return null;if("boolean"==typeof t)return{kind:_,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return Qn.test(e)?{kind:I,value:e}:{kind:O,value:e}}if("string"==typeof t)return _t(r)?{kind:D,value:t}:r===En&&Qn.test(t)?{kind:I,value:t}:{kind:k,value:t};throw new TypeError(`Cannot convert value to AST: ${Ge(t)}.`)}n(0,"Unexpected input type: "+Ge(r))}const Qn=/^-?(?:0|[1-9][0-9]*)$/;function Cn(e){const t=e.type,r=e.default;if(r){const e=r.literal??rn(r.value,t);return null!=e||n(0,"Invalid default value"),e}const i=e.defaultValue;if(void 0!==i){const e=Gn(i,t);return null!=e||n(0,"Invalid default value"),e}}const Rn=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:gn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Mn))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Mn),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Mn,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Mn,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Vn))),resolve:e=>e.getDirectives()}})}),Vn=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(Tn),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(jn))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),jn=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:f.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Mn=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(qn),resolve:e=>Lt(e)?Jn.SCALAR:wt(e)?Jn.OBJECT:Ot(e)?Jn.INTERFACE:kt(e)?Jn.UNION:_t(e)?Jn.ENUM:At(e)?Jn.INPUT_OBJECT:Dt(e)?Jn.LIST:xt(e)?Jn.NON_NULL:void n(0,`Unexpected type: "${Ge(e)}".`)},name:{type:gn,resolve:e=>"name"in e?e.name:void 0},description:{type:gn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:gn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Un)),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(wt(e)||Ot(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e){if(wt(e)||Ot(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e,t,n,{schema:r}){if(Rt(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Bn)),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(_t(e)){const n=e.getValues();return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(Pn)),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(At(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Mn,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:Tn,resolve:e=>{if(At(e))return e.isOneOf}}})}),Un=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Pn=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},defaultValue:{type:gn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const t=Cn(e);return t?ft(t):null}},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Bn=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Jn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},qn=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Jn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Jn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Jn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Jn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Jn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Jn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Jn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Jn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Kn=new GraphQLField(void 0,"__schema",{type:new GraphQLNonNull(Rn),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),zn=new GraphQLField(void 0,"__type",{type:Mn,description:"Request the type information of a single type.",args:{name:{type:new GraphQLNonNull(gn)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),Yn=new GraphQLField(void 0,"__typename",{type:new GraphQLNonNull(gn),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Hn=Object.freeze([Rn,Vn,jn,Mn,Un,Pn,Bn,qn]);function Wn(e){return Hn.some((({name:t})=>e.name===t))}function Xn(e){if(!function(e){return Ce(e,GraphQLSchema)}(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.assumeValid=e.assumeValid??!1,this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??$n;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Zn(n,t);null!=this._queryType&&Zn(this._queryType,t),null!=this._mutationType&&Zn(this._mutationType,t),null!=this._subscriptionType&&Zn(this._subscriptionType,t);for(const e of this._directives)if(Ln(e))for(const n of e.args)Zn(n.type,t);Zn(Rn,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Ot(e)){for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(wt(e))for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return kt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(kt(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Kn.name:return this.getQueryType()===e?Kn:void 0;case zn.name:return this.getQueryType()===e?zn:void 0;case Yn.name:return Yn}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Zn(e,t){const n=Ut(e);if(!t.has(n))if(t.add(n),kt(n))for(const e of n.getTypes())Zn(e,t);else if(wt(n)||Ot(n)){for(const e of n.getInterfaces())Zn(e,t);for(const e of Object.values(n.getFields())){Zn(e.type,t);for(const n of e.args)Zn(n.type,t)}}else if(At(n))for(const e of Object.values(n.getFields()))Zn(e.type,t);return t}function er(e){if(Xn(e),e.__validationErrors)return e.__validationErrors;const n=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(wt(i))n.add(i,r);else{const n=Ue(r),o=Ge(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,tr(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=Pe(i);e.reportError(`All root types must be different, "${r}" type is used as ${n} root types.`,i.map((e=>tr(t,e))))}}(n),function(e){for(const t of e.schema.getDirectives())if(Ln(t)){ir(e,t),0===t.locations.length&&e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}else e.reportError(`Expected directive but got: ${Ge(t)}.`,t?.astNode)}(n),function(e){const n=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(xt(t.type)&&At(t.type.ofType)){const s=t.type.ofType,a=r[s.name];if(n.push({fieldStr:`${o}.${t.name}`,astNode:t.astNode}),void 0===a)i(s);else{const t=n.slice(a),r=t.map((e=>e.fieldStr)).join(", ");e.reportError(`Invalid circular reference. The Input Object ${s} references itself ${t.length>1?"via the non-null fields:":"in the non-null field"} ${r}.`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),r=function(e){const n=Object.create(null),r=[],i=Object.create(null);return function(e){return o(e,{})};function o(e,n){if(Je(n))for(const t of n)o(e,t);else if(t(n))for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?o(r,n[t.name]):a(t,r,`${e}.${t.name}`))}}function s(e,t){if(t.kind===x){for(const n of t.values)s(e,n);return}if(t.kind!==$)return;const n=qe(t.fields,(e=>e.name.value));for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?s(r,n[t.name].value):a(t,r,`${e}.${t.name}`))}}function a(t,a,c){const u=t.default;if(void 0===u)return;const l=i[c];void 0!==l&&l>0?e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${le)).join(", ")}`:""}.`,r.slice(l-1).map((([,e])=>e))):void 0===n[c]&&(n[c]=!0,i[c]=r.push([c,t.astNode?.defaultValue]),u.literal?s(a,u.literal):o(a,u.value),r.pop(),i[c]=void 0)}}(e),i=e.schema.getTypeMap();for(const t of Object.values(i))Mt(t)?(Wn(t)||ir(e,t),wt(t)||Ot(t)?(or(e,t),sr(e,t)):kt(t)?ur(e,t):_t(t)?lr(e,t):At(t)&&(pr(e,t),n(t),r(t))):e.reportError(`Expected GraphQL named type but got: ${Ge(t)}.`,t.astNode)}(n);const r=n.getErrors();return e.__validationErrors=r,r}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function tr(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function nr(e,t){const n=t.default;if(n)if(n.literal)ln(n.literal,t.type,((n,r)=>{e.reportError(`${t} has invalid default value${ze(r)}: ${n.message}`,n.nodes)}));else{const r=[];if(an(n.value,t.type,((e,t)=>{r.push([e,t])})),r.length>0)try{const r=rr(n.value,t.type),i=[];if(an(r,t.type,((e,t)=>{i.push([e,t])})),0===i.length)return void e.reportError(`${t} has invalid default value: ${Ge(n.value)}. Did you mean: ${Ge(r)}?`,t.astNode?.defaultValue)}catch(e){}for(const[n,i]of r)e.reportError(`${t} has invalid default value${ze(i)}: ${n.message}`,t.astNode?.defaultValue)}}function rr(e,r){if(xt(r))return rr(e,r.ofType);if(null===e)return null;if(Dt(r))return Je(e)?Array.from(e,(e=>rr(e,r.ofType))):[rr(e,r.ofType)];if(At(r)){t(e)||n();const i=r.getFields();return Ke(e,((e,t)=>(t in i||n(),rr(e,i[t].type))))}return Qt(r),r.coerceOutputValue(e)}function ir(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function or(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const t of n){ir(e,t),Ft(t.type)||e.reportError(`The type of ${t} must be Output Type but got: ${Ge(t.type)}.`,t.astNode?.type);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode?.type),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}}function sr(e,t){const n=new Set;for(const r of t.getInterfaces())Ot(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t} can only implement ${r} once.`,fr(t,r)):(n.add(r.name),cr(e,t,r),ar(e,t,r)):e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,fr(t,r)):e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${Ge(r)}.`,fr(t,r))}function ar(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const n=r[i.name];if(null!=n){Zt(e.schema,n.type,i.type)||e.reportError(`Interface field ${i} expects type ${i.type} but ${n} is type ${n.type}.`,[i.astNode?.type,n.astNode?.type]);for(const t of i.args){const r=n.args.find((e=>e.name===t.name));r?Xt(t.type,r.type)||e.reportError(`Interface field argument ${t} expects type ${t.type} but ${r} is type ${r.type}.`,[t.astNode?.type,r.astNode?.type]):e.reportError(`Interface field argument ${t} expected but ${n} does not provide it.`,[t.astNode,n.astNode])}for(const t of n.args)if(Kt(t)){i.args.find((e=>e.name===t.name))||e.reportError(`Argument "${t}" must not be required type "${t.type}" if not provided by the Interface field "${i}".`,[t.astNode,i.astNode])}}else e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function cr(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...fr(n,i),...fr(t,n)])}function ur(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t} can only include type ${i} once.`,hr(t,i.name)):(r.add(i.name),wt(i)||e.reportError(`Union type ${t} can only include Object types, it cannot include ${Ge(i)}.`,hr(t,String(i))))}function lr(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)ir(e,t)}function pr(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)ir(e,r),$t(r.type)||e.reportError(`The type of ${r} must be Input Type but got: ${Ge(r.type)}.`,r.astNode?.type),Wt(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${r} cannot be deprecated.`,[mr(r.astNode),r.astNode?.type]),nr(e,r),t.isOneOf&&dr(t,r,e)}function dr(e,t,n){xt(t.type)&&n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type),void 0===t.default&&void 0===t.defaultValue||n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function fr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function hr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function mr(e){return e?.directives?.find((e=>e.name.value===An.name))}function vr(e,t){switch(t.kind){case C:{const n=vr(e,t.type);return n&&new GraphQLList(n)}case R:{const n=vr(e,t.type);return n&&new GraphQLNonNull(n)}case Q:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t&&($t(t)&&this._inputTypeStack.push(t),Ct(t)&&this._parentTypeStack.push(t),Ft(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case m:{const t=function(e){const t=new Map;for(const n of e.definitions)if(n.kind===L){const e=new Map;if(n.variableDefinitions)for(const t of n.variableDefinitions)e.set(t.variable.name.value,t);const r={definition:n,variableDefinitions:e};t.set(n.name.value,r)}return t}(e);this._fragmentSignaturesByName=e=>t.get(e);break}case g:{const e=Ut(this.getType());this._parentTypeStack.push(Ct(e)?e:void 0);break}case T:{const n=this.getParentType();let r,i;n&&(r=t.getField(n,e.name.value),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Ft(i)?i:void 0);break}case G:this._directive=t.getDirective(e.name.value);break;case v:{const n=t.getRootType(e.operation);this._typeStack.push(wt(n)?n:void 0);break}case N:this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break;case S:case L:{const n=e.typeCondition,r=n?vr(t,n):Ut(this.getType());this._typeStack.push(Ft(r)?r:void 0);break}case y:{const n=vr(t,e.type);this._inputTypeStack.push($t(n)?n:void 0);break}case E:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?.default??t?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case b:{const t=this.getFragmentSignature(),n=t?.variableDefinitions.get(e.name.value);let r;this._fragmentArgument=n,n&&(r=vr(this._schema,n.type)),this._inputTypeStack.push($t(r)?r:void 0);break}case x:{const e=function(e){if(e)return xt(e)?e.ofType:e}(this.getInputType()),t=Dt(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push($t(t)?t:void 0);break}case F:{const t=Ut(this.getInputType());let n,r;At(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?.default??r?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case D:{const t=Ut(this.getInputType());let n;_t(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case m:this._fragmentSignaturesByName=()=>null;break;case g:this._parentTypeStack.pop();break;case T:this._fieldDefStack.pop(),this._typeStack.pop();break;case G:this._directive=null;break;case N:this._fragmentSignature=null;break;case v:case S:case L:this._typeStack.pop();break;case y:this._inputTypeStack.pop();break;case E:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case b:this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case x:case F:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case D:this._enumValue=null}}}function yr(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=dt(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=dt(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function gr(e){const t=e.arguments?.find((e=>"if"===e.name.value));if(!t)return!1;if(t.value.kind===_){if(t.value.value)return!1}else if(t.value.kind!==w)return!1;return!0}function Tr(e){return e.kind===v||e.kind===L}function Er(e){return e.kind===M||e.kind===U||e.kind===J||e.kind===q||e.kind===K||e.kind===Y}function br(e){return e.kind===X||e.kind===Z||e.kind===ee||e.kind===te||e.kind===ne||e.kind===re}function Nr(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,e.args.map((e=>e.name)));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,n.map((e=>e.name.value)))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=rt(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+(e.hideSuggestions?"":He(o)),{nodes:t}))}}return!1}}}function Sr(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():$n;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===H&&t.set(e.name.value,e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(),t.kind){case v:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case T:return f.FIELD;case N:return f.FRAGMENT_SPREAD;case S:return f.INLINE_FRAGMENT;case L:return f.FRAGMENT_DEFINITION;case y:{const t=e[e.length-3];return"kind"in t||n(),t.kind===v?f.VARIABLE_DEFINITION:f.FRAGMENT_VARIABLE_DEFINITION}case V:case W:return f.SCHEMA;case M:case X:return f.SCALAR;case U:case Z:return f.OBJECT;case P:return f.FIELD_DEFINITION;case J:case ee:return f.INTERFACE;case q:case te:return f.UNION;case K:case ne:return f.ENUM;case z:return f.ENUM_VALUE;case Y:case re:return f.INPUT_OBJECT;case B:{const t=e.at(-3);return null!=t&&"kind"in t||n(),t.kind===Y?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(0,"Unexpected kind: "+Ge(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function Lr(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Er).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===V||Er(e)||e.kind===H}(c)||function(e){return e.kind===W||br(e)}(c)));if(o&&wr.has(a))return;const u=e.hideSuggestions?[]:rt(a,o?[...wr,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+He(u),{nodes:t}))}var c}}}const wr=new Set([...bn,...Hn].map((e=>e.name)));function Ir(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Or(e){switch(e.kind){case $:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:Or(e.value)}))).sort(((e,t)=>Ze(e.name.value,t.name.value))))};case x:return{...e,values:e.values.map(Or)};case I:case O:case k:case _:case A:case D:case w:return e}var t}function kr(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+kr(t))).join(" and "):e}function _r(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);const c=e.getFragment(a.node.name.value);if(!c)return;const[u,l]=Vr(e,n,c,a.varMap);if(s!==u){Dr(e,t,n,r,i,o,s,void 0,u,a.varMap);for(const a of l)_r(e,t,n,r,i,o,s,a)}}function Ar(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value&&!$r(s.node.arguments,s.varMap,a.node.arguments,a.varMap))return void e.reportError(new GraphQLError(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);const c=e.getFragment(s.node.name.value),u=e.getFragment(a.node.name.value);if(!c||!u)return;const[l,p]=Vr(e,n,c,s.varMap),[d,f]=Vr(e,n,u,a.varMap);Dr(e,t,n,r,i,o,l,s.varMap,d,a.varMap);for(const a of f)Ar(e,t,n,r,i,o,s,a);for(const s of p)Ar(e,t,n,r,i,o,s,a)}function Dr(e,t,n,r,i,o,s,a,c,u){for(const[l,p]of s.entries()){const s=c.get(l);if(null!=s)for(const c of p)for(const p of s){const s=xr(e,n,r,i,o,l,c,a,p,u);s&&t.push(s)}}}function xr(e,t,n,r,i,o,s,a,c,u){const[l,p,d]=s,[f,h,m]=c,v=i||l!==f&&wt(l)&&wt(f);if(!v){const e=p.name.value,t=h.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[p],[h]];if(!$r(p.arguments,a,h.arguments,u))return[[o,"they have differing arguments"],[p],[h]]}if(!function(e,t,n,r){const i=Qr(e),o=Qr(n);if(!i&&!o)return!0;if(i&&o)return $r(i.arguments,t,o.arguments,r);return!1}(p.directives??[],a,h.directives??[],u))return[[o,"they have differing stream directives"],[p],[h]];const y=d?.type,g=m?.type;if(y&&g&&Cr(y,g))return[[o,`they return conflicting types "${Ge(y)}" and "${Ge(g)}"`],[p],[h]];const T=p.selectionSet,E=h.selectionSet;if(T&&E){const i=function(e,t,n,r,i,o,s,a,c,u,l){const p=[],[d,f]=Rr(e,t,o,s,a),[h,m]=Rr(e,t,c,u,l);Dr(e,p,t,n,r,i,d,a,h,l);for(const o of m)_r(e,p,t,n,r,i,d,o);for(const o of f)_r(e,p,t,n,r,i,h,o);for(const o of f)for(const s of m)Ar(e,p,t,n,r,i,o,s);return p}(e,t,n,r,v,Ut(y),T,a,Ut(g),E,u);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(i,o,p,h)}}function $r(e,t,n,r){if(void 0===e||0===e.length)return void 0===n||0===n.length;if(void 0===n||0===n.length)return!1;if(e.length!==n.length)return!1;const i=new Map(n.map((({name:e,value:t})=>[e.value,void 0===r?t:Fr(t,r)])));return e.every((e=>{let n=e.value;t&&(n=Fr(n,t));const r=i.get(e.name.value);return void 0!==r&&Gr(n)===Gr(r)}))}function Fr(e,t){switch(e.kind){case w:return t.get(e.name.value)??e;case x:return{...e,values:e.values.map((e=>Fr(e,t)))};case $:return{...e,fields:e.fields.map((e=>({...e,value:Fr(e.value,t)})))};default:return e}}function Gr(e){return ft(Or(e))}function Qr(e){return e.find((e=>"stream"===e.name.value))}function Cr(e,t){return Dt(e)?!Dt(t)||Cr(e.ofType,t.ofType):!!Dt(t)||(xt(e)?!xt(t)||Cr(e.ofType,t.ofType):!!xt(t)||!(!Gt(e)&&!Gt(t))&&e!==t)}function Rr(e,t,n,r,i){const o=t.get(r);if(o)return o;const s=new Map,a=new Map;jr(e,n,r,s,a,i);const c=[s,Array.from(a.values())];return t.set(r,c),c}function Vr(e,t,n,r){const i=t.get(n.selectionSet);if(i)return i;const o=vr(e.getSchema(),n.typeCondition);return Rr(e,t,o,n.selectionSet,r)}function jr(e,t,n,r,i,o){for(const s of n.selections)switch(s.kind){case T:{const e=s.name.value;let n;(wt(t)||Ot(t))&&(n=t.getFields()[e]);const i=s.alias?s.alias.value:e;let o=r.get(i);null==o&&(o=[],r.set(i,o)),o.push([t,s,n]);break}case N:{const t=Mr(e,s,o);i.set(t.key,t);break}case S:{const n=s.typeCondition,a=n?vr(e.getSchema(),n):t;jr(e,a,s.selectionSet,r,i,o);break}}}function Mr(e,t,n){let r="";const i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(const e of t.arguments)s.set(e.name.value,e.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(const[e,t]of o.variableDefinitions){const o=s.get(e);o&&(r+=e+": "+ft(Or(o)));const a=s.get(e);void 0!==a?i.set(e,void 0!==n?Fr(a,n):a):t.defaultValue&&i.set(e,t.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){const r=this._data.get(e)?.get(t);return void 0!==r&&(!!n||n===r)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e[e.name,e]))));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(Br).map((e=>[e.name.value,e]))))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of i.entries())if(!o.has(t)){const i=St(s.type)?Ge(s.type):ft(s.type);e.reportError(new GraphQLError(`Argument "@${r}(${t}:)" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Br(e){return e.type.kind===R&&null==e.defaultValue}function Jr(e,n){if(xt(n)){if(null==e)return;return Jr(e,n.ofType)}if(null==e)return null;if(Dt(n)){if(!Je(e)){const t=Jr(e,n.ofType);if(void 0===t)return;return[t]}const t=[];for(const r of e){const e=Jr(r,n.ofType);if(void 0===e)return;t.push(e)}return t}if(At(n)){if(!t(e))return;const r={},i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(i)){const n=e[t.name];if(void 0===n){if(Wt(t))return;const e=zr(t);void 0!==e&&(r[t.name]=e)}else{const e=Jr(n,t.type);if(void 0===e)return;r[t.name]=e}}if(n.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}const r=Qt(n);try{return r.coerceInputValue(e)}catch(e){}}function qr(e,t,n,r){if(e.kind===w){const i=Kr(e,n,r);if(null==i&&xt(t))return;return i}if(xt(t)){if(e.kind===A)return;return qr(e,t.ofType,n,r)}if(e.kind===A)return null;if(Dt(t)){if(e.kind!==x){const i=qr(e,t.ofType,n,r);if(void 0===i)return;return[i]}const i=[];for(const o of e.values){let e=qr(o,t.ofType,n,r);if(void 0===e){if(o.kind!==w||null!=Kr(o,n,r)||xt(t.ofType))return;e=null}i.push(e)}return i}if(At(t)){if(e.kind!==$)return;const i={},o=t.getFields();if(e.fields.some((e=>!Object.hasOwn(o,e.name.value))))return;const s=new Map(e.fields.map((e=>[e.name.value,e])));for(const e of Object.values(o)){const t=s.get(e.name);if(!t||t.value.kind===w&&null==Kr(t.value,n,r)){if(Wt(e))return;const t=zr(e);void 0!==t&&(i[e.name]=t)}else{const o=qr(t.value,e.type,n,r);if(void 0===o)return;i[e.name]=o}}if(t.isOneOf){const e=Object.keys(i);if(1!==e.length)return;if(null===i[e[0]])return}return i}const i=Qt(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(sn(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(e){}}function Kr(e,t,n){const r=e.name.value;return void 0!==n?.sources[r]?n.coerced[r]:t?.coerced[r]}function zr(e){let t=e._memoizedCoercedDefaultValue;if(void 0!==t)return t;const r=e.default;if(void 0!==r)return t=r.literal?qr(r.literal,e.type):Jr(r.value,e.type),void 0!==t||n(),e._memoizedCoercedDefaultValue=t,t;const i=e.defaultValue;return void 0!==i&&(e._memoizedCoercedDefaultValue=i),i}function Yr(e,t,n,r,i){const o=[],s=Object.create(null);for(const[e,i]of Object.entries(t))o.push(i),s[e]={signature:i,value:r?.sources[e]?.value??n.sources[e]?.value};return{sources:s,coerced:Hr(e,o,n,r,i)}}function Hr(e,t,r,i,o){const s={},a=e.arguments??[],c=new Map(a.map((e=>[e.name.value,e])));for(const a of t){const t=a.name,u=a.type,l=c.get(t);if(!l){if(Kt(a))throw new GraphQLError(`Argument "${It(a)?a:a.name}" of required type "${u}" was not provided.`,{nodes:e});const n=zr(a);void 0!==n&&(s[t]=n);continue}const p=l.value;if(p.kind===w){const e=p.name.value,n=i?.sources[e]?i:r;if(!(null!=n&&Object.hasOwn(n.coerced,e)||Kt(a))){const e=zr(a);void 0!==e&&(s[t]=e);continue}}const d=qr(p,u,r,i);void 0===d&&(ln(p,u,((e,t)=>{throw e.message=`Argument "${It(a)?a:a.name}" has invalid value${ze(t)}: ${e.message}`,e}),r,i,o),n(0,"Invalid argument")),s[t]=d}return s}function Wr(e,t,n,r,i){const o=t.directives?.find((t=>t.name.value===e.name));if(o)return Hr(o,e.args,n,r,i)}function Xr(e,t,n,r,i,o){const s=new AccumulatorMap,a=[];return Zr({schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Set,hideSuggestions:o},i,s,a),{groupedFieldSet:s,newDeferUsages:a}}function Zr(e,t,n,r,i,o){const{schema:s,fragments:a,variableValues:c,runtimeType:u,visitedFragmentNames:l,hideSuggestions:p}=e;for(const f of t.selections)switch(f.kind){case T:if(!ti(f,c,o))continue;n.add((d=f).alias?d.alias.value:d.name.value,{node:f,deferUsage:i,fragmentVariableValues:o});break;case S:{if(!ti(f,c,o)||!ni(s,f,u))continue;const t=ei(c,o,f,i);t?(r.push(t),Zr(e,f.selectionSet,n,r,t,o)):Zr(e,f.selectionSet,n,r,i,o);break}case N:{const t=f.name.value;if(l.has(t)||!ti(f,c,o))continue;const d=a[t];if(null==d||!ni(s,d.definition,u))continue;const h=ei(c,o,f,i),m=d.variableSignatures;let v;m&&(v=Yr(f,m,c,o,p)),h?(r.push(h),Zr(e,d.definition.selectionSet,n,r,h,v)):(l.add(t),Zr(e,d.definition.selectionSet,n,r,i,v));break}}var d}function ei(e,t,n,r){const i=Wr(On,n,e,t);if(i&&!1!==i.if)return{label:"string"==typeof i.label?i.label:void 0,parentDeferUsage:r}}function ti(e,t,n){const r=Wr(In,e,t,n);if(!0===r?.if)return!1;const i=Wr(wn,e,t,n);return!1!==i?.if}function ni(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=vr(e,r);return i===n||!!Rt(i)&&e.isSubType(i,n)}function ri(e){return e.map((e=>e.node))}function ii(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function oi(e){return{Field:t,Directive:t};function t(t){const n=ii(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function si(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===H&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===V||n.kind===W)r=o;else if(Er(n)||br(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function ai(e,t){return!!(wt(e)||Ot(e)||At(e))&&null!=e.getFields()[t]}function ci(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function ui(e,t,n){return n&&ln(t,n,(t=>{e.reportError(t)}),void 0,void 0,e.hideSuggestions),!1}function li(e,t,n,r,i){if(xt(r)&&!xt(t)){if(!(null!=n&&n.kind!==A)&&!(void 0!==i))return!1;return Zt(e,t,r.ofType)}return Zt(e,t,r)}const pi=Object.freeze([function(e){function t(n,r=Object.create(null),i=0){if(n.kind===N){const o=n.name.value;if(!0===r[o])return!1;const s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===T&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}]),di=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!Tr(n)){const t=n.kind===V||n.kind===W?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=e.getSchema();return{OperationDefinition(n){const r=n.operation;t.getRootType(r)||e.reportError(new GraphQLError(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===v)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===L&&(a[e.name.value]={definition:e});const{groupedFieldSet:c}=Xr(n,a,o,r,t.selectionSet,e.hideSuggestions);if(c.size>1){const t=[...c.values()].slice(1).flatMap((e=>ri(e)));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){ri(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ri(t)}))}}}}}},Lr,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=vr(e.getSchema(),n);if(t&&!Ct(t)){const t=ft(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=vr(e.getSchema(),t.typeCondition);if(n&&!Ct(n)){const n=ft(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=vr(e.getSchema(),t.type);if(void 0!==n&&!$t(n)){const n=t.variable.name.value,r=ft(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Gt(Ut(n))){if(r){const i=t.name.value,o=Ge(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=He("to use an inline fragment on",e.hideSuggestions?[]:function(e,t,n){if(!Rt(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Ot(t)&&e.isSubType(t,n)?-1:Ot(n)&&e.isSubType(n,t)?1:Ze(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=He(e.hideSuggestions?[]:function(e,t){if(wt(e)||Ot(e)){return rt(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},Ir,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Ct(n)&&Ct(r)&&!en(e.getSchema(),n,r)){const i=Ge(r),o=Ge(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=vr(e.getSchema(),n.typeCondition);if(Ct(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!en(e.getSchema(),r,i)){const o=Ge(i),s=Ge(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=ii(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i,fragmentVariableDefinition:o}of r){if(o)continue;const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{FragmentDefinition(t){const n=e.getVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(`Variable "$${i}" is never used in fragment "${t.name.value}".`,{nodes:n}))}},OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set;for(const{node:e,fragmentVariableDefinition:t}of n){const n=e.name.value;t||r.add(n)}const i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Sr,si,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===On.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i}".`,{nodes:t}))),i&&t.name.value===kn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===d.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===L&&t.has(a.name.value)||a.kind===v&&a.operation===d.SUBSCRIPTION)&&(n.name.value===On.name?gr(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===kn.name&&(gr(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===On.name||n.name.value===kn.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;if(i.kind!==k)return void e.reportError(new GraphQLError(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===kn.name&&!(Dt(n.type)||Vt(n.type)&&Dt(n.type.ofType))&&e.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}},function(e){return{...Nr(e),FragmentArgument(t){const n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){const r=t.name.value,i=e.hideSuggestions?[]:rt(r,Array.from(n.variableDefinitions.values()).map((e=>e.variable.name.value)));e.reportError(new GraphQLError(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+He(i),{nodes:t}))}}},Argument(t){const n=e.getArgument(),r=e.getFieldDef();if(!n&&r){const n=t.name.value,i=e.hideSuggestions?[]:rt(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${r}".`+He(i),{nodes:t}))}}}},oi,function(e){return{NullValue:t=>ui(e,t,e.getInputType()),ListValue:t=>ui(e,t,e.getParentInputType()),ObjectValue:t=>ui(e,t,e.getInputType()),EnumValue:t=>ui(e,t,e.getInputType()),IntValue:t=>ui(e,t,e.getInputType()),FloatValue:t=>ui(e,t,e.getInputType()),StringValue:t=>ui(e,t,e.getInputType()),BooleanValue:t=>ui(e,t,e.getInputType())}},function(e){return{...Pr(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)!r.has(i.name)&&Kt(i)&&e.reportError(new GraphQLError(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){const n=e.getFragmentSignature();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const[i,o]of n.variableDefinitions)if(!r.has(i)&&Br(o)){const n=Ge(vr(e.getSchema(),o.type));e.reportError(new GraphQLError(`Fragment "${t.name.value}" argument "${i}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,parentType:o,defaultValue:s,fragmentVariableDefinition:a}of r){const r=n.name.value;let c=a;if(c||(c=t.get(r)),c&&i){const t=e.getSchema(),a=vr(t,c.type);a&&!li(t,a,c.defaultValue,i,s)&&e.reportError(new GraphQLError(`Variable "$${r}" of type "${a}" used in position expecting type "${i}".`,{nodes:[c,n]})),At(o)&&o.isOneOf&&jt(a)&&e.reportError(new GraphQLError(`Variable "$${r}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[c,n]}))}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new OrderedPairSet,n=new PairSet,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const s=[],[a,c]=Rr(e,t,i,o,void 0);if(function(e,t,n,r,i,o){for(const[s,a]of o.entries())if(a.length>1)for(let o=0;o0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(_t(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(ai(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=ii(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},Lr,Sr,si,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)Er(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=Ur[s.kind]:a&&(c=function(e){if(Lt(e))return X;if(wt(e))return Z;if(Ot(e))return ee;if(kt(e))return te;if(_t(e))return ne;if(At(e))return re;n(0,"Unexpected type: "+Ge(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case X:return"scalar";case Z:return"object";case ee:return"interface";case te:return"union";case ne:return"enum";case re:return"input object";default:n(0,"Unexpected kind: "+Ge(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=[...r.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+He(rt(o,n)),{nodes:i.name}))}}},Nr,oi,ci,Pr]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===L&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===N?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r,i){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===L?e:void 0;lt(e,yr(r,{VariableDefinition:()=>!1,Variable(e){let t;if(i){const o=r.getFragmentSignatureByName()(i.name.value);t=o?.variableDefinitions.get(e.name.value),n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:t})}else n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}function hi(e,t,n=di,r){!function(e){const t=er(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const i=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),o=[],s=new TypeInfo(e),a=new ValidationContext(e,t,s,(e=>{if(o.length>=100)throw i;o.push(e)}),!1),c=pt(n.map((e=>e(a))));try{lt(t,yr(s,c))}catch(e){if(e!==i)throw e;o.push(i)}return o}function mi(e,n){t(e)&&t(e.__schema)||xe(0,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Ge(e)}.`);const r=e.__schema,i=new Map(r.types.map((e=>[e.name,f(e)])));for(const e of[...bn,...Hn])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map((function(e){if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=Ge(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Jn.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Jn.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(function(e){if(!jt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL nullable type.`);return e}(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Ge(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!wt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Ot(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){switch(e.kind){case Jn.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Jn.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>m(n)});case Jn.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>m(t)});case Jn.UNION:return function(e){if(null==e.possibleTypes){const t=Ge(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Jn.ENUM:return function(e){if(null==e.enumValues){const t=Ge(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:Xe(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Jn.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=Ge(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t,n,r;throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${Ge(e)}.`)}function h(e){if(null===e.interfaces&&e.kind===Jn.INTERFACE)return[];if(null==e.interfaces){const t=Ge(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function m(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${Ge(e)}.`);return Xe(e.fields,(e=>e.name),v)}function v(e){const t=u(e.type);if(!Ft(t)){const e=Ge(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return Xe(e,(e=>e.name),g)}function g(e){const t=u(e.type);if(!$t(t)){const e=Ge(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}return{description:e.description,type:t,default:null!=e.defaultValue?{literal:Ve(e.defaultValue)}:void 0,deprecationReason:e.deprecationReason}}}const vi={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function yi(e,t){const r=t({getNamedType:u,setNamedType:function(e){i.set(e.name,e)},getNamedTypes:function(){return Array.from(i.values())}}),i=new Map;for(const t of e.types){const e=t.name,n=l(t);n&&i.set(e,n)}const o=[];for(const t of e.directives){if(Fn(t)){o.push(t);continue}const e=m(t.toConfig());e&&o.push(new GraphQLDirective(e))}const s={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(i.values()),directives:o},a=r[vi.SCHEMA];return null==a?s:a(s);function c(e){return Dt(e)?new GraphQLList(c(e.ofType)):xt(e)?new GraphQLNonNull(c(e.ofType)):u(e.name)}function u(e){const t=gi.get(e)??i.get(e);return void 0!==t||n(0,`Unknown type: "${e}".`),t}function l(e){return Wn(e)||Nn(e)?e:Lt(e)?function(e){let t=e.toConfig();const n=r[vi.SCALAR];return t=null==n?t:n(t),new GraphQLScalarType(t)}(e):wt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[vi.OBJECT];return n=null==i?n:i(n),new GraphQLObjectType(n)}(e):Ot(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[vi.INTERFACE];return n=null==i?n:i(n),new GraphQLInterfaceType(n)}(e):kt(e)?function(e){const t=e.toConfig();let n={...t,types:()=>t.types.map((e=>u(e.name)))};const i=r[vi.UNION];return n=null==i?n:i(n),new GraphQLUnionType(n)}(e):_t(e)?function(e){const t=e.toConfig();let n={...t,values:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.values)){const t=f(i,r,e.name);n[r]=t}return n}};const i=r[vi.ENUM];return n=null==i?n:i(n),new GraphQLEnumType(n)}(e):At(e)?function(e){const t=e.toConfig();let n={...t,fields:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.fields)){const t=h(i,r,e.name);n[r]=t}return n}};const i=r[vi.INPUT_OBJECT];return n=null==i?n:i(n),new GraphQLInputObjectType(n)}(e):void n(0,"Unexpected type: "+Ge(e))}function p(e,t){const n=Object.create(null);for(const[i,o]of Object.entries(e)){let e={...o,type:c(o.type),args:d(o.args,t,i)};const s=r[vi.FIELD];s&&(e=s(e,t)),n[i]=e}return n}function d(e,t,n){const i=Object.create(null);for(const[o,s]of Object.entries(e)){let e={...s,type:c(s.type)};const a=r[vi.ARGUMENT];a&&(e=a(e,t,n)),i[o]=e}return i}function f(e,t,n){const i={...e},o=r[vi.ENUM_VALUE];return null==o?i:o(i,t,n)}function h(e,t,n){const i={...e,type:c(e.type)},o=r[vi.INPUT_FIELD];return null==o?i:o(i,t,n)}function m(e){const t={...e,args:d(e.args,e.name,void 0)},n=r[vi.DIRECTIVE];return null==n?t:n(t)}}const gi=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ti(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let h=!1;for(const e of t.definitions){switch(e.kind){case V:d=e;break;case W:f.push(e);break;case H:p.push(e);break;case M:case U:case J:case q:case K:case Y:i.push(e);break;case X:o.add(e.name.value,e);break;case Z:s.add(e.name.value,e);break;case ee:a.add(e.name.value,e);break;case te:c.add(e.name.value,e);break;case ne:u.add(e.name.value,e);break;case re:l.add(e.name.value,e);break;default:continue}h=!0}return h?yi(e,(e=>{const{getNamedType:t,setNamedType:h,getNamedTypes:m}=e;return{[vi.SCHEMA]:e=>{for(const e of i){const t=Ei.get(e.name.value)??I(e);h(t)}const n={query:e.query&&t(e.query.name),mutation:e.mutation&&t(e.mutation.name),subscription:e.subscription&&t(e.subscription.name),...d&&v([d]),...v(f)};return{description:d?.description?.value??e.description,...n,types:m(),directives:[...e.directives,...p.map(T)],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1}},[vi.INPUT_OBJECT]:e=>{const t=l.get(e.name)??[];return{...e,fields:()=>({...e.fields(),...N(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.ENUM]:e=>{const t=u.get(e.name)??[];return{...e,values:()=>({...e.values(),...S(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.SCALAR]:e=>{const t=o.get(e.name)??[];let n=e.specifiedByURL;for(const e of t)n=Ni(e)??n;return{...e,specifiedByURL:n,extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.OBJECT]:e=>{const t=s.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...L(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.INTERFACE]:e=>{const t=a.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...L(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.UNION]:e=>{const t=c.get(e.name)??[];return{...e,types:()=>[...e.types(),...w(t)],extensionASTNodes:e.extensionASTNodes.concat(t)}}};function v(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=y(n.type)}return t}function y(e){const r=e.name.value,i=t(r);return void 0!==i||n(0,`Unknown type: "${r}".`),i}function g(e){return e.kind===C?new GraphQLList(g(e.type)):e.kind===R?new GraphQLNonNull(g(e.type)):y(e)}function T(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:b(e.arguments),astNode:e})}function E(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:g(n.type),description:n.description?.value,args:b(n.arguments),deprecationReason:bi(n),astNode:n}}return t}function b(e){const t=e??[],n=Object.create(null);for(const e of t){const t=g(e.type);n[e.name.value]={type:t,description:e.description?.value,default:e.defaultValue&&{literal:e.defaultValue},deprecationReason:bi(e),astNode:e}}return n}function N(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=g(n.type);t[n.name.value]={type:e,description:n.description?.value,default:n.defaultValue&&{literal:n.defaultValue},deprecationReason:bi(n),astNode:n}}}return t}function S(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:bi(n),astNode:n}}return t}function L(e){return e.flatMap((e=>e.interfaces?.map(y)??[]))}function w(e){return e.flatMap((e=>e.types?.map(y)??[]))}function I(e){const t=e.name.value;switch(e.kind){case U:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>L(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case J:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>L(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case K:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:()=>S(r),astNode:e,extensionASTNodes:n})}case q:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>w(r),astNode:e,extensionASTNodes:n})}case M:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:Ni(e),astNode:e,extensionASTNodes:n})}case Y:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>N(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(Wr(xn,n)))})}}var n}})):e}const Ei=new Map([...bn,...Hn].map((e=>[e.name,e])));function bi(e){const t=Wr(An,e);return t?.reason}function Ni(e){const t=Wr(Dn,e);return t?.url}function Si(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[wi(e),...i.map((e=>function(e){return xi(e)+`directive ${e}`+_i(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(Lt(e))return function(e){return xi(e)+`scalar ${e}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${ft({kind:k,value:e.specifiedByURL})})`}(e)}(e);if(wt(e))return function(e){return xi(e)+`type ${e}`+Ii(e)+Oi(e)}(e);if(Ot(e))return function(e){return xi(e)+`interface ${e}`+Ii(e)+Oi(e)}(e);if(kt(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return xi(e)+`union ${e.name}`+n}(e);if(_t(e))return function(e){const t=e.getValues().map(((e,t)=>xi(e," ",!t)+" "+e.name+Di(e.deprecationReason)));return xi(e)+`enum ${e}`+ki(t)}(e);if(At(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>xi(e," ",!t)+" "+Ai(e)));return xi(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+ki(t)}(e);n(0,"Unexpected type: "+Ge(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!Fn(e)),Li)}function Li(e){return!Nn(e)&&!Wn(e)}function wi(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:xi(e)+"schema {\n"+(t?` query: ${t}\n`:"")+(n?` mutation: ${n}\n`:"")+(r?` subscription: ${r}\n`:"")+"}"}function Ii(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function Oi(e){return ki(Object.values(e.getFields()).map(((e,t)=>xi(e," ",!t)+" "+e.name+_i(e.args," ")+": "+String(e.type)+Di(e.deprecationReason))))}function ki(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function _i(e,t=""){return 0===e.length?"":e.every((e=>null==e.description))?"("+e.map(Ai).join(", ")+")":"(\n"+e.map(((e,n)=>xi(e," "+t,!n)+" "+t+Ai(e))).join("\n")+"\n"+t+")"}function Ai(e){let t=e.name+": "+String(e.type);const n=Cn(e);return n&&(t+=` = ${ft(n)}`),t+Di(e.deprecationReason)}function Di(e){if(null==e)return"";if(e!==_n){return` @deprecated(reason: ${ft({kind:k,value:e})})`}return" @deprecated"}function xi(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+ft({kind:k,value:r,block:de(r)}).replaceAll("\n","\n"+t)+"\n"}function $i(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:m,definitions:t}}const Fi=[Ir];function Gi(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Qi,Ci,Ri,Vi,...n?[n]:[],...r?[r]:[],...di.filter((e=>!Fi.includes(e)))]}function Qi(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function Ci(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Ri(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==On.name&&null==t.typeCondition&&e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",{nodes:t}))}}}function Vi(e){return{InlineFragment(t){var n;if(t.directives)for(const r of t.directives)r.name.value!=On.name||(null===(n=r.arguments)||void 0===n?void 0:n.find((e=>"label"==e.name.value)))||e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",{nodes:t}))}}}function ji(e){return{kind:h,value:e}}function Mi(e){return{kind:k,value:e}}function Ui(e){return{kind:H,description:e.description?Mi(e.description):void 0,name:ji(e.name),repeatable:!1,locations:e.locations.map((e=>ji(e))),arguments:e.args.map((e=>function(e){return{kind:B,description:Mi(e.description),name:ji(e.name),type:Pi(Ut(e.type))}}(e)))}}function Pi(e){return{kind:Q,name:ji(e.name)}}function Bi(e){return{kind:R,type:e}}const Ji={kind:H,description:Mi("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:ji("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[ji("QUERY"),ji("MUTATION"),ji("SUBSCRIPTION"),ji("FRAGMENT_DEFINITION")]},qi={kind:H,description:Mi("Attach extra information to a given type."),name:ji("typePolicy"),arguments:[{kind:B,description:Mi("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),name:ji("keyFields"),type:Bi(Pi(gn))}],repeatable:!1,locations:[ji("OBJECT"),ji("INTERFACE")]},Ki={kind:H,description:Mi("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),name:ji("import"),arguments:[{kind:B,description:Mi("The name of the module to import."),name:ji("module"),type:Bi(Pi(gn))}],repeatable:!0,locations:[ji("QUERY"),ji("MUTATION"),ji("SUBSCRIPTION"),ji("FRAGMENT_DEFINITION")]},zi=[Ji,Ki,qi];const Yi={kind:T,name:{kind:h,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Hi(e){const t=function(e,t,n=fi){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return lt(e,pt(n.map((e=>e(i))))),r}(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Wi(e){const t=er(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Xi(e){return e.startsWith("__")}function Zi(e){if(!e)return!1;for(const t of e)if(t.name.value==Ji.name.value)return!0;return!1}const eo={kind:T,name:{kind:h,value:"__typename"}};function to(e,t){return t&&(e=function(e){return lt(e,{enter:e=>e.kind!==g?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===T||e.kind===L||e.kind===S)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Yi,...e.selectionSet.selections]}}}})}(e)),lt(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![T,L].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==eo.kind&&e.name.value==eo.name.value));return t?e:{...e,selections:[eo,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==eo.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){const t=[Ji,Ki];for(const n of t)if(e.name.value==n.name.value)return null;return e}(e)}})}function no(e){return null!=e}function ro(e){switch(e.kind){case w:return{kind:e.kind,value:e.name.value};case x:return{kind:e.kind,value:e.values.map(ro)};case $:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=ro(t.value),e)),{})};default:return e}}function io(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function oo(e,t,n,r,i){var o,s,a;const c=new Map;for(const e of t.definitions)e.kind===L&&c.set(e.name.value,e);const u=[],l=new Map,p=new Set,d=r,f=e.getQueryType();if(void 0===f)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const h={queryType:f,mutationType:null!==(o=e.getMutationType())&&void 0!==o?o:void 0,subscriptionType:null!==(s=e.getSubscriptionType())&&void 0!==s?s:void 0};for(const e of t.definitions)e.kind===v&&u.push(g(e));for(const[e,t]of c.entries())l.set(e,E(t));return{rootTypes:h,operations:u,fragments:Array.from(l.values()),referencedTypes:Array.from(p.values()),schemaDocumentation:null!==(a=e.description)&&void 0!==a?a:void 0};function m(t){if(!p.has(t)){if(p.add(t),Ot(t)){const n=e.getPossibleTypes(t);t._implementingObjects=n;for(const e of n)d&&!y(e)||m(Ut(e))}if(kt(t)){const e=t.getTypes();for(t of e)m(Ut(t))}if(At(t)&&function(e){const t=e.getFields();for(const e in t){m(Ut(t[e].type))}}(t),wt(t))for(const e of t.getInterfaces())m(Ut(e))}}function y(e){var t,n;const r=qi.name.value;for(const i of null!==(n=null===(t=e.astNode)||void 0===t?void 0:t.directives)&&void 0!==n?n:[])if(i.name.value===r)return!0;return!1}function g(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=io(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?ro(t.defaultValue):void 0,i=vr(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return m(Ut(i)),{name:n,type:i,defaultValue:r}})),u=ft(to(t,n)),l=e.getRootType(s),[p]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(l);const d=I(t.selectionSet,l,a),f=Array.from(a.values());return Zi(t.directives)&&b(f),{name:o,operationType:s,variables:c,rootType:l,selectionSet:d,directives:p,referencedFragments:f,source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=io(t),s=ft(to(t,n)),a=new Set,c=vr(e,t.typeCondition),[u]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(Ut(c));const l=I(t.selectionSet,c,a),p=Array.from(a.values());return Zi(t.directives)&&b(p),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:l,directives:u,referencedFragments:p,overrideAsLocalCacheMutation:!1}}function b(e){e.forEach((e=>{e.overrideAsLocalCacheMutation=!0,b(e.referencedFragments)}))}function I(t,n,r){return{parentType:n,selections:t.selections.map((t=>function(t,n,r){var o,s,a,u;const[p,d]=null!==(o=k(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case T:{const f=t.name.value;if("__typename"==f)return;const h=null===(s=t.alias)||void 0===s?void 0:s.value,v=function(e,t,n){return n===Kn.name&&e.getQueryType()===t?Kn:n===zn.name&&e.getQueryType()===t?zn:n===Yn.name&&(wt(t)||Ot(t)||kt(t))?Yn:wt(t)||Ot(t)?t.getFields()[n]:void 0}(e,n,f);if(!v)throw new GraphQLError(`Cannot query field "${f}" on type "${String(n)}"`,{nodes:t});const y=v.type,g=Ut(v.type);m(Ut(g));const{description:b,deprecationReason:L}=v;let w={kind:"Field",name:f,alias:h,type:y,arguments:O(v,t.arguments),inclusionConditions:d,description:!Xi(f)&&b?b:void 0,deprecationReason:L||void 0,directives:p};function _(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Dt(y)||xt(y)&&Dt(y.ofType)?_(t,null===(a=i.disallowedFieldNames)||void 0===a?void 0:a.entityList,i.schemaNamespace):Ct(g)&&_(t,null===(u=i.disallowedFieldNames)||void 0===u?void 0:u.entity,i.schemaNamespace),Ct(g)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${f}" on type "${String(n)}" requires selection set`,{nodes:t});w.selectionSet=I(A,g,r)}return w}case S:{const D=t.typeCondition,x=D?vr(e,D):n;return m(x),{kind:"InlineFragment",selectionSet:I(t.selectionSet,x,r),inclusionConditions:d,directives:p}}case N:{const $=t.name.value,F=function(e){let t=l.get(e);if(t)return t;const n=c.get(e);return n?(c.delete(e),t=E(n),l.set(e,t),t):void 0}($);if(!F)throw new GraphQLError(`Unknown fragment "${$}".`,{nodes:t.name});r.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,r))).filter(no)}}function O(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:ro(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function k(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:O(o,i.arguments)});const s=A(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function A(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case _:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case w:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function so(e){return e.kind===H&&e.name.value===On.name}function ao(){return{kind:m,definitions:[Ui(On)]}}const co=qi.name.value;function uo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()}function lo(e){var t,n,r,i;if(kt(e))return;for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const t=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===co));if(t)return{directive:t,source:e}}let o;for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])if(t.name.value===co){o={directive:t,source:e};break}if("getInterfaces"in e)for(const t of e.getInterfaces()){const n=lo(t);if(n)if(o){if(!uo(o.directive,n.directive))throw o.source===e?new GraphQLError(`Type "${e.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${n.source.name}".`,{nodes:e.astNode}):new GraphQLError(`Type "${e.name}" inherits conflicting @typePolicy directives from interfaces "${o.source.name}" and "${n.source.name}".`,{nodes:e.astNode})}else o=n}return o}function po(e){var t,n,r;const i=lo(e);if(!i)return[];const o=null===(r=null===(n=null===(t=i.directive)||void 0===t?void 0:t.arguments)||void 0===n?void 0:n.find((e=>"keyFields"===e.name.value)))||void 0===r?void 0:r.value;if(!o||o.kind!==k)return[];const s=o.value.split(" ");return function(e,t){const{directive:n,source:r}=e;if(kt(r))return;const i=Ot(r)?"interface":"object";var o=r.getFields();for(const e of t){if(!e)throw new GraphQLError("Key fields must be a space-separated list of identifiers.",{nodes:n});const t=o[e];if(!t)throw new GraphQLError(`Key field "${e}" does not exist on ${i} "${r.name}".`,{nodes:r.astNode?[r.astNode,n]:n});if(!xt(t.type))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be non-nullable.`,{nodes:t.astNode?[t.astNode,n]:n});if(!Lt(t.type.ofType))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be a scalar type, got ${t.type}.`,{nodes:t.astNode?[t.astNode,n]:n})}}(i,s),s}function fo(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&(n._apolloKeyFields=po(n))}}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r,i){return oo(e,t,n,r,i)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(Re(r));var r=function(e){const t=zi.filter((t=>!e.definitions.some((e=>e.kind==H&&e.name.value==t.name.value))));return $i([e,{kind:m,definitions:t}])}($i(n));if(t){var i=function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=mi(t);return n}(t.body);return r=function(e,t){const n=e.getDirective(On.name);return n?function(e,t){return e.isRepeatable===t.isRepeatable&&e.locations.slice(0).sort().toString()===t.locations.slice(0).sort().toString()&&e.args.map((e=>e.name)).sort().toString()===t.args.map((e=>e.name)).sort().toString()}(n,On)?t:(console.warn(`Unsupported ${n.name} directive found. It will be replaced with a supported definition instead.`),$i([t,ao()])):$i([t,ao()])}(i,r),fo(i=function(e,t,n){Xn(e);const r=e.toConfig(),i=Ti(r,t,n);return r===i?e:new GraphQLSchema(i)}(i,r,{assumeValid:!0})),Wi(i),i}{Hi(r=function(e){const t=e.definitions.find(so);if(!t)return $i([e,ao()]);const n=t;if(!function(e,t){var n;return e.repeatable===t.isRepeatable&&e.locations.map((e=>e.value)).sort().toString()===t.locations.slice(0).sort().toString()&&(null===(n=e.arguments)||void 0===n?void 0:n.map((e=>e.name.value)).sort().toString())===t.args.map((e=>e.name)).sort().toString()}(n,On))return console.warn(`Unsupported ${n.name.value} directive found. It will be replaced with a supported definition instead.`),{kind:m,definitions:e.definitions.filter((e=>so(e)?void 0:e)).concat(Ui(On))};return e}(r));const e=function(e,t){const n=Ti({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...$n.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}(r,{assumeValid:!0});return fo(e),Wi(e),e}},e.mergeDocuments=function(e){return $i(e)},e.parseOperationDocument=function(e){return Re(e)},e.printSchemaToSDL=function(e){return Si(e)},e.validateDocument=function(e,t,n){return hi(e,t,Gi(n))},e}({});"# \ No newline at end of file +let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){throw new Error(t??"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}const d={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},f={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION"},h="Name",m="Document",v="OperationDefinition",y="VariableDefinition",g="SelectionSet",T="Field",E="Argument",N="FragmentArgument",b="FragmentSpread",S="InlineFragment",L="FragmentDefinition",w="Variable",I="IntValue",O="FloatValue",k="StringValue",_="BooleanValue",A="NullValue",D="EnumValue",x="ListValue",$="ObjectValue",F="ObjectField",G="Directive",Q="NamedType",C="ListType",R="NonNullType",V="SchemaDefinition",j="OperationTypeDefinition",M="ScalarTypeDefinition",U="ObjectTypeDefinition",P="FieldDefinition",B="InputValueDefinition",J="InterfaceTypeDefinition",q="UnionTypeDefinition",K="EnumTypeDefinition",z="EnumValueDefinition",Y="InputObjectTypeDefinition",H="DirectiveDefinition",W="SchemaExtension",X="ScalarTypeExtension",Z="ObjectTypeExtension",ee="InterfaceTypeExtension",te="UnionTypeExtension",ne="EnumTypeExtension",re="InputObjectTypeExtension";var ie=Object.freeze({__proto__:null,ARGUMENT:E,BOOLEAN:_,DIRECTIVE:G,DIRECTIVE_DEFINITION:H,DOCUMENT:m,ENUM:D,ENUM_TYPE_DEFINITION:K,ENUM_TYPE_EXTENSION:ne,ENUM_VALUE_DEFINITION:z,FIELD:T,FIELD_DEFINITION:P,FLOAT:O,FRAGMENT_ARGUMENT:N,FRAGMENT_DEFINITION:L,FRAGMENT_SPREAD:b,INLINE_FRAGMENT:S,INPUT_OBJECT_TYPE_DEFINITION:Y,INPUT_OBJECT_TYPE_EXTENSION:re,INPUT_VALUE_DEFINITION:B,INT:I,INTERFACE_TYPE_DEFINITION:J,INTERFACE_TYPE_EXTENSION:ee,LIST:x,LIST_TYPE:C,NAME:h,NAMED_TYPE:Q,NON_NULL_TYPE:R,NULL:A,OBJECT:$,OBJECT_FIELD:F,OBJECT_TYPE_DEFINITION:U,OBJECT_TYPE_EXTENSION:Z,OPERATION_DEFINITION:v,OPERATION_TYPE_DEFINITION:j,SCALAR_TYPE_DEFINITION:M,SCALAR_TYPE_EXTENSION:X,SCHEMA_DEFINITION:V,SCHEMA_EXTENSION:W,SELECTION_SET:g,STRING:k,UNION_TYPE_DEFINITION:q,UNION_TYPE_EXTENSION:te,VARIABLE:w,VARIABLE_DEFINITION:y});function oe(e){return 9===e||32===e}function se(e){return e>=48&&e<=57}function ae(e){return e>=97&&e<=122||e>=65&&e<=90}function ce(e){return ae(e)||95===e}function ue(e){return ae(e)||se(e)||95===e}function le(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function pe(e){let t=0;for(;t",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};class Lexer{constructor(e){const t=new Token(fe.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==fe.EOF)do{if(e.next)e=e.next;else{const t=Ee(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===fe.COMMENT);return e}}function he(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function me(e,t){return ve(e.charCodeAt(t))&&ye(e.charCodeAt(t+1))}function ve(e){return e>=55296&&e<=56319}function ye(e){return e>=56320&&e<=57343}function ge(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return fe.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Te(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function Ee(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _e(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ae(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oFe)return"[Array]";const n=Math.min($e,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>Fe)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+Qe(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ce=null!=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Ge(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||xe(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||xe(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Re(e,t){const n=new Parser(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function Ve(e,t){const n=new Parser(e,t);n.expectToken(fe.SOF);const r=n.parseConstValueLiteral();return n.expectToken(fe.EOF),r}class Parser{constructor(e,t={}){const n=function(e){return Ce(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(fe.NAME);return this.node(e,{kind:h,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:m,definitions:this.many(fe.SOF,this.parseDefinition,fe.EOF)})}parseDefinition(){if(this.peek(fe.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===fe.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(fe.BRACE_L))return this.node(e,{kind:v,operation:d.QUERY,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(fe.NAME)&&(n=this.parseName()),this.node(e,{kind:v,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(fe.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(fe.PAREN_L,this.parseVariableDefinition,fe.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:y,variable:this.parseVariable(),type:(this.expectToken(fe.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(fe.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(fe.DOLLAR),this.node(e,{kind:w,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:g,selections:this.many(fe.BRACE_L,this.parseSelection,fe.BRACE_R)})}parseSelection(){return this.peek(fe.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(fe.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:T,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(fe.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(fe.PAREN_L,t,fe.PAREN_R)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(fe.PAREN_L,e,fe.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:E,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(fe.COLON),this.node(e,{kind:N,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(fe.SPREAD);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(fe.NAME)){const t=this.parseFragmentName();return this.peek(fe.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(e,{kind:b,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:b,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:S,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:L,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:L,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case fe.BRACKET_L:return this.parseList(e);case fe.BRACE_L:return this.parseObject(e);case fe.INT:return this.advanceLexer(),this.node(t,{kind:I,value:t.value});case fe.FLOAT:return this.advanceLexer(),this.node(t,{kind:O,value:t.value});case fe.STRING:case fe.BLOCK_STRING:return this.parseStringLiteral();case fe.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_,value:!0});case"false":return this.node(t,{kind:_,value:!1});case"null":return this.node(t,{kind:A});default:return this.node(t,{kind:D,value:t.value})}case fe.DOLLAR:if(e){if(this.expectToken(fe.DOLLAR),this._lexer.token.kind===fe.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k,value:e.value,block:e.kind===fe.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:x,values:this.any(fe.BRACKET_L,(()=>this.parseValueLiteral(e)),fe.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:$,fields:this.any(fe.BRACE_L,(()=>this.parseObjectField(e)),fe.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:F,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(fe.AT);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(fe.AT),this.node(t,{kind:G,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(fe.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(fe.BRACKET_R),t=this.node(e,{kind:C,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(fe.BANG)?this.node(e,{kind:R,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Q,name:this.parseName()})}peekDescription(){return this.peek(fe.STRING)||this.peek(fe.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);return this.node(e,{kind:V,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(fe.COLON);const n=this.parseNamedType();return this.node(e,{kind:j,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:M,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:U,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(fe.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseFieldDefinition,fe.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(fe.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:P,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(fe.PAREN_L,this.parseInputValueDef,fe.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(fe.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(fe.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:B,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:J,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:q,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(fe.EQUALS)?this.delimitedMany(fe.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:K,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(fe.BRACE_L,this.parseEnumValueDefinition,fe.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:z,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${je(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Y,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseInputValueDef,fe.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===fe.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:W,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:X,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Z,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ee,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:te,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ne,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:re,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(fe.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:H,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(fe.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${Me(e)}, found ${je(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==fe.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${je(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===fe.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${je(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==fe.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function je(e){const t=e.value;return Me(e.kind)+(null!=t?` "${t}"`:"")}function Me(e){return function(e){return e===fe.BANG||e===fe.DOLLAR||e===fe.AMP||e===fe.PAREN_L||e===fe.PAREN_R||e===fe.SPREAD||e===fe.COLON||e===fe.EQUALS||e===fe.AT||e===fe.BRACKET_L||e===fe.BRACKET_R||e===fe.BRACE_L||e===fe.PIPE||e===fe.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function Ue(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Pe(e){return Be("and",e)}function Be(e,t){switch(0!==t.length||n(),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}function Je(e){return"object"==typeof e&&"function"==typeof e?.[Symbol.iterator]}function qe(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function Ke(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function ze(e){return 0===e.length?"":` at ${e.map((e=>"number"==typeof e?`[${e}]`:`.${e}`)).join("")}`}const Ye=5;function He(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+Be("or",r.slice(0,Ye).map((e=>`"${e}"`)))+"?"}function We(e){return e}function Xe(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function Ze(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-et,o=t.charCodeAt(r)}while(nt(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const et=48,tt=57;function nt(e){return!isNaN(e)&&et<=e&&e<=tt}function rt(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:Ze(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=it(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=it(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function it(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>mt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=yt("(",mt(e.variableDefinitions,", "),")"),n=mt([e.operation,mt([e.name,t]),mt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+yt(" = ",n)+yt(" ",mt(r," "))},SelectionSet:{leave:({selections:e})=>vt(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=mt([yt("",e,": "),t],"");return mt([Et(o,n),yt(" ",mt(r," ")),yt(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Et("..."+e,t)+yt(" ",mt(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>mt(["...",yt("on ",e),mt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${yt("(",mt(n,", "),")")} on ${t} ${yt("",mt(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||oe(e.charCodeAt(0)))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const p=r&&oe(e.charCodeAt(0));return(u&&!p||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(st,at)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+mt(e,", ")+"]";return t.length>80?"[\n"+gt(mt(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+mt(e,", ")+" }";return t.length>80?vt(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+yt("(",mt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>yt("",e,"\n")+mt(["schema",mt(t," "),vt(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt(["scalar",t,mt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["type",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>yt("",e,"\n")+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+": "+r+yt(" ",mt(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>yt("",e,"\n")+mt([t+": "+n,yt("= ",r),mt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["interface",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>yt("",e,"\n")+mt(["union",t,mt(n," "),yt("= ",mt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>yt("",e,"\n")+mt(["enum",t,mt(n," "),vt(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt([t,mt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>yt("",e,"\n")+mt(["input",t,mt(n," "),vt(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>yt("",e,"\n")+"directive @"+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+(r?" repeatable":"")+" on "+mt(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>mt(["extend schema",mt(e," "),vt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>mt(["extend scalar",e,mt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend type",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend interface",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>mt(["extend union",e,mt(t," "),yt("= ",mt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>mt(["extend enum",e,mt(t," "),vt(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>mt(["extend input",e,mt(t," "),vt(n)]," ")}};function mt(e,t=""){return e?.filter((e=>e)).join(t)??""}function vt(e){return yt("{\n",gt(mt(e,"\n")),"\n}")}function yt(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function gt(e){return yt(" ",e.replaceAll("\n","\n "))}function Tt(e){return e?.some((e=>e.includes("\n")))??!1}function Et(e,t){let n=e+yt("(",mt(t,", "),")");return n.length>80&&(n=e+yt("(\n",gt(mt(t,"\n")),"\n)")),n}function Nt(e,t){switch(e.kind){case A:return null;case I:return parseInt(e.value,10);case O:return parseFloat(e.value);case k:case D:case _:return e.value;case x:return e.values.map((e=>Nt(e,t)));case $:return Xe(e.fields,(e=>e.name.value),(e=>Nt(e.value,t)));case w:return t?.[e.name.value]}}function bt(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(Nt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||xe(0,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&("function"==typeof e.coerceInputValue&&"function"==typeof e.coerceInputLiteral||xe(0,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=bt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Jt(e){return Pt(e??[])}function qt(e,t){return Ke(Bt(t),((t,n)=>new GraphQLField(e,n,t)))}class GraphQLField{constructor(e,t,n){this.parentType=e,this.name=bt(t),this.description=n.description,this.type=n.type;const r=n.args;this.args=r?Object.entries(r).map((([e,t])=>new GraphQLArgument(this,e,t))):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}}class GraphQLArgument{constructor(e,t,n){this.parent=e,this.name=bt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function Kt(e){return xt(e.type)&&void 0===e.default&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=bt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=bt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=zt.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function zt(e){return Pt(e)}class GraphQLEnumType{constructor(e){this.name=bt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values="function"==typeof e.values?e.values:Object.entries(e.values).map((([e,t])=>new GraphQLEnumValue(this,e,t))),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Object.entries(this._values()).map((([e,t])=>new GraphQLEnumValue(this,e,t)))),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=qe(this.getValues(),(e=>e.name))),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map((e=>[e.value,e]))));const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Ge(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if("string"!=typeof e){const n=Ge(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?"":Yt(this,n)))}const n=this.getValue(e);if(null==n)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==D){const n=ft(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?"":Yt(this,n)),{nodes:e})}const n=this.getValue(e.value);if(null==n){const n=ft(e);throw new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if("string"==typeof e&&this.getValue(e))return{kind:D,value:e}}toConfig(){return{name:this.name,description:this.description,values:Xe(this.getValues(),(e=>e.name),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Yt(e,t){return He("the enum value",rt(t,e.getValues().map((e=>e.name))))}class GraphQLEnumValue{constructor(e,t,n){this.parentEnum=e,this.name=function(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError(`Enum values cannot be named: ${e}`);return bt(e)}(t),this.description=n.description,this.value=void 0!==n.value?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class GraphQLInputObjectType{constructor(e){this.name=bt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=Ht.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:Ke(this.getFields(),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Ht(e,t){return Ke(Bt(t),((t,n)=>new GraphQLInputField(e,n,t)))}class GraphQLInputField{constructor(e,t,n){!("resolve"in n)||xe(0,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.parentType=e,this.name=bt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function Wt(e){return xt(e.type)&&void 0===e.defaultValue&&void 0===e.default}function Xt(e,t){return e===t||(xt(e)&&xt(t)||!(!Dt(e)||!Dt(t)))&&Xt(e.ofType,t.ofType)}function Zt(e,t,n){return t===n||(xt(n)?!!xt(t)&&Zt(e,t.ofType,n.ofType):xt(t)?Zt(e,t.ofType,n):Dt(n)?!!Dt(t)&&Zt(e,t.ofType,n.ofType):!Dt(t)&&(Rt(n)&&(Ot(t)||wt(t))&&e.isSubType(n,t)))}function en(e,t,n){return t===n||(Rt(t)?Rt(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!Rt(n)&&e.isSubType(n,t))}function tn(e,t,n){return{prev:e,key:t,typename:n}}function nn(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function rn(e,n){if(xt(n)){if(null==e)return;return rn(e,n.ofType)}if(null==e)return{kind:A};if(Dt(n)){if(!Je(e))return rn(e,n.ofType);const t=[];for(const r of e){const e=rn(r,n.ofType);if(!e)return;t.push(e)}return{kind:x,values:t}}if(At(n)){if(!t(e))return;const r=[],i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(n.getFields())){if(void 0===e[t.name]){if(Wt(t))return}else{const n=rn(e[t.name],t.type);if(!n)return;r.push({kind:F,name:{kind:h,value:t.name},value:n})}}return{kind:$,fields:r}}const r=Qt(n);if(r.valueToLiteral)try{return r.valueToLiteral(e)}catch(e){return}return on(e)}function on(e){if(null==e)return{kind:A};switch(typeof e){case"boolean":return{kind:_,value:e};case"string":return{kind:k,value:e,block:!1};case"number":{if(!Number.isFinite(e))return{kind:A};const t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:O,value:t}}case"object":{if(Je(e))return{kind:x,values:Array.from(e,on)};const t=e,n=[];for(const e of Object.keys(t)){const r=t[e];void 0!==r&&n.push({kind:F,name:{kind:h,value:e},value:on(r)})}return{kind:$,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${Ge(e)}.`)}function sn(e,t,n){switch(e.kind){case w:{const r=e.name.value,i=n?.sources[r]?n:t,o=i?.sources[r];if(null==o)return{kind:A};if(void 0===o.value){const e=o.signature.default;if(void 0!==e)return e.literal}return rn(o.value,o.signature.type)}case $:{const r=[];for(const i of e.fields){if(i.value.kind===w){const e=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(void 0===e?.value&&void 0===e?.signature.default)continue}const e=sn(i.value,t,n);r.push({...i,value:e})}return{...e,fields:r}}case x:{const r=[];for(const i of e.values){const e=sn(i,t,n);r.push(e)}return{...e,values:r}}default:return e}}function an(e,t,n,r){return cn(e,t,n,r,void 0)}function cn(e,n,r,i,o){if(xt(n))return void 0===e?void un(r,`Expected a value of non-null type "${n}" to be provided.`,o):null===e?void un(r,`Expected value of non-null type "${n}" not to be null.`,o):cn(e,n.ofType,r,i,o);if(null!=e)if(Dt(n))if(Je(e)){let t=0;for(const s of e)cn(s,n.ofType,r,i,tn(o,t++,void 0))}else cn(e,n.ofType,r,i,o);else if(At(n)){if(!t(e))return void un(r,`Expected value of type "${n}" to be an object, found: ${Ge(e)}.`,o);const s=n.getFields();for(const t of Object.values(s)){const s=e[t.name];void 0===s?Wt(t)&&un(r,`Expected value of type "${n}" to include required field "${t.name}", found: ${Ge(e)}.`,o):cn(s,t.type,r,i,tn(o,t.name,n.name))}const a=Object.keys(e);for(const t of a)if(!Object.hasOwn(s,t)){const i=He(rt(t,Object.keys(s)));un(r,`Expected value of type "${n}" not to include unknown field "${t}"${i?`.${i} Found`:", found"}: ${Ge(e)}.`,o)}if(n.isOneOf){1!==a.length&&un(r,`Exactly one key must be specified for OneOf type "${n}".`,o);const t=a[0];null===e[t]&&un(r,`Field "${t}" for OneOf type "${n}" must be non-null.`,o)}}else{let t,s;Qt(n);try{t=n.coerceInputValue(e,i)}catch(e){if(e instanceof GraphQLError)return void r(e,nn(o));s=e}void 0===t&&un(r,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${Ge(e)}.`,o,s)}}function un(e,t,n,r){e(new GraphQLError(t,{originalError:r}),nn(n))}function ln(e,t,n,r,i,o){return pn({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function pn(e,t,n,r,i){if(t.kind!==w){if(xt(n))return t.kind===A?void fn(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i):pn(e,t,n.ofType,r,i);if(t.kind!==A)if(Dt(n))if(t.kind!==x)pn(e,t,n.ofType,r,i);else{let o=0;for(const s of t.values)pn(e,s,n.ofType,r,tn(i,o++,void 0))}else if(At(n)){if(t.kind!==$)return void fn(e.onError,`Expected value of type "${n}" to be an object, found: ${ft(t)}.`,t,i);const o=n.getFields(),s=qe(t.fields,(e=>e.name.value));for(const a of Object.values(o)){const o=s[a.name];if(void 0===o)Wt(a)&&fn(e.onError,`Expected value of type "${n}" to include required field "${a.name}", found: ${ft(t)}.`,t,i);else{const s=o.value;if(s.kind===w&&!e.static){const r=dn(e,s),o=s.name.value,c=r?.coerced[o];if(n.isOneOf)void 0===c?fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):null===c&&fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(void 0===c&&!Wt(a))continue}pn(e,s,a.type,r,tn(i,a.name,n.name))}}const a=t.fields;for(const s of a){const a=s.name.value;if(!Object.hasOwn(o,a)){const c=r?"":He(rt(a,Object.keys(o)));fn(e.onError,`Expected value of type "${n}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ft(t)}.`,s,i)}}if(n.isOneOf){if(1!==a.length)return void fn(e.onError,`OneOf Input Object "${n}" must specify exactly one key.`,t,i);if(a[0].value.kind===A){const r=a[0].name.value;fn(e.onError,`Field "${n}.${r}" used for OneOf Input Object must be non-null.`,t,tn(i,r,void 0))}}}else{let o,s;Qt(n);try{o=n.coerceInputLiteral?n.coerceInputLiteral(sn(t),r):n.parseLiteral(t,void 0,r)}catch(t){if(t instanceof GraphQLError)return void e.onError(t,nn(i));s=t}void 0===o&&fn(e.onError,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${ft(t)}.`,t,i,s)}}else{if(e.static)return;const r=dn(e,t),o=r?.coerced[t.name.value];xt(n)&&(void 0===o?fn(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):null===o&&fn(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i))}}function dn(e,t){const n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function fn(e,t,n,r,i){e(new GraphQLError(t,{nodes:n,originalError:i}),nn(r))}const hn=2147483647,mn=-2147483648,vn=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Ge(t)}`);if(n>hn||nhn||ehn||t=mn)return{kind:I,value:String(e)}}}),yn=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(t)}`);return n},coerceInputValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==O&&e.kind!==I)throw new GraphQLError(`Float cannot represent non numeric value: ${ft(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){const t=on(e);if(t.kind===O||t.kind===I)return t}}),gn=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError(`String cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"!=typeof e)throw new GraphQLError(`String cannot represent a non string value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==k)throw new GraphQLError(`String cannot represent a non string value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===k)return t}}),Tn=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(t)}`)},coerceInputValue(e){if("boolean"!=typeof e)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===_)return t}}),En=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputLiteral(e){if(e.kind!==k&&e.kind!==I)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+ft(e),{nodes:e});return e.value},valueToLiteral(e){const t=Number.isInteger(e)?String(e):e;if("string"==typeof t)return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:k,value:t,block:!1}}}),Nn=Object.freeze([gn,vn,yn,Tn,En]);function bn(e){return Nn.some((({name:t})=>e.name===t))}function Sn(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Ln(e){return Ce(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=bt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=ot(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||xe(0,`@${this.name} locations must be an Array.`);const n=e.args??{};t(n)&&!Array.isArray(n)||xe(0,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(n).map((([e,t])=>new GraphQLArgument(this,e,t)))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const wn=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Included when true."}}}),In=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Skipped when true."}}}),On=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),kn=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{initialCount:{default:{value:0},type:new GraphQLNonNull(vn),description:"Number of items to return immediately"},if:{type:new GraphQLNonNull(Tn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),_n="No longer supported",An=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:new GraphQLNonNull(gn),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:_n}}}}),Dn=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(gn),description:"The URL that specifies the behavior of this scalar."}}}),xn=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[f.INPUT_OBJECT],args:{}}),$n=Object.freeze([wn,In,An,Dn,xn]);function Fn(e){return $n.some((({name:t})=>t===e.name))}function Gn(e,r){if(xt(r)){const t=Gn(e,r.ofType);return t?.kind===A?null:t}if(null===e)return{kind:A};if(void 0===e)return null;if(Dt(r)){const t=r.ofType;if(Je(e)){const n=[];for(const r of e){const e=Gn(r,t);null!=e&&n.push(e)}return{kind:x,values:n}}return Gn(e,t)}if(At(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=Gn(e[t.name],t.type);r&&n.push({kind:F,name:{kind:h,value:t.name},value:r})}return{kind:$,fields:n}}if(Gt(r)){const t=r.coerceOutputValue(e);if(null==t)return null;if("boolean"==typeof t)return{kind:_,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return Qn.test(e)?{kind:I,value:e}:{kind:O,value:e}}if("string"==typeof t)return _t(r)?{kind:D,value:t}:r===En&&Qn.test(t)?{kind:I,value:t}:{kind:k,value:t};throw new TypeError(`Cannot convert value to AST: ${Ge(t)}.`)}n(0,"Unexpected input type: "+Ge(r))}const Qn=/^-?(?:0|[1-9][0-9]*)$/;function Cn(e){const t=e.type,r=e.default;if(r){const e=r.literal??rn(r.value,t);return null!=e||n(0,"Invalid default value"),e}const i=e.defaultValue;if(void 0!==i){const e=Gn(i,t);return null!=e||n(0,"Invalid default value"),e}}const Rn=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:gn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Mn))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Mn),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Mn,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Mn,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Vn))),resolve:e=>e.getDirectives()}})}),Vn=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(Tn),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(jn))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),jn=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:f.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Mn=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(qn),resolve:e=>Lt(e)?Jn.SCALAR:wt(e)?Jn.OBJECT:Ot(e)?Jn.INTERFACE:kt(e)?Jn.UNION:_t(e)?Jn.ENUM:At(e)?Jn.INPUT_OBJECT:Dt(e)?Jn.LIST:xt(e)?Jn.NON_NULL:void n(0,`Unexpected type: "${Ge(e)}".`)},name:{type:gn,resolve:e=>"name"in e?e.name:void 0},description:{type:gn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:gn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Un)),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(wt(e)||Ot(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e){if(wt(e)||Ot(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e,t,n,{schema:r}){if(Rt(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Bn)),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(_t(e)){const n=e.getValues();return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(Pn)),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(At(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Mn,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:Tn,resolve:e=>{if(At(e))return e.isOneOf}}})}),Un=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:Tn,default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Pn=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},defaultValue:{type:gn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const t=Cn(e);return t?ft(t):null}},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Bn=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Jn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},qn=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Jn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Jn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Jn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Jn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Jn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Jn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Jn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Jn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Kn=new GraphQLField(void 0,"__schema",{type:new GraphQLNonNull(Rn),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),zn=new GraphQLField(void 0,"__type",{type:Mn,description:"Request the type information of a single type.",args:{name:{type:new GraphQLNonNull(gn)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),Yn=new GraphQLField(void 0,"__typename",{type:new GraphQLNonNull(gn),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Hn=Object.freeze([Rn,Vn,jn,Mn,Un,Pn,Bn,qn]);function Wn(e){return Hn.some((({name:t})=>e.name===t))}function Xn(e){if(!function(e){return Ce(e,GraphQLSchema)}(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.assumeValid=e.assumeValid??!1,this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??$n;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Zn(n,t);null!=this._queryType&&Zn(this._queryType,t),null!=this._mutationType&&Zn(this._mutationType,t),null!=this._subscriptionType&&Zn(this._subscriptionType,t);for(const e of this._directives)if(Ln(e))for(const n of e.args)Zn(n.type,t);Zn(Rn,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Ot(e)){for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(wt(e))for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return kt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(kt(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Kn.name:return this.getQueryType()===e?Kn:void 0;case zn.name:return this.getQueryType()===e?zn:void 0;case Yn.name:return Yn}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Zn(e,t){const n=Ut(e);if(!t.has(n))if(t.add(n),kt(n))for(const e of n.getTypes())Zn(e,t);else if(wt(n)||Ot(n)){for(const e of n.getInterfaces())Zn(e,t);for(const e of Object.values(n.getFields())){Zn(e.type,t);for(const n of e.args)Zn(n.type,t)}}else if(At(n))for(const e of Object.values(n.getFields()))Zn(e.type,t);return t}function er(e){if(Xn(e),e.__validationErrors)return e.__validationErrors;const n=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(wt(i))n.add(i,r);else{const n=Ue(r),o=Ge(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,tr(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=Pe(i);e.reportError(`All root types must be different, "${r}" type is used as ${n} root types.`,i.map((e=>tr(t,e))))}}(n),function(e){for(const t of e.schema.getDirectives())if(Ln(t)){ir(e,t),0===t.locations.length&&e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}else e.reportError(`Expected directive but got: ${Ge(t)}.`,t?.astNode)}(n),function(e){const n=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(xt(t.type)&&At(t.type.ofType)){const s=t.type.ofType,a=r[s.name];if(n.push({fieldStr:`${o}.${t.name}`,astNode:t.astNode}),void 0===a)i(s);else{const t=n.slice(a),r=t.map((e=>e.fieldStr)).join(", ");e.reportError(`Invalid circular reference. The Input Object ${s} references itself ${t.length>1?"via the non-null fields:":"in the non-null field"} ${r}.`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),r=function(e){const n=Object.create(null),r=[],i=Object.create(null);return function(e){return o(e,{})};function o(e,n){if(Je(n))for(const t of n)o(e,t);else if(t(n))for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?o(r,n[t.name]):a(t,r,`${e}.${t.name}`))}}function s(e,t){if(t.kind===x){for(const n of t.values)s(e,n);return}if(t.kind!==$)return;const n=qe(t.fields,(e=>e.name.value));for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?s(r,n[t.name].value):a(t,r,`${e}.${t.name}`))}}function a(t,a,c){const u=t.default;if(void 0===u)return;const l=i[c];void 0!==l&&l>0?e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${le)).join(", ")}`:""}.`,r.slice(l-1).map((([,e])=>e))):void 0===n[c]&&(n[c]=!0,i[c]=r.push([c,t.astNode?.defaultValue]),u.literal?s(a,u.literal):o(a,u.value),r.pop(),i[c]=void 0)}}(e),i=e.schema.getTypeMap();for(const t of Object.values(i))Mt(t)?(Wn(t)||ir(e,t),wt(t)||Ot(t)?(or(e,t),sr(e,t)):kt(t)?ur(e,t):_t(t)?lr(e,t):At(t)&&(pr(e,t),n(t),r(t))):e.reportError(`Expected GraphQL named type but got: ${Ge(t)}.`,t.astNode)}(n);const r=n.getErrors();return e.__validationErrors=r,r}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function tr(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function nr(e,t){const n=t.default;if(n)if(n.literal)ln(n.literal,t.type,((n,r)=>{e.reportError(`${t} has invalid default value${ze(r)}: ${n.message}`,n.nodes)}));else{const r=[];if(an(n.value,t.type,((e,t)=>{r.push([e,t])})),r.length>0)try{const r=rr(n.value,t.type),i=[];if(an(r,t.type,((e,t)=>{i.push([e,t])})),0===i.length)return void e.reportError(`${t} has invalid default value: ${Ge(n.value)}. Did you mean: ${Ge(r)}?`,t.astNode?.defaultValue)}catch(e){}for(const[n,i]of r)e.reportError(`${t} has invalid default value${ze(i)}: ${n.message}`,t.astNode?.defaultValue)}}function rr(e,r){if(xt(r))return rr(e,r.ofType);if(null===e)return null;if(Dt(r))return Je(e)?Array.from(e,(e=>rr(e,r.ofType))):[rr(e,r.ofType)];if(At(r)){t(e)||n();const i=r.getFields();return Ke(e,((e,t)=>(t in i||n(),rr(e,i[t].type))))}return Qt(r),r.coerceOutputValue(e)}function ir(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function or(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const t of n){ir(e,t),Ft(t.type)||e.reportError(`The type of ${t} must be Output Type but got: ${Ge(t.type)}.`,t.astNode?.type);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode?.type),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}}function sr(e,t){const n=new Set;for(const r of t.getInterfaces())Ot(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t} can only implement ${r} once.`,fr(t,r)):(n.add(r.name),cr(e,t,r),ar(e,t,r)):e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,fr(t,r)):e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${Ge(r)}.`,fr(t,r))}function ar(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const n=r[i.name];if(null!=n){Zt(e.schema,n.type,i.type)||e.reportError(`Interface field ${i} expects type ${i.type} but ${n} is type ${n.type}.`,[i.astNode?.type,n.astNode?.type]);for(const t of i.args){const r=n.args.find((e=>e.name===t.name));r?Xt(t.type,r.type)||e.reportError(`Interface field argument ${t} expects type ${t.type} but ${r} is type ${r.type}.`,[t.astNode?.type,r.astNode?.type]):e.reportError(`Interface field argument ${t} expected but ${n} does not provide it.`,[t.astNode,n.astNode])}for(const t of n.args)if(Kt(t)){i.args.find((e=>e.name===t.name))||e.reportError(`Argument "${t}" must not be required type "${t.type}" if not provided by the Interface field "${i}".`,[t.astNode,i.astNode])}}else e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function cr(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...fr(n,i),...fr(t,n)])}function ur(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t} can only include type ${i} once.`,hr(t,i.name)):(r.add(i.name),wt(i)||e.reportError(`Union type ${t} can only include Object types, it cannot include ${Ge(i)}.`,hr(t,String(i))))}function lr(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)ir(e,t)}function pr(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)ir(e,r),$t(r.type)||e.reportError(`The type of ${r} must be Input Type but got: ${Ge(r.type)}.`,r.astNode?.type),Wt(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${r} cannot be deprecated.`,[mr(r.astNode),r.astNode?.type]),nr(e,r),t.isOneOf&&dr(t,r,e)}function dr(e,t,n){xt(t.type)&&n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type),void 0===t.default&&void 0===t.defaultValue||n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function fr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function hr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function mr(e){return e?.directives?.find((e=>e.name.value===An.name))}function vr(e,t){switch(t.kind){case C:{const n=vr(e,t.type);return n&&new GraphQLList(n)}case R:{const n=vr(e,t.type);return n&&new GraphQLNonNull(n)}case Q:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t&&($t(t)&&this._inputTypeStack.push(t),Ct(t)&&this._parentTypeStack.push(t),Ft(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case m:{const t=function(e){const t=new Map;for(const n of e.definitions)if(n.kind===L){const e=new Map;if(n.variableDefinitions)for(const t of n.variableDefinitions)e.set(t.variable.name.value,t);const r={definition:n,variableDefinitions:e};t.set(n.name.value,r)}return t}(e);this._fragmentSignaturesByName=e=>t.get(e);break}case g:{const e=Ut(this.getType());this._parentTypeStack.push(Ct(e)?e:void 0);break}case T:{const n=this.getParentType();let r,i;n&&(r=t.getField(n,e.name.value),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Ft(i)?i:void 0);break}case G:this._directive=t.getDirective(e.name.value);break;case v:{const n=t.getRootType(e.operation);this._typeStack.push(wt(n)?n:void 0);break}case b:this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break;case S:case L:{const n=e.typeCondition,r=n?vr(t,n):Ut(this.getType());this._typeStack.push(Ft(r)?r:void 0);break}case y:{const n=vr(t,e.type);this._inputTypeStack.push($t(n)?n:void 0);break}case E:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?.default??t?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case N:{const t=this.getFragmentSignature(),n=t?.variableDefinitions.get(e.name.value);let r;this._fragmentArgument=n,n&&(r=vr(this._schema,n.type)),this._inputTypeStack.push($t(r)?r:void 0);break}case x:{const e=function(e){if(e)return xt(e)?e.ofType:e}(this.getInputType()),t=Dt(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push($t(t)?t:void 0);break}case F:{const t=Ut(this.getInputType());let n,r;At(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?.default??r?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case D:{const t=Ut(this.getInputType());let n;_t(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case m:this._fragmentSignaturesByName=()=>null;break;case g:this._parentTypeStack.pop();break;case T:this._fieldDefStack.pop(),this._typeStack.pop();break;case G:this._directive=null;break;case b:this._fragmentSignature=null;break;case v:case S:case L:this._typeStack.pop();break;case y:this._inputTypeStack.pop();break;case E:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case N:this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case x:case F:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case D:this._enumValue=null}}}function yr(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=dt(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=dt(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function gr(e){const t=e.arguments?.find((e=>"if"===e.name.value));if(!t)return!1;if(t.value.kind===_){if(t.value.value)return!1}else if(t.value.kind!==w)return!1;return!0}function Tr(e){return e.kind===v||e.kind===L}function Er(e){return e.kind===M||e.kind===U||e.kind===J||e.kind===q||e.kind===K||e.kind===Y}function Nr(e){return e.kind===X||e.kind===Z||e.kind===ee||e.kind===te||e.kind===ne||e.kind===re}function br(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,e.args.map((e=>e.name)));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,n.map((e=>e.name.value)))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=rt(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+(e.hideSuggestions?"":He(o)),{nodes:t}))}}return!1}}}function Sr(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():$n;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===H&&t.set(e.name.value,e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(),t.kind){case v:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case T:return f.FIELD;case b:return f.FRAGMENT_SPREAD;case S:return f.INLINE_FRAGMENT;case L:return f.FRAGMENT_DEFINITION;case y:{const t=e[e.length-3];return"kind"in t||n(),t.kind===v?f.VARIABLE_DEFINITION:f.FRAGMENT_VARIABLE_DEFINITION}case V:case W:return f.SCHEMA;case M:case X:return f.SCALAR;case U:case Z:return f.OBJECT;case P:return f.FIELD_DEFINITION;case J:case ee:return f.INTERFACE;case q:case te:return f.UNION;case K:case ne:return f.ENUM;case z:return f.ENUM_VALUE;case Y:case re:return f.INPUT_OBJECT;case B:{const t=e.at(-3);return null!=t&&"kind"in t||n(),t.kind===Y?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(0,"Unexpected kind: "+Ge(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function Lr(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Er).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===V||Er(e)||e.kind===H}(c)||function(e){return e.kind===W||Nr(e)}(c)));if(o&&wr.has(a))return;const u=e.hideSuggestions?[]:rt(a,o?[...wr,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+He(u),{nodes:t}))}var c}}}const wr=new Set([...Nn,...Hn].map((e=>e.name)));function Ir(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Or(e){switch(e.kind){case $:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:Or(e.value)}))).sort(((e,t)=>Ze(e.name.value,t.name.value))))};case x:return{...e,values:e.values.map(Or)};case I:case O:case k:case _:case A:case D:case w:return e}var t}function kr(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+kr(t))).join(" and "):e}function _r(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);const c=e.getFragment(a.node.name.value);if(!c)return;const[u,l]=Vr(e,n,c,a.varMap);if(s!==u){Dr(e,t,n,r,i,o,s,void 0,u,a.varMap);for(const a of l)_r(e,t,n,r,i,o,s,a)}}function Ar(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value&&!$r(s.node.arguments,s.varMap,a.node.arguments,a.varMap))return void e.reportError(new GraphQLError(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);const c=e.getFragment(s.node.name.value),u=e.getFragment(a.node.name.value);if(!c||!u)return;const[l,p]=Vr(e,n,c,s.varMap),[d,f]=Vr(e,n,u,a.varMap);Dr(e,t,n,r,i,o,l,s.varMap,d,a.varMap);for(const a of f)Ar(e,t,n,r,i,o,s,a);for(const s of p)Ar(e,t,n,r,i,o,s,a)}function Dr(e,t,n,r,i,o,s,a,c,u){for(const[l,p]of s.entries()){const s=c.get(l);if(null!=s)for(const c of p)for(const p of s){const s=xr(e,n,r,i,o,l,c,a,p,u);s&&t.push(s)}}}function xr(e,t,n,r,i,o,s,a,c,u){const[l,p,d]=s,[f,h,m]=c,v=i||l!==f&&wt(l)&&wt(f);if(!v){const e=p.name.value,t=h.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[p],[h]];if(!$r(p.arguments,a,h.arguments,u))return[[o,"they have differing arguments"],[p],[h]]}if(!function(e,t,n,r){const i=Qr(e),o=Qr(n);if(!i&&!o)return!0;if(i&&o)return $r(i.arguments,t,o.arguments,r);return!1}(p.directives??[],a,h.directives??[],u))return[[o,"they have differing stream directives"],[p],[h]];const y=d?.type,g=m?.type;if(y&&g&&Cr(y,g))return[[o,`they return conflicting types "${Ge(y)}" and "${Ge(g)}"`],[p],[h]];const T=p.selectionSet,E=h.selectionSet;if(T&&E){const i=function(e,t,n,r,i,o,s,a,c,u,l){const p=[],[d,f]=Rr(e,t,o,s,a),[h,m]=Rr(e,t,c,u,l);Dr(e,p,t,n,r,i,d,a,h,l);for(const o of m)_r(e,p,t,n,r,i,d,o);for(const o of f)_r(e,p,t,n,r,i,h,o);for(const o of f)for(const s of m)Ar(e,p,t,n,r,i,o,s);return p}(e,t,n,r,v,Ut(y),T,a,Ut(g),E,u);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(i,o,p,h)}}function $r(e,t,n,r){if(void 0===e||0===e.length)return void 0===n||0===n.length;if(void 0===n||0===n.length)return!1;if(e.length!==n.length)return!1;const i=new Map(n.map((({name:e,value:t})=>[e.value,void 0===r?t:Fr(t,r)])));return e.every((e=>{let n=e.value;t&&(n=Fr(n,t));const r=i.get(e.name.value);return void 0!==r&&Gr(n)===Gr(r)}))}function Fr(e,t){switch(e.kind){case w:return t.get(e.name.value)??e;case x:return{...e,values:e.values.map((e=>Fr(e,t)))};case $:return{...e,fields:e.fields.map((e=>({...e,value:Fr(e.value,t)})))};default:return e}}function Gr(e){return ft(Or(e))}function Qr(e){return e.find((e=>"stream"===e.name.value))}function Cr(e,t){return Dt(e)?!Dt(t)||Cr(e.ofType,t.ofType):!!Dt(t)||(xt(e)?!xt(t)||Cr(e.ofType,t.ofType):!!xt(t)||!(!Gt(e)&&!Gt(t))&&e!==t)}function Rr(e,t,n,r,i){const o=t.get(r);if(o)return o;const s=new Map,a=new Map;jr(e,n,r,s,a,i);const c=[s,Array.from(a.values())];return t.set(r,c),c}function Vr(e,t,n,r){const i=t.get(n.selectionSet);if(i)return i;const o=vr(e.getSchema(),n.typeCondition);return Rr(e,t,o,n.selectionSet,r)}function jr(e,t,n,r,i,o){for(const s of n.selections)switch(s.kind){case T:{const e=s.name.value;let n;(wt(t)||Ot(t))&&(n=t.getFields()[e]);const i=s.alias?s.alias.value:e;let o=r.get(i);null==o&&(o=[],r.set(i,o)),o.push([t,s,n]);break}case b:{const t=Mr(e,s,o);i.set(t.key,t);break}case S:{const n=s.typeCondition,a=n?vr(e.getSchema(),n):t;jr(e,a,s.selectionSet,r,i,o);break}}}function Mr(e,t,n){let r="";const i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(const e of t.arguments)s.set(e.name.value,e.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(const[e,t]of o.variableDefinitions){const o=s.get(e);o&&(r+=e+": "+ft(Or(o)));const a=s.get(e);void 0!==a?i.set(e,void 0!==n?Fr(a,n):a):t.defaultValue&&i.set(e,t.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){const r=this._data.get(e)?.get(t);return void 0!==r&&(!!n||n===r)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e[e.name,e]))));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(Br).map((e=>[e.name.value,e]))))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of i.entries())if(!o.has(t)){const i=St(s.type)?Ge(s.type):ft(s.type);e.reportError(new GraphQLError(`Argument "@${r}(${t}:)" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Br(e){return e.type.kind===R&&null==e.defaultValue}function Jr(e,n){if(xt(n)){if(null==e)return;return Jr(e,n.ofType)}if(null==e)return null;if(Dt(n)){if(!Je(e)){const t=Jr(e,n.ofType);if(void 0===t)return;return[t]}const t=[];for(const r of e){const e=Jr(r,n.ofType);if(void 0===e)return;t.push(e)}return t}if(At(n)){if(!t(e))return;const r={},i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(i)){const n=e[t.name];if(void 0===n){if(Wt(t))return;const e=zr(t);void 0!==e&&(r[t.name]=e)}else{const e=Jr(n,t.type);if(void 0===e)return;r[t.name]=e}}if(n.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}const r=Qt(n);try{return r.coerceInputValue(e)}catch(e){}}function qr(e,t,n,r){if(e.kind===w){const i=Kr(e,n,r);if(null==i&&xt(t))return;return i}if(xt(t)){if(e.kind===A)return;return qr(e,t.ofType,n,r)}if(e.kind===A)return null;if(Dt(t)){if(e.kind!==x){const i=qr(e,t.ofType,n,r);if(void 0===i)return;return[i]}const i=[];for(const o of e.values){let e=qr(o,t.ofType,n,r);if(void 0===e){if(o.kind!==w||null!=Kr(o,n,r)||xt(t.ofType))return;e=null}i.push(e)}return i}if(At(t)){if(e.kind!==$)return;const i={},o=t.getFields();if(e.fields.some((e=>!Object.hasOwn(o,e.name.value))))return;const s=new Map(e.fields.map((e=>[e.name.value,e])));for(const e of Object.values(o)){const t=s.get(e.name);if(!t||t.value.kind===w&&null==Kr(t.value,n,r)){if(Wt(e))return;const t=zr(e);void 0!==t&&(i[e.name]=t)}else{const o=qr(t.value,e.type,n,r);if(void 0===o)return;i[e.name]=o}}if(t.isOneOf){const e=Object.keys(i);if(1!==e.length)return;if(null===i[e[0]])return}return i}const i=Qt(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(sn(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(e){}}function Kr(e,t,n){const r=e.name.value;return void 0!==n?.sources[r]?n.coerced[r]:t?.coerced[r]}function zr(e){let t=e._memoizedCoercedDefaultValue;if(void 0!==t)return t;const r=e.default;if(void 0!==r)return t=r.literal?qr(r.literal,e.type):Jr(r.value,e.type),void 0!==t||n(),e._memoizedCoercedDefaultValue=t,t;const i=e.defaultValue;return void 0!==i&&(e._memoizedCoercedDefaultValue=i),i}function Yr(e,t,n,r,i){const o=[],s=Object.create(null);for(const[e,i]of Object.entries(t))o.push(i),s[e]={signature:i,value:r?.sources[e]?.value??n.sources[e]?.value};return{sources:s,coerced:Hr(e,o,n,r,i)}}function Hr(e,t,r,i,o){const s={},a=e.arguments??[],c=new Map(a.map((e=>[e.name.value,e])));for(const a of t){const t=a.name,u=a.type,l=c.get(t);if(!l){if(Kt(a))throw new GraphQLError(`Argument "${It(a)?a:a.name}" of required type "${u}" was not provided.`,{nodes:e});const n=zr(a);void 0!==n&&(s[t]=n);continue}const p=l.value;if(p.kind===w){const e=p.name.value,n=i?.sources[e]?i:r;if(!(null!=n&&Object.hasOwn(n.coerced,e)||Kt(a))){const e=zr(a);void 0!==e&&(s[t]=e);continue}}const d=qr(p,u,r,i);void 0===d&&(ln(p,u,((e,t)=>{throw e.message=`Argument "${It(a)?a:a.name}" has invalid value${ze(t)}: ${e.message}`,e}),r,i,o),n(0,"Invalid argument")),s[t]=d}return s}function Wr(e,t,n,r,i){const o=t.directives?.find((t=>t.name.value===e.name));if(o)return Hr(o,e.args,n,r,i)}function Xr(e,t,n,r,i,o){const s=new AccumulatorMap,a=[];return Zr({schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Set,hideSuggestions:o},i,s,a),{groupedFieldSet:s,newDeferUsages:a}}function Zr(e,t,n,r,i,o){const{schema:s,fragments:a,variableValues:c,runtimeType:u,visitedFragmentNames:l,hideSuggestions:p}=e;for(const f of t.selections)switch(f.kind){case T:if(!ti(f,c,o))continue;n.add((d=f).alias?d.alias.value:d.name.value,{node:f,deferUsage:i,fragmentVariableValues:o});break;case S:{if(!ti(f,c,o)||!ni(s,f,u))continue;const t=ei(c,o,f,i);t?(r.push(t),Zr(e,f.selectionSet,n,r,t,o)):Zr(e,f.selectionSet,n,r,i,o);break}case b:{const t=f.name.value;if(l.has(t)||!ti(f,c,o))continue;const d=a[t];if(null==d||!ni(s,d.definition,u))continue;const h=ei(c,o,f,i),m=d.variableSignatures;let v;m&&(v=Yr(f,m,c,o,p)),h?(r.push(h),Zr(e,d.definition.selectionSet,n,r,h,v)):(l.add(t),Zr(e,d.definition.selectionSet,n,r,i,v));break}}var d}function ei(e,t,n,r){const i=Wr(On,n,e,t);if(i&&!1!==i.if)return{label:"string"==typeof i.label?i.label:void 0,parentDeferUsage:r}}function ti(e,t,n){const r=Wr(In,e,t,n);if(!0===r?.if)return!1;const i=Wr(wn,e,t,n);return!1!==i?.if}function ni(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=vr(e,r);return i===n||!!Rt(i)&&e.isSubType(i,n)}function ri(e){return e.map((e=>e.node))}function ii(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function oi(e){return{Field:t,Directive:t};function t(t){const n=ii(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function si(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===H&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===V||n.kind===W)r=o;else if(Er(n)||Nr(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function ai(e,t){return!!(wt(e)||Ot(e)||At(e))&&null!=e.getFields()[t]}function ci(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function ui(e,t,n){return n&&ln(t,n,(t=>{e.reportError(t)}),void 0,void 0,e.hideSuggestions),!1}function li(e,t,n,r,i){if(xt(r)&&!xt(t)){if(!(null!=n&&n.kind!==A)&&!(void 0!==i))return!1;return Zt(e,t,r.ofType)}return Zt(e,t,r)}const pi=Object.freeze([function(e){function t(n,r=Object.create(null),i=0){if(n.kind===b){const o=n.name.value;if(!0===r[o])return!1;const s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===T&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}]),di=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!Tr(n)){const t=n.kind===V||n.kind===W?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=e.getSchema();return{OperationDefinition(n){const r=n.operation;t.getRootType(r)||e.reportError(new GraphQLError(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===v)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===L&&(a[e.name.value]={definition:e});const{groupedFieldSet:c}=Xr(n,a,o,r,t.selectionSet,e.hideSuggestions);if(c.size>1){const t=[...c.values()].slice(1).flatMap((e=>ri(e)));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){ri(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ri(t)}))}}}}}},Lr,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=vr(e.getSchema(),n);if(t&&!Ct(t)){const t=ft(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=vr(e.getSchema(),t.typeCondition);if(n&&!Ct(n)){const n=ft(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=vr(e.getSchema(),t.type);if(void 0!==n&&!$t(n)){const n=t.variable.name.value,r=ft(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Gt(Ut(n))){if(r){const i=t.name.value,o=Ge(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=He("to use an inline fragment on",e.hideSuggestions?[]:function(e,t,n){if(!Rt(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Ot(t)&&e.isSubType(t,n)?-1:Ot(n)&&e.isSubType(n,t)?1:Ze(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=He(e.hideSuggestions?[]:function(e,t){if(wt(e)||Ot(e)){return rt(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},Ir,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Ct(n)&&Ct(r)&&!en(e.getSchema(),n,r)){const i=Ge(r),o=Ge(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=vr(e.getSchema(),n.typeCondition);if(Ct(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!en(e.getSchema(),r,i)){const o=Ge(i),s=Ge(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=ii(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i,fragmentVariableDefinition:o}of r){if(o)continue;const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{FragmentDefinition(t){const n=e.getVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(`Variable "$${i}" is never used in fragment "${t.name.value}".`,{nodes:n}))}},OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set;for(const{node:e,fragmentVariableDefinition:t}of n){const n=e.name.value;t||r.add(n)}const i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Sr,si,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===On.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i}".`,{nodes:t}))),i&&t.name.value===kn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===d.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===L&&t.has(a.name.value)||a.kind===v&&a.operation===d.SUBSCRIPTION)&&(n.name.value===On.name?gr(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===kn.name&&(gr(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===On.name||n.name.value===kn.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;if(i.kind!==k)return void e.reportError(new GraphQLError(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===kn.name&&!(Dt(n.type)||Vt(n.type)&&Dt(n.type.ofType))&&e.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}},function(e){return{...br(e),FragmentArgument(t){const n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){const r=t.name.value,i=e.hideSuggestions?[]:rt(r,Array.from(n.variableDefinitions.values()).map((e=>e.variable.name.value)));e.reportError(new GraphQLError(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+He(i),{nodes:t}))}}},Argument(t){const n=e.getArgument(),r=e.getFieldDef();if(!n&&r){const n=t.name.value,i=e.hideSuggestions?[]:rt(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${r}".`+He(i),{nodes:t}))}}}},oi,function(e){return{NullValue:t=>ui(e,t,e.getInputType()),ListValue:t=>ui(e,t,e.getParentInputType()),ObjectValue:t=>ui(e,t,e.getInputType()),EnumValue:t=>ui(e,t,e.getInputType()),IntValue:t=>ui(e,t,e.getInputType()),FloatValue:t=>ui(e,t,e.getInputType()),StringValue:t=>ui(e,t,e.getInputType()),BooleanValue:t=>ui(e,t,e.getInputType())}},function(e){return{...Pr(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)!r.has(i.name)&&Kt(i)&&e.reportError(new GraphQLError(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){const n=e.getFragmentSignature();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const[i,o]of n.variableDefinitions)if(!r.has(i)&&Br(o)){const n=Ge(vr(e.getSchema(),o.type));e.reportError(new GraphQLError(`Fragment "${t.name.value}" argument "${i}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,parentType:o,defaultValue:s,fragmentVariableDefinition:a}of r){const r=n.name.value;let c=a;if(c||(c=t.get(r)),c&&i){const t=e.getSchema(),a=vr(t,c.type);a&&!li(t,a,c.defaultValue,i,s)&&e.reportError(new GraphQLError(`Variable "$${r}" of type "${a}" used in position expecting type "${i}".`,{nodes:[c,n]})),At(o)&&o.isOneOf&&jt(a)&&e.reportError(new GraphQLError(`Variable "$${r}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[c,n]}))}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new OrderedPairSet,n=new PairSet,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const s=[],[a,c]=Rr(e,t,i,o,void 0);if(function(e,t,n,r,i,o){for(const[s,a]of o.entries())if(a.length>1)for(let o=0;o0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(_t(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(ai(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=ii(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},Lr,Sr,si,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)Er(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=Ur[s.kind]:a&&(c=function(e){if(Lt(e))return X;if(wt(e))return Z;if(Ot(e))return ee;if(kt(e))return te;if(_t(e))return ne;if(At(e))return re;n(0,"Unexpected type: "+Ge(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case X:return"scalar";case Z:return"object";case ee:return"interface";case te:return"union";case ne:return"enum";case re:return"input object";default:n(0,"Unexpected kind: "+Ge(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=[...r.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+He(rt(o,n)),{nodes:i.name}))}}},br,oi,ci,Pr]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===L&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===b?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r,i){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===L?e:void 0;lt(e,yr(r,{VariableDefinition:()=>!1,Variable(e){let t;if(i){const o=r.getFragmentSignatureByName()(i.name.value);t=o?.variableDefinitions.get(e.name.value),n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:t})}else n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}function hi(e,t,n=di,r){!function(e){const t=er(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const i=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),o=[],s=new TypeInfo(e),a=new ValidationContext(e,t,s,(e=>{if(o.length>=100)throw i;o.push(e)}),!1),c=pt(n.map((e=>e(a))));try{lt(t,yr(s,c))}catch(e){if(e!==i)throw e;o.push(i)}return o}function mi(e,n){t(e)&&t(e.__schema)||xe(0,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Ge(e)}.`);const r=e.__schema,i=new Map(r.types.map((e=>[e.name,f(e)])));for(const e of[...Nn,...Hn])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map((function(e){if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=Ge(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Jn.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Jn.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(function(e){if(!jt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL nullable type.`);return e}(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Ge(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!wt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Ot(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){switch(e.kind){case Jn.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Jn.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>m(n)});case Jn.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>m(t)});case Jn.UNION:return function(e){if(null==e.possibleTypes){const t=Ge(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Jn.ENUM:return function(e){if(null==e.enumValues){const t=Ge(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:Xe(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Jn.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=Ge(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t,n,r;throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${Ge(e)}.`)}function h(e){if(null===e.interfaces&&e.kind===Jn.INTERFACE)return[];if(null==e.interfaces){const t=Ge(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function m(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${Ge(e)}.`);return Xe(e.fields,(e=>e.name),v)}function v(e){const t=u(e.type);if(!Ft(t)){const e=Ge(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return Xe(e,(e=>e.name),g)}function g(e){const t=u(e.type);if(!$t(t)){const e=Ge(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}return{description:e.description,type:t,default:null!=e.defaultValue?{literal:Ve(e.defaultValue)}:void 0,deprecationReason:e.deprecationReason}}}const vi={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function yi(e,t){const r=t({getNamedType:u,setNamedType:function(e){i.set(e.name,e)},getNamedTypes:function(){return Array.from(i.values())}}),i=new Map;for(const t of e.types){const e=t.name,n=l(t);n&&i.set(e,n)}const o=[];for(const t of e.directives){if(Fn(t)){o.push(t);continue}const e=m(t.toConfig());e&&o.push(new GraphQLDirective(e))}const s={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(i.values()),directives:o},a=r[vi.SCHEMA];return null==a?s:a(s);function c(e){return Dt(e)?new GraphQLList(c(e.ofType)):xt(e)?new GraphQLNonNull(c(e.ofType)):u(e.name)}function u(e){const t=gi.get(e)??i.get(e);return void 0!==t||n(0,`Unknown type: "${e}".`),t}function l(e){return Wn(e)||bn(e)?e:Lt(e)?function(e){let t=e.toConfig();const n=r[vi.SCALAR];return t=null==n?t:n(t),new GraphQLScalarType(t)}(e):wt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[vi.OBJECT];return n=null==i?n:i(n),new GraphQLObjectType(n)}(e):Ot(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[vi.INTERFACE];return n=null==i?n:i(n),new GraphQLInterfaceType(n)}(e):kt(e)?function(e){const t=e.toConfig();let n={...t,types:()=>t.types.map((e=>u(e.name)))};const i=r[vi.UNION];return n=null==i?n:i(n),new GraphQLUnionType(n)}(e):_t(e)?function(e){const t=e.toConfig();let n={...t,values:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.values)){const t=f(i,r,e.name);n[r]=t}return n}};const i=r[vi.ENUM];return n=null==i?n:i(n),new GraphQLEnumType(n)}(e):At(e)?function(e){const t=e.toConfig();let n={...t,fields:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.fields)){const t=h(i,r,e.name);n[r]=t}return n}};const i=r[vi.INPUT_OBJECT];return n=null==i?n:i(n),new GraphQLInputObjectType(n)}(e):void n(0,"Unexpected type: "+Ge(e))}function p(e,t){const n=Object.create(null);for(const[i,o]of Object.entries(e)){let e={...o,type:c(o.type),args:d(o.args,t,i)};const s=r[vi.FIELD];s&&(e=s(e,t)),n[i]=e}return n}function d(e,t,n){const i=Object.create(null);for(const[o,s]of Object.entries(e)){let e={...s,type:c(s.type)};const a=r[vi.ARGUMENT];a&&(e=a(e,t,n)),i[o]=e}return i}function f(e,t,n){const i={...e},o=r[vi.ENUM_VALUE];return null==o?i:o(i,t,n)}function h(e,t,n){const i={...e,type:c(e.type)},o=r[vi.INPUT_FIELD];return null==o?i:o(i,t,n)}function m(e){const t={...e,args:d(e.args,e.name,void 0)},n=r[vi.DIRECTIVE];return null==n?t:n(t)}}const gi=new Map([...Nn,...Hn].map((e=>[e.name,e])));function Ti(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let h=!1;for(const e of t.definitions){switch(e.kind){case V:d=e;break;case W:f.push(e);break;case H:p.push(e);break;case M:case U:case J:case q:case K:case Y:i.push(e);break;case X:o.add(e.name.value,e);break;case Z:s.add(e.name.value,e);break;case ee:a.add(e.name.value,e);break;case te:c.add(e.name.value,e);break;case ne:u.add(e.name.value,e);break;case re:l.add(e.name.value,e);break;default:continue}h=!0}return h?yi(e,(e=>{const{getNamedType:t,setNamedType:h,getNamedTypes:m}=e;return{[vi.SCHEMA]:e=>{for(const e of i){const t=Ei.get(e.name.value)??I(e);h(t)}const n={query:e.query&&t(e.query.name),mutation:e.mutation&&t(e.mutation.name),subscription:e.subscription&&t(e.subscription.name),...d&&v([d]),...v(f)};return{description:d?.description?.value??e.description,...n,types:m(),directives:[...e.directives,...p.map(T)],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1}},[vi.INPUT_OBJECT]:e=>{const t=l.get(e.name)??[];return{...e,fields:()=>({...e.fields(),...b(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.ENUM]:e=>{const t=u.get(e.name)??[];return{...e,values:()=>({...e.values(),...S(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.SCALAR]:e=>{const t=o.get(e.name)??[];let n=e.specifiedByURL;for(const e of t)n=bi(e)??n;return{...e,specifiedByURL:n,extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.OBJECT]:e=>{const t=s.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...L(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.INTERFACE]:e=>{const t=a.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...L(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[vi.UNION]:e=>{const t=c.get(e.name)??[];return{...e,types:()=>[...e.types(),...w(t)],extensionASTNodes:e.extensionASTNodes.concat(t)}}};function v(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=y(n.type)}return t}function y(e){const r=e.name.value,i=t(r);return void 0!==i||n(0,`Unknown type: "${r}".`),i}function g(e){return e.kind===C?new GraphQLList(g(e.type)):e.kind===R?new GraphQLNonNull(g(e.type)):y(e)}function T(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:N(e.arguments),astNode:e})}function E(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:g(n.type),description:n.description?.value,args:N(n.arguments),deprecationReason:Ni(n),astNode:n}}return t}function N(e){const t=e??[],n=Object.create(null);for(const e of t){const t=g(e.type);n[e.name.value]={type:t,description:e.description?.value,default:e.defaultValue&&{literal:e.defaultValue},deprecationReason:Ni(e),astNode:e}}return n}function b(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=g(n.type);t[n.name.value]={type:e,description:n.description?.value,default:n.defaultValue&&{literal:n.defaultValue},deprecationReason:Ni(n),astNode:n}}}return t}function S(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:Ni(n),astNode:n}}return t}function L(e){return e.flatMap((e=>e.interfaces?.map(y)??[]))}function w(e){return e.flatMap((e=>e.types?.map(y)??[]))}function I(e){const t=e.name.value;switch(e.kind){case U:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>L(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case J:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>L(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case K:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:()=>S(r),astNode:e,extensionASTNodes:n})}case q:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>w(r),astNode:e,extensionASTNodes:n})}case M:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:bi(e),astNode:e,extensionASTNodes:n})}case Y:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>b(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(Wr(xn,n)))})}}var n}})):e}const Ei=new Map([...Nn,...Hn].map((e=>[e.name,e])));function Ni(e){const t=Wr(An,e);return t?.reason}function bi(e){const t=Wr(Dn,e);return t?.url}function Si(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[wi(e),...i.map((e=>function(e){return xi(e)+`directive ${e}`+_i(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(Lt(e))return function(e){return xi(e)+`scalar ${e}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${ft({kind:k,value:e.specifiedByURL})})`}(e)}(e);if(wt(e))return function(e){return xi(e)+`type ${e}`+Ii(e)+Oi(e)}(e);if(Ot(e))return function(e){return xi(e)+`interface ${e}`+Ii(e)+Oi(e)}(e);if(kt(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return xi(e)+`union ${e.name}`+n}(e);if(_t(e))return function(e){const t=e.getValues().map(((e,t)=>xi(e," ",!t)+" "+e.name+Di(e.deprecationReason)));return xi(e)+`enum ${e}`+ki(t)}(e);if(At(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>xi(e," ",!t)+" "+Ai(e)));return xi(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+ki(t)}(e);n(0,"Unexpected type: "+Ge(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!Fn(e)),Li)}function Li(e){return!bn(e)&&!Wn(e)}function wi(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:xi(e)+"schema {\n"+(t?` query: ${t}\n`:"")+(n?` mutation: ${n}\n`:"")+(r?` subscription: ${r}\n`:"")+"}"}function Ii(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function Oi(e){return ki(Object.values(e.getFields()).map(((e,t)=>xi(e," ",!t)+" "+e.name+_i(e.args," ")+": "+String(e.type)+Di(e.deprecationReason))))}function ki(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function _i(e,t=""){return 0===e.length?"":e.every((e=>null==e.description))?"("+e.map(Ai).join(", ")+")":"(\n"+e.map(((e,n)=>xi(e," "+t,!n)+" "+t+Ai(e))).join("\n")+"\n"+t+")"}function Ai(e){let t=e.name+": "+String(e.type);const n=Cn(e);return n&&(t+=` = ${ft(n)}`),t+Di(e.deprecationReason)}function Di(e){if(null==e)return"";if(e!==_n){return` @deprecated(reason: ${ft({kind:k,value:e})})`}return" @deprecated"}function xi(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+ft({kind:k,value:r,block:de(r)}).replaceAll("\n","\n"+t)+"\n"}function $i(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:m,definitions:t}}const Fi=[Ir];function Gi(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Qi,Ci,Ri,Vi,...n?[n]:[],...r?[r]:[],...di.filter((e=>!Fi.includes(e)))]}function Qi(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function Ci(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Ri(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==On.name&&null==t.typeCondition&&e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",{nodes:t}))}}}function Vi(e){return{InlineFragment(t){var n;if(t.directives)for(const r of t.directives)r.name.value!=On.name||(null===(n=r.arguments)||void 0===n?void 0:n.find((e=>"label"==e.name.value)))||e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",{nodes:t}))}}}function ji(e){return{kind:h,value:e}}function Mi(e){return{kind:k,value:e}}function Ui(e){return{kind:H,description:e.description?Mi(e.description):void 0,name:ji(e.name),repeatable:!1,locations:e.locations.map((e=>ji(e))),arguments:e.args.map((e=>function(e){return{kind:B,description:Mi(e.description),name:ji(e.name),type:Pi(Ut(e.type))}}(e)))}}function Pi(e){return{kind:Q,name:ji(e.name)}}function Bi(e){return{kind:R,type:e}}const Ji={kind:H,description:Mi("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:ji("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[ji("QUERY"),ji("MUTATION"),ji("SUBSCRIPTION"),ji("FRAGMENT_DEFINITION")]},qi={kind:H,description:Mi("Attach extra information to a given type."),name:ji("typePolicy"),arguments:[{kind:B,description:Mi("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),name:ji("keyFields"),type:Bi(Pi(gn))}],repeatable:!1,locations:[ji("OBJECT"),ji("INTERFACE")]},Ki={kind:H,description:Mi("A directive used by Apollo iOS to map query input data to cache keys of objects."),name:ji("fieldPolicy"),arguments:[{kind:B,description:Mi("The field you are setting the @fieldPolicy for."),name:ji("forField"),type:Bi(Pi(gn))},{kind:B,description:Mi("Set of fields used to compute the cache key."),name:ji("keyArgs"),type:Bi(Pi(gn))}],repeatable:!0,locations:[ji("OBJECT"),ji("INTERFACE")]},zi={kind:H,description:Mi("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),name:ji("import"),arguments:[{kind:B,description:Mi("The name of the module to import."),name:ji("module"),type:Bi(Pi(gn))}],repeatable:!0,locations:[ji("QUERY"),ji("MUTATION"),ji("SUBSCRIPTION"),ji("FRAGMENT_DEFINITION")]},Yi=[Ji,zi,qi,Ki];const Hi={kind:T,name:{kind:h,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Wi(e){const t=function(e,t,n=fi){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return lt(e,pt(n.map((e=>e(i))))),r}(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Xi(e){const t=er(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Zi(e){return e.startsWith("__")}function eo(e){if(!e)return!1;for(const t of e)if(t.name.value==Ji.name.value)return!0;return!1}const to={kind:T,name:{kind:h,value:"__typename"}};function no(e,t){return t&&(e=function(e){return lt(e,{enter:e=>e.kind!==g?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===T||e.kind===L||e.kind===S)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Hi,...e.selectionSet.selections]}}}})}(e)),lt(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![T,L].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==to.kind&&e.name.value==to.name.value));return t?e:{...e,selections:[to,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==to.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){const t=[Ji,zi];for(const n of t)if(e.name.value==n.name.value)return null;return e}(e)}})}function ro(e){return null!=e}function io(e){switch(e.kind){case w:return{kind:e.kind,value:e.name.value};case x:return{kind:e.kind,value:e.values.map(io)};case $:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=io(t.value),e)),{})};default:return e}}function oo(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function so(e,t,n,r,i){var o,s,a;const c=new Map;for(const e of t.definitions)e.kind===L&&c.set(e.name.value,e);const u=[],l=new Map,p=new Set,d=r,f=e.getQueryType();if(void 0===f)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const h={queryType:f,mutationType:null!==(o=e.getMutationType())&&void 0!==o?o:void 0,subscriptionType:null!==(s=e.getSubscriptionType())&&void 0!==s?s:void 0};for(const e of t.definitions)e.kind===v&&u.push(g(e));for(const[e,t]of c.entries())l.set(e,E(t));return{rootTypes:h,operations:u,fragments:Array.from(l.values()),referencedTypes:Array.from(p.values()),schemaDocumentation:null!==(a=e.description)&&void 0!==a?a:void 0};function m(t){if(!p.has(t)){if(p.add(t),Ot(t)){const n=e.getPossibleTypes(t);t._implementingObjects=n;for(const e of n)d&&!y(e)||m(Ut(e))}if(kt(t)){const e=t.getTypes();for(t of e)m(Ut(t))}if(At(t)&&function(e){const t=e.getFields();for(const e in t){m(Ut(t[e].type))}}(t),wt(t))for(const e of t.getInterfaces())m(Ut(e))}}function y(e){var t,n;const r=qi.name.value;for(const i of null!==(n=null===(t=e.astNode)||void 0===t?void 0:t.directives)&&void 0!==n?n:[])if(i.name.value===r)return!0;return!1}function g(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=oo(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?io(t.defaultValue):void 0,i=vr(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return m(Ut(i)),{name:n,type:i,defaultValue:r}})),u=ft(no(t,n)),l=e.getRootType(s),[p]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(l);const d=I(t.selectionSet,l,a),f=Array.from(a.values());return eo(t.directives)&&N(f),{name:o,operationType:s,variables:c,rootType:l,selectionSet:d,directives:p,referencedFragments:f,source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=oo(t),s=ft(no(t,n)),a=new Set,c=vr(e,t.typeCondition),[u]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(Ut(c));const l=I(t.selectionSet,c,a),p=Array.from(a.values());return eo(t.directives)&&N(p),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:l,directives:u,referencedFragments:p,overrideAsLocalCacheMutation:!1}}function N(e){e.forEach((e=>{e.overrideAsLocalCacheMutation=!0,N(e.referencedFragments)}))}function I(t,n,r){return{parentType:n,selections:t.selections.map((t=>function(t,n,r){var o,s,a,u;const[p,d]=null!==(o=k(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case T:{const f=t.name.value;if("__typename"==f)return;const h=null===(s=t.alias)||void 0===s?void 0:s.value,v=function(e,t,n){return n===Kn.name&&e.getQueryType()===t?Kn:n===zn.name&&e.getQueryType()===t?zn:n===Yn.name&&(wt(t)||Ot(t)||kt(t))?Yn:wt(t)||Ot(t)?t.getFields()[n]:void 0}(e,n,f);if(!v)throw new GraphQLError(`Cannot query field "${f}" on type "${String(n)}"`,{nodes:t});const y=v.type,g=Ut(v.type);m(Ut(g));const{description:N,deprecationReason:L}=v;let w={kind:"Field",name:f,alias:h,type:y,arguments:O(v,t.arguments),inclusionConditions:d,description:!Zi(f)&&N?N:void 0,deprecationReason:L||void 0,directives:p};function _(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Dt(y)||xt(y)&&Dt(y.ofType)?_(t,null===(a=i.disallowedFieldNames)||void 0===a?void 0:a.entityList,i.schemaNamespace):Ct(g)&&_(t,null===(u=i.disallowedFieldNames)||void 0===u?void 0:u.entity,i.schemaNamespace),Ct(g)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${f}" on type "${String(n)}" requires selection set`,{nodes:t});w.selectionSet=I(A,g,r)}return w}case S:{const D=t.typeCondition,x=D?vr(e,D):n;return m(x),{kind:"InlineFragment",selectionSet:I(t.selectionSet,x,r),inclusionConditions:d,directives:p}}case b:{const $=t.name.value,F=function(e){let t=l.get(e);if(t)return t;const n=c.get(e);return n?(c.delete(e),t=E(n),l.set(e,t),t):void 0}($);if(!F)throw new GraphQLError(`Unknown fragment "${$}".`,{nodes:t.name});r.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,r))).filter(ro)}}function O(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:io(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function k(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:O(o,i.arguments)});const s=A(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function A(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case _:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case w:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function ao(e){return e.kind===H&&e.name.value===On.name}function co(){return{kind:m,definitions:[Ui(On)]}}const uo=qi.name.value;function lo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,Nt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,Nt(e.value)]))).sort().toString()}function po(e){var t,n,r,i;if(kt(e))return;for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const t=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===uo));if(t)return{directive:t,source:e}}let o;for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])if(t.name.value===uo){o={directive:t,source:e};break}if("getInterfaces"in e)for(const t of e.getInterfaces()){const n=po(t);if(n)if(o){if(!lo(o.directive,n.directive))throw o.source===e?new GraphQLError(`Type "${e.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${n.source.name}".`,{nodes:e.astNode}):new GraphQLError(`Type "${e.name}" inherits conflicting @typePolicy directives from interfaces "${o.source.name}" and "${n.source.name}".`,{nodes:e.astNode})}else o=n}return o}function fo(e){var t,n,r;const i=po(e);if(!i)return[];const o=null===(r=null===(n=null===(t=i.directive)||void 0===t?void 0:t.arguments)||void 0===n?void 0:n.find((e=>"keyFields"===e.name.value)))||void 0===r?void 0:r.value;if(!o||o.kind!==k)return[];const s=o.value.split(" ");return function(e,t){const{directive:n,source:r}=e;if(kt(r))return;const i=Ot(r)?"interface":"object";var o=r.getFields();for(const e of t){if(!e)throw new GraphQLError("Key fields must be a space-separated list of identifiers.",{nodes:n});const t=o[e];if(!t)throw new GraphQLError(`Key field "${e}" does not exist on ${i} "${r.name}".`,{nodes:r.astNode?[r.astNode,n]:n});if(!xt(t.type))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be non-nullable.`,{nodes:t.astNode?[t.astNode,n]:n});if(!Lt(t.type.ofType))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be a scalar type, got ${t.type}.`,{nodes:t.astNode?[t.astNode,n]:n})}}(i,s),s}function ho(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&(n._apolloKeyFields=fo(n))}}const mo=Ki.name.value;function vo(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&yo(n)}}function yo(e){var t,n,r,i,o,s;const a=go(e);if(!a||kt(e))return;const c=e.getFields();for(const l of a){const a=null===(n=null===(t=l.arguments)||void 0===t?void 0:t.find((e=>"forField"===e.name.value)))||void 0===n?void 0:n.value;let p;if((null==a?void 0:a.kind)===k&&(p=a.value),!p)throw new GraphQLError("@fieldPolicy directive must have a 'forField' value.",{nodes:l});const d=null===(i=null===(r=l.arguments)||void 0===r?void 0:r.find((e=>"keyArgs"===e.name.value)))||void 0===i?void 0:i.value;let f;if((null==d?void 0:d.kind)==k){const e=d.value.split(" ");f=[...new Set(e.filter(Boolean))]}if(!f)throw new GraphQLError("'keyArgs' must be a space-separated list of identifiers.",{nodes:l});const h=c[p];if(!h)throw new GraphQLError(`Field "${p}" does not exist on type "${e.name}".`,{nodes:e.astNode?[e.astNode,l]:l});const m=null===(o=h.astNode)||void 0===o?void 0:o.arguments,v=new Set(null!==(s=null==m?void 0:m.map((e=>e.name.value)))&&void 0!==s?s:[]);for(const e of f)if(!v.has(e))throw new GraphQLError(`@fieldPolicy key argument "${e}" does not exist as an input argument of field "${h.name}".`,{nodes:h.astNode});if(m){var u=0;const e=Dt(h.type);for(const e of m)"ListType"==e.type.kind&&(u+=1);if(u>1)throw new GraphQLError("@fieldPolicy can only have at most 1 List type input parameter.",{nodes:h.astNode});if(e&&1!=u||1==u&&!e)throw new GraphQLError("@fieldPolicy requires either both a List return type and 1 List input parameter, or neither.",{nodes:h.astNode})}h._apolloFieldPolicies?h._apolloFieldPolicies=[]:h._apolloFieldPolicies=f}}function go(e){var t,n,r,i;if(!wt(e)&&!Ot(e))return;const o=[];for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const e=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===mo));e&&o.push(e)}for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])t.name.value===mo&&o.push(t);if("getInterfaces"in e)for(const t of e.getInterfaces()){const e=go(t);if(e)for(const t of e){var s=!1;for(const e of o)if(To(e,t)){s=!0;break}s||o.push(t)}}return o}function To(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,Nt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,Nt(e.value)]))).sort().toString()}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r,i){return so(e,t,n,r,i)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(Re(r));var r=function(e){const t=Yi.filter((t=>!e.definitions.some((e=>e.kind==H&&e.name.value==t.name.value))));return $i([e,{kind:m,definitions:t}])}($i(n));if(t){var i=function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=mi(t);return n}(t.body);return r=function(e,t){const n=e.getDirective(On.name);return n?function(e,t){return e.isRepeatable===t.isRepeatable&&e.locations.slice(0).sort().toString()===t.locations.slice(0).sort().toString()&&e.args.map((e=>e.name)).sort().toString()===t.args.map((e=>e.name)).sort().toString()}(n,On)?t:(console.warn(`Unsupported ${n.name} directive found. It will be replaced with a supported definition instead.`),$i([t,co()])):$i([t,co()])}(i,r),ho(i=function(e,t,n){Xn(e);const r=e.toConfig(),i=Ti(r,t,n);return r===i?e:new GraphQLSchema(i)}(i,r,{assumeValid:!0})),vo(i),Xi(i),i}{Wi(r=function(e){const t=e.definitions.find(ao);if(!t)return $i([e,co()]);const n=t;if(!function(e,t){var n;return e.repeatable===t.isRepeatable&&e.locations.map((e=>e.value)).sort().toString()===t.locations.slice(0).sort().toString()&&(null===(n=e.arguments)||void 0===n?void 0:n.map((e=>e.name.value)).sort().toString())===t.args.map((e=>e.name)).sort().toString()}(n,On))return console.warn(`Unsupported ${n.name.value} directive found. It will be replaced with a supported definition instead.`),{kind:m,definitions:e.definitions.filter((e=>ao(e)?void 0:e)).concat(Ui(On))};return e}(r));const e=function(e,t){const n=Ti({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...$n.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}(r,{assumeValid:!0});return ho(e),vo(e),Xi(e),e}},e.mergeDocuments=function(e){return $i(e)},e.parseOperationDocument=function(e){return Re(e)},e.printSchemaToSDL=function(e){return Si(e)},e.validateDocument=function(e,t,n){return hi(e,t,Gi(n))},e}({});"# \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift index bd449cb54..684d1c6aa 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift @@ -492,6 +492,8 @@ public final class CompilationResult: JavaScriptObjectDecodable { public let type: GraphQLType public let arguments: [Argument]? + + public let fieldPolicyKeys: [String] public let inclusionConditions: [InclusionCondition]? @@ -515,6 +517,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { name: String, alias: String? = nil, arguments: [Argument]? = nil, + fieldPolicyKeys: [String] = [], inclusionConditions: [InclusionCondition]? = nil, directives: [Directive]? = nil, type: GraphQLType, @@ -526,6 +529,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { self.alias = alias self.type = type self.arguments = arguments + self.fieldPolicyKeys = fieldPolicyKeys self.inclusionConditions = inclusionConditions self.directives = directives self.selectionSet = selectionSet @@ -538,6 +542,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { name: jsValue["name"], alias: jsValue["alias"], arguments: .fromJSValue(jsValue["arguments"], bridge: bridge), + fieldPolicyKeys: jsValue["_apolloFieldPolicies"], inclusionConditions: jsValue["inclusionConditions"], directives: .fromJSValue(jsValue["directives"], bridge: bridge), type: .fromJSValue(jsValue["type"], bridge: bridge), @@ -560,6 +565,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { hasher.combine(alias) hasher.combine(type) hasher.combine(arguments) + hasher.combine(fieldPolicyKeys) hasher.combine(directives) hasher.combine(selectionSet) } @@ -569,6 +575,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { lhs.alias == rhs.alias && lhs.type == rhs.type && lhs.arguments == rhs.arguments && + lhs.fieldPolicyKeys == rhs.fieldPolicyKeys && lhs.directives == rhs.directives && lhs.selectionSet == rhs.selectionSet } diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift index 836f4de63..e673db1f9 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift @@ -348,6 +348,8 @@ public final class GraphQLField: public let type: GraphQLType public let arguments: [GraphQLFieldArgument] + + public let fieldPolicyKeys: [String] public let documentation: String? @@ -357,12 +359,14 @@ public final class GraphQLField: name: String, type: GraphQLType, arguments: [GraphQLFieldArgument], + fieldPolicyKeys: [String] = [], documentation: String?, deprecationReason: String? ) { self.name = name self.type = type self.arguments = arguments + self.fieldPolicyKeys = fieldPolicyKeys self.documentation = documentation self.deprecationReason = deprecationReason } @@ -375,6 +379,7 @@ public final class GraphQLField: name: jsValue["name"], type: .fromJSValue(jsValue["type"], bridge: bridge), arguments: .fromJSValue(jsValue["args"], bridge: bridge), + fieldPolicyKeys: jsValue["_apolloFieldPolicies"], documentation: jsValue["description"], deprecationReason: jsValue["deprecationReason"] ) @@ -384,12 +389,14 @@ public final class GraphQLField: hasher.combine(name) hasher.combine(type) hasher.combine(arguments) + hasher.combine(fieldPolicyKeys) } public static func == (lhs: GraphQLField, rhs: GraphQLField) -> Bool { lhs.name == rhs.name && lhs.type == rhs.type && - lhs.arguments == rhs.arguments + lhs.arguments == rhs.arguments && + lhs.fieldPolicyKeys == rhs.fieldPolicyKeys } public var debugDescription: String { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/clover.xml b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/clover.xml new file mode 100644 index 000000000..fbf1e2c94 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/clover.xml @@ -0,0 +1,615 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/coverage-final.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/coverage-final.json new file mode 100644 index 000000000..f64ce1a2a --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/coverage-final.json @@ -0,0 +1,14 @@ +{"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts","statementMap":{"0":{"start":{"line":42,"column":0},"end":{"line":42,"column":16}},"1":{"start":{"line":98,"column":0},"end":{"line":98,"column":16}},"2":{"start":{"line":102,"column":0},"end":{"line":102,"column":16}},"3":{"start":{"line":106,"column":0},"end":{"line":106,"column":16}},"4":{"start":{"line":110,"column":0},"end":{"line":110,"column":16}},"5":{"start":{"line":118,"column":0},"end":{"line":118,"column":16}},"6":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":78}},"8":{"start":{"line":15,"column":0},"end":{"line":15,"column":60}},"9":{"start":{"line":16,"column":0},"end":{"line":16,"column":72}},"10":{"start":{"line":17,"column":0},"end":{"line":17,"column":null}},"11":{"start":{"line":20,"column":0},"end":{"line":20,"column":null}},"12":{"start":{"line":24,"column":0},"end":{"line":24,"column":82}},"13":{"start":{"line":25,"column":0},"end":{"line":25,"column":84}},"14":{"start":{"line":29,"column":0},"end":{"line":29,"column":null}},"15":{"start":{"line":30,"column":2},"end":{"line":30,"column":null}},"16":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}},"17":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"18":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"19":{"start":{"line":34,"column":2},"end":{"line":34,"column":null}},"20":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"21":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}},"22":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}},"23":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}},"24":{"start":{"line":40,"column":0},"end":{"line":40,"column":9}},"25":{"start":{"line":40,"column":9},"end":{"line":40,"column":67}},"26":{"start":{"line":45,"column":18},"end":{"line":45,"column":43}},"27":{"start":{"line":46,"column":2},"end":{"line":57,"column":3}},"28":{"start":{"line":47,"column":4},"end":{"line":56,"column":5}},"29":{"start":{"line":48,"column":6},"end":{"line":53,"column":7}},"30":{"start":{"line":49,"column":8},"end":{"line":49,"column":null}},"31":{"start":{"line":51,"column":8},"end":{"line":52,"column":null}},"32":{"start":{"line":55,"column":6},"end":{"line":55,"column":null}},"33":{"start":{"line":59,"column":17},"end":{"line":59,"column":80}},"34":{"start":{"line":61,"column":2},"end":{"line":81,"column":3}},"35":{"start":{"line":62,"column":4},"end":{"line":62,"column":null}},"36":{"start":{"line":63,"column":4},"end":{"line":63,"column":null}},"37":{"start":{"line":65,"column":19},"end":{"line":65,"column":88}},"38":{"start":{"line":66,"column":4},"end":{"line":66,"column":null}},"39":{"start":{"line":67,"column":4},"end":{"line":67,"column":null}},"40":{"start":{"line":68,"column":4},"end":{"line":68,"column":null}},"41":{"start":{"line":70,"column":4},"end":{"line":70,"column":null}},"42":{"start":{"line":73,"column":17},"end":{"line":73,"column":80}},"43":{"start":{"line":74,"column":4},"end":{"line":74,"column":null}},"44":{"start":{"line":75,"column":4},"end":{"line":75,"column":null}},"45":{"start":{"line":76,"column":4},"end":{"line":76,"column":null}},"46":{"start":{"line":77,"column":4},"end":{"line":77,"column":null}},"47":{"start":{"line":78,"column":4},"end":{"line":78,"column":null}},"48":{"start":{"line":80,"column":4},"end":{"line":80,"column":null}},"49":{"start":{"line":87,"column":16},"end":{"line":87,"column":47}},"50":{"start":{"line":89,"column":2},"end":{"line":91,"column":3}},"51":{"start":{"line":90,"column":4},"end":{"line":90,"column":27}},"52":{"start":{"line":93,"column":17},"end":{"line":93,"column":43}},"53":{"start":{"line":95,"column":2},"end":{"line":95,"column":16}},"54":{"start":{"line":99,"column":2},"end":{"line":99,"column":null}},"55":{"start":{"line":103,"column":2},"end":{"line":103,"column":23}},"56":{"start":{"line":107,"column":2},"end":{"line":107,"column":30}},"57":{"start":{"line":115,"column":2},"end":{"line":115,"column":79}},"58":{"start":{"line":125,"column":2},"end":{"line":125,"column":125}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":30,"column":2},"end":{"line":30,"column":8}},"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":null}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":31,"column":2},"end":{"line":31,"column":14}},"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":32,"column":2},"end":{"line":32,"column":15}},"loc":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":33,"column":2},"end":{"line":33,"column":19}},"loc":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":34,"column":2},"end":{"line":34,"column":19}},"loc":{"start":{"line":34,"column":2},"end":{"line":34,"column":null}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":35,"column":2},"end":{"line":35,"column":22}},"loc":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":36,"column":2},"end":{"line":36,"column":18}},"loc":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":37,"column":2},"end":{"line":37,"column":17}},"loc":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":38,"column":2},"end":{"line":38,"column":24}},"loc":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":40,"column":9},"end":{"line":40,"column":37}},"loc":{"start":{"line":40,"column":9},"end":{"line":40,"column":67}}},"10":{"name":"loadSchemaFromSources","decl":{"start":{"line":42,"column":16},"end":{"line":42,"column":37}},"loc":{"start":{"line":42,"column":55},"end":{"line":82,"column":1}}},"11":{"name":"loadSchemaFromIntrospectionResult","decl":{"start":{"line":84,"column":9},"end":{"line":84,"column":42}},"loc":{"start":{"line":85,"column":29},"end":{"line":96,"column":1}}},"12":{"name":"printSchemaToSDL","decl":{"start":{"line":98,"column":16},"end":{"line":98,"column":32}},"loc":{"start":{"line":98,"column":54},"end":{"line":100,"column":1}}},"13":{"name":"parseOperationDocument","decl":{"start":{"line":102,"column":16},"end":{"line":102,"column":38}},"loc":{"start":{"line":102,"column":53},"end":{"line":104,"column":1}}},"14":{"name":"mergeDocuments","decl":{"start":{"line":106,"column":16},"end":{"line":106,"column":30}},"loc":{"start":{"line":106,"column":56},"end":{"line":108,"column":1}}},"15":{"name":"validateDocument","decl":{"start":{"line":110,"column":16},"end":{"line":110,"column":32}},"loc":{"start":{"line":113,"column":38},"end":{"line":116,"column":1}}},"16":{"name":"compileDocument","decl":{"start":{"line":118,"column":16},"end":{"line":118,"column":31}},"loc":{"start":{"line":123,"column":38},"end":{"line":126,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":47,"column":4},"end":{"line":56,"column":5}},"type":"if","locations":[{"start":{"line":47,"column":4},"end":{"line":56,"column":5}},{"start":{"line":54,"column":11},"end":{"line":56,"column":5}}]},"1":{"loc":{"start":{"line":48,"column":6},"end":{"line":53,"column":7}},"type":"if","locations":[{"start":{"line":48,"column":6},"end":{"line":53,"column":7}},{"start":{"line":50,"column":13},"end":{"line":53,"column":7}}]},"2":{"loc":{"start":{"line":61,"column":2},"end":{"line":81,"column":3}},"type":"if","locations":[{"start":{"line":61,"column":2},"end":{"line":81,"column":3}},{"start":{"line":72,"column":9},"end":{"line":81,"column":3}}]},"3":{"loc":{"start":{"line":89,"column":2},"end":{"line":91,"column":3}},"type":"if","locations":[{"start":{"line":89,"column":2},"end":{"line":91,"column":3}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":12,"27":12,"28":12,"29":0,"30":0,"31":0,"32":12,"33":12,"34":12,"35":12,"36":12,"37":12,"38":12,"39":12,"40":7,"41":7,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":12,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0},"b":{"0":[0,12],"1":[0,0],"2":[12,0],"3":[0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/validationRules.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/validationRules.ts","statementMap":{"0":{"start":{"line":28,"column":0},"end":{"line":28,"column":16}},"1":{"start":{"line":42,"column":0},"end":{"line":42,"column":16}},"2":{"start":{"line":57,"column":0},"end":{"line":57,"column":16}},"3":{"start":{"line":72,"column":0},"end":{"line":72,"column":16}},"4":{"start":{"line":91,"column":0},"end":{"line":91,"column":16}},"5":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"6":{"start":{"line":14,"column":52},"end":{"line":14,"column":75}},"7":{"start":{"line":29,"column":35},"end":{"line":29,"column":105}},"8":{"start":{"line":30,"column":44},"end":{"line":30,"column":121}},"9":{"start":{"line":31,"column":2},"end":{"line":39,"column":4}},"10":{"start":{"line":38,"column":39},"end":{"line":38,"column":80}},"11":{"start":{"line":43,"column":2},"end":{"line":54,"column":4}},"12":{"start":{"line":45,"column":6},"end":{"line":51,"column":7}},"13":{"start":{"line":46,"column":8},"end":{"line":50,"column":10}},"14":{"start":{"line":52,"column":6},"end":{"line":52,"column":19}},"15":{"start":{"line":58,"column":2},"end":{"line":69,"column":4}},"16":{"start":{"line":60,"column":24},"end":{"line":60,"column":54}},"17":{"start":{"line":61,"column":6},"end":{"line":67,"column":7}},"18":{"start":{"line":62,"column":8},"end":{"line":66,"column":10}},"19":{"start":{"line":73,"column":2},"end":{"line":88,"column":4}},"20":{"start":{"line":75,"column":6},"end":{"line":86,"column":7}},"21":{"start":{"line":76,"column":8},"end":{"line":85,"column":9}},"22":{"start":{"line":77,"column":10},"end":{"line":84,"column":11}},"23":{"start":{"line":78,"column":12},"end":{"line":83,"column":null}},"24":{"start":{"line":92,"column":2},"end":{"line":109,"column":null}},"25":{"start":{"line":94,"column":6},"end":{"line":107,"column":7}},"26":{"start":{"line":95,"column":8},"end":{"line":106,"column":9}},"27":{"start":{"line":96,"column":10},"end":{"line":105,"column":11}},"28":{"start":{"line":97,"column":12},"end":{"line":97,"column":41}},"29":{"start":{"line":99,"column":12},"end":{"line":104,"column":null}},"30":{"start":{"line":113,"column":2},"end":{"line":130,"column":3}},"31":{"start":{"line":114,"column":4},"end":{"line":129,"column":null}},"32":{"start":{"line":115,"column":35},"end":{"line":115,"column":45}},"33":{"start":{"line":116,"column":6},"end":{"line":128,"column":8}},"34":{"start":{"line":118,"column":30},"end":{"line":118,"column":61}},"35":{"start":{"line":119,"column":44},"end":{"line":119,"column":102}},"36":{"start":{"line":120,"column":10},"end":{"line":126,"column":11}},"37":{"start":{"line":121,"column":12},"end":{"line":125,"column":14}},"38":{"start":{"line":131,"column":2},"end":{"line":131,"column":null}},"39":{"start":{"line":135,"column":2},"end":{"line":152,"column":3}},"40":{"start":{"line":136,"column":4},"end":{"line":151,"column":null}},"41":{"start":{"line":137,"column":30},"end":{"line":137,"column":35}},"42":{"start":{"line":138,"column":6},"end":{"line":150,"column":8}},"43":{"start":{"line":140,"column":32},"end":{"line":140,"column":56}},"44":{"start":{"line":141,"column":46},"end":{"line":141,"column":108}},"45":{"start":{"line":142,"column":10},"end":{"line":148,"column":11}},"46":{"start":{"line":143,"column":12},"end":{"line":147,"column":14}},"47":{"start":{"line":153,"column":2},"end":{"line":153,"column":null}}},"fnMap":{"0":{"name":"defaultValidationRules","decl":{"start":{"line":28,"column":16},"end":{"line":28,"column":38}},"loc":{"start":{"line":28,"column":65},"end":{"line":40,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":38,"column":29},"end":{"line":38,"column":30}},"loc":{"start":{"line":38,"column":39},"end":{"line":38,"column":80}}},"2":{"name":"NoAnonymousQueries","decl":{"start":{"line":42,"column":16},"end":{"line":42,"column":34}},"loc":{"start":{"line":42,"column":61},"end":{"line":55,"column":1}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":44,"column":4},"end":{"line":44,"column":23}},"loc":{"start":{"line":44,"column":53},"end":{"line":53,"column":5}}},"4":{"name":"NoTypenameAlias","decl":{"start":{"line":57,"column":16},"end":{"line":57,"column":31}},"loc":{"start":{"line":57,"column":58},"end":{"line":70,"column":1}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":59,"column":4},"end":{"line":59,"column":9}},"loc":{"start":{"line":59,"column":25},"end":{"line":68,"column":5}}},"6":{"name":"DeferredInlineFragmentNoTypeCondition","decl":{"start":{"line":72,"column":16},"end":{"line":72,"column":53}},"loc":{"start":{"line":72,"column":80},"end":{"line":89,"column":1}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":74,"column":4},"end":{"line":74,"column":18}},"loc":{"start":{"line":74,"column":43},"end":{"line":87,"column":5}}},"8":{"name":"DeferredInlineFragmentMissingLabelArgument","decl":{"start":{"line":91,"column":16},"end":{"line":91,"column":58}},"loc":{"start":{"line":91,"column":85},"end":{"line":110,"column":1}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":93,"column":4},"end":{"line":93,"column":18}},"loc":{"start":{"line":93,"column":43},"end":{"line":108,"column":5}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":96,"column":96},"end":{"line":96,"column":97}},"loc":{"start":{"line":97,"column":12},"end":{"line":97,"column":41}}},"11":{"name":"ApolloIOSDisallowedFieldNames","decl":{"start":{"line":112,"column":9},"end":{"line":112,"column":38}},"loc":{"start":{"line":112,"column":65},"end":{"line":132,"column":1}}},"12":{"name":"ApolloIOSDisallowedFieldNamesValidationRule","decl":{"start":{"line":114,"column":20},"end":{"line":114,"column":63}},"loc":{"start":{"line":114,"column":90},"end":{"line":129,"column":5}}},"13":{"name":"(anonymous_13)","decl":{"start":{"line":117,"column":8},"end":{"line":117,"column":13}},"loc":{"start":{"line":117,"column":29},"end":{"line":127,"column":9}}},"14":{"name":"ApolloIOSDisallowedInputParameterNames","decl":{"start":{"line":134,"column":9},"end":{"line":134,"column":47}},"loc":{"start":{"line":134,"column":69},"end":{"line":154,"column":1}}},"15":{"name":"ApolloIOSDisallowedInputParameterNamesValidationRule","decl":{"start":{"line":136,"column":20},"end":{"line":136,"column":72}},"loc":{"start":{"line":136,"column":99},"end":{"line":151,"column":5}}},"16":{"name":"(anonymous_16)","decl":{"start":{"line":139,"column":8},"end":{"line":139,"column":26}},"loc":{"start":{"line":139,"column":55},"end":{"line":149,"column":9}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":65},"end":{"line":29,"column":104}},"type":"cond-expr","locations":[{"start":{"line":29,"column":93},"end":{"line":29,"column":95}},{"start":{"line":29,"column":93},"end":{"line":29,"column":104}}]},"1":{"loc":{"start":{"line":29,"column":65},"end":{"line":29,"column":95}},"type":"binary-expr","locations":[{"start":{"line":29,"column":65},"end":{"line":29,"column":95}},{"start":{"line":29,"column":93},"end":{"line":29,"column":95}}]},"2":{"loc":{"start":{"line":36,"column":8},"end":{"line":36,"column":66}},"type":"cond-expr","locations":[{"start":{"line":36,"column":35},"end":{"line":36,"column":61}},{"start":{"line":36,"column":64},"end":{"line":36,"column":66}}]},"3":{"loc":{"start":{"line":37,"column":8},"end":{"line":37,"column":84}},"type":"cond-expr","locations":[{"start":{"line":37,"column":44},"end":{"line":37,"column":79}},{"start":{"line":37,"column":82},"end":{"line":37,"column":84}}]},"4":{"loc":{"start":{"line":45,"column":6},"end":{"line":51,"column":7}},"type":"if","locations":[{"start":{"line":45,"column":6},"end":{"line":51,"column":7}}]},"5":{"loc":{"start":{"line":60,"column":24},"end":{"line":60,"column":54}},"type":"binary-expr","locations":[{"start":{"line":60,"column":24},"end":{"line":60,"column":34}},{"start":{"line":60,"column":38},"end":{"line":60,"column":54}}]},"6":{"loc":{"start":{"line":61,"column":6},"end":{"line":67,"column":7}},"type":"if","locations":[{"start":{"line":61,"column":6},"end":{"line":67,"column":7}}]},"7":{"loc":{"start":{"line":75,"column":6},"end":{"line":86,"column":7}},"type":"if","locations":[{"start":{"line":75,"column":6},"end":{"line":86,"column":7}}]},"8":{"loc":{"start":{"line":77,"column":10},"end":{"line":84,"column":11}},"type":"if","locations":[{"start":{"line":77,"column":10},"end":{"line":84,"column":11}}]},"9":{"loc":{"start":{"line":77,"column":14},"end":{"line":77,"column":99}},"type":"binary-expr","locations":[{"start":{"line":77,"column":14},"end":{"line":77,"column":64}},{"start":{"line":77,"column":68},"end":{"line":77,"column":99}}]},"10":{"loc":{"start":{"line":94,"column":6},"end":{"line":107,"column":7}},"type":"if","locations":[{"start":{"line":94,"column":6},"end":{"line":107,"column":7}}]},"11":{"loc":{"start":{"line":96,"column":10},"end":{"line":105,"column":11}},"type":"if","locations":[{"start":{"line":96,"column":10},"end":{"line":105,"column":11}}]},"12":{"loc":{"start":{"line":96,"column":14},"end":{"line":98,"column":12}},"type":"binary-expr","locations":[{"start":{"line":96,"column":14},"end":{"line":96,"column":64}},{"start":{"line":96,"column":68},"end":{"line":98,"column":12}}]},"13":{"loc":{"start":{"line":96,"column":70},"end":{"line":97,"column":null}},"type":"cond-expr","locations":[{"start":{"line":96,"column":89},"end":{"line":96,"column":91}},{"start":{"line":96,"column":89},"end":{"line":97,"column":null}}]},"14":{"loc":{"start":{"line":96,"column":70},"end":{"line":96,"column":91}},"type":"binary-expr","locations":[{"start":{"line":96,"column":70},"end":{"line":96,"column":91}},{"start":{"line":96,"column":89},"end":{"line":96,"column":91}}]},"15":{"loc":{"start":{"line":113,"column":2},"end":{"line":130,"column":3}},"type":"if","locations":[{"start":{"line":113,"column":2},"end":{"line":130,"column":3}}]},"16":{"loc":{"start":{"line":118,"column":31},"end":{"line":118,"column":54}},"type":"cond-expr","locations":[{"start":{"line":118,"column":41},"end":{"line":118,"column":45}},{"start":{"line":118,"column":45},"end":{"line":118,"column":54}}]},"17":{"loc":{"start":{"line":118,"column":31},"end":{"line":118,"column":45}},"type":"binary-expr","locations":[{"start":{"line":118,"column":31},"end":{"line":118,"column":45}},{"start":{"line":118,"column":41},"end":{"line":118,"column":45}}]},"18":{"loc":{"start":{"line":120,"column":10},"end":{"line":126,"column":11}},"type":"if","locations":[{"start":{"line":120,"column":10},"end":{"line":126,"column":11}}]},"19":{"loc":{"start":{"line":135,"column":2},"end":{"line":152,"column":3}},"type":"if","locations":[{"start":{"line":135,"column":2},"end":{"line":152,"column":3}}]},"20":{"loc":{"start":{"line":142,"column":10},"end":{"line":148,"column":11}},"type":"if","locations":[{"start":{"line":142,"column":10},"end":{"line":148,"column":11}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0],"5":[0,0],"6":[0],"7":[0],"8":[0],"9":[0,0],"10":[0],"11":[0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0],"16":[0,0],"17":[0,0],"18":[0],"19":[0],"20":[0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts","statementMap":{"0":{"start":{"line":57,"column":0},"end":{"line":57,"column":16}},"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"2":{"start":{"line":8,"column":0},"end":{"line":8,"column":null}},"3":{"start":{"line":41,"column":0},"end":{"line":41,"column":46}},"4":{"start":{"line":43,"column":0},"end":{"line":43,"column":81}},"5":{"start":{"line":46,"column":2},"end":{"line":46,"column":32}},"6":{"start":{"line":65,"column":26},"end":{"line":65,"column":67}},"7":{"start":{"line":67,"column":2},"end":{"line":71,"column":3}},"8":{"start":{"line":68,"column":4},"end":{"line":68,"column":67}},"9":{"start":{"line":68,"column":58},"end":{"line":68,"column":67}},"10":{"start":{"line":70,"column":4},"end":{"line":70,"column":67}},"11":{"start":{"line":73,"column":47},"end":{"line":73,"column":49}},"12":{"start":{"line":74,"column":22},"end":{"line":74,"column":62}},"13":{"start":{"line":75,"column":26},"end":{"line":75,"column":53}},"14":{"start":{"line":76,"column":37},"end":{"line":76,"column":63}},"15":{"start":{"line":78,"column":20},"end":{"line":78,"column":61}},"16":{"start":{"line":79,"column":2},"end":{"line":81,"column":3}},"17":{"start":{"line":80,"column":4},"end":{"line":80,"column":95}},"18":{"start":{"line":83,"column":43},"end":{"line":87,"column":4}},"19":{"start":{"line":89,"column":2},"end":{"line":93,"column":3}},"20":{"start":{"line":90,"column":4},"end":{"line":90,"column":68}},"21":{"start":{"line":90,"column":59},"end":{"line":90,"column":68}},"22":{"start":{"line":92,"column":4},"end":{"line":92,"column":54}},"23":{"start":{"line":99,"column":2},"end":{"line":101,"column":3}},"24":{"start":{"line":100,"column":4},"end":{"line":100,"column":57}},"25":{"start":{"line":103,"column":2},"end":{"line":109,"column":4}},"26":{"start":{"line":112,"column":4},"end":{"line":112,"column":45}},"27":{"start":{"line":112,"column":37},"end":{"line":112,"column":43}},"28":{"start":{"line":114,"column":4},"end":{"line":114,"column":null}},"29":{"start":{"line":116,"column":4},"end":{"line":126,"column":5}},"30":{"start":{"line":117,"column":28},"end":{"line":117,"column":57}},"31":{"start":{"line":119,"column":7},"end":{"line":119,"column":57}},"32":{"start":{"line":121,"column":6},"end":{"line":125,"column":7}},"33":{"start":{"line":122,"column":8},"end":{"line":124,"column":9}},"34":{"start":{"line":123,"column":10},"end":{"line":123,"column":null}},"35":{"start":{"line":128,"column":4},"end":{"line":133,"column":5}},"36":{"start":{"line":129,"column":35},"end":{"line":129,"column":50}},"37":{"start":{"line":130,"column":6},"end":{"line":132,"column":7}},"38":{"start":{"line":131,"column":8},"end":{"line":131,"column":null}},"39":{"start":{"line":135,"column":4},"end":{"line":137,"column":5}},"40":{"start":{"line":136,"column":6},"end":{"line":136,"column":null}},"41":{"start":{"line":139,"column":4},"end":{"line":143,"column":5}},"42":{"start":{"line":140,"column":6},"end":{"line":142,"column":7}},"43":{"start":{"line":141,"column":8},"end":{"line":141,"column":null}},"44":{"start":{"line":149,"column":21},"end":{"line":149,"column":44}},"45":{"start":{"line":150,"column":4},"end":{"line":153,"column":5}},"46":{"start":{"line":151,"column":20},"end":{"line":151,"column":33}},"47":{"start":{"line":152,"column":6},"end":{"line":152,"column":null}},"48":{"start":{"line":159,"column":26},"end":{"line":159,"column":57}},"49":{"start":{"line":160,"column":4},"end":{"line":164,"column":5}},"50":{"start":{"line":161,"column":6},"end":{"line":163,"column":7}},"51":{"start":{"line":162,"column":8},"end":{"line":162,"column":20}},"52":{"start":{"line":165,"column":4},"end":{"line":165,"column":17}},"53":{"start":{"line":169,"column":19},"end":{"line":169,"column":40}},"54":{"start":{"line":170,"column":4},"end":{"line":170,"column":34}},"55":{"start":{"line":170,"column":18},"end":{"line":170,"column":34}},"56":{"start":{"line":172,"column":25},"end":{"line":172,"column":50}},"57":{"start":{"line":173,"column":4},"end":{"line":173,"column":40}},"58":{"start":{"line":173,"column":23},"end":{"line":173,"column":40}},"59":{"start":{"line":176,"column":4},"end":{"line":176,"column":33}},"60":{"start":{"line":178,"column":4},"end":{"line":178,"column":45}},"61":{"start":{"line":179,"column":4},"end":{"line":179,"column":36}},"62":{"start":{"line":180,"column":4},"end":{"line":180,"column":20}},"63":{"start":{"line":186,"column":4},"end":{"line":188,"column":5}},"64":{"start":{"line":187,"column":6},"end":{"line":187,"column":91}},"65":{"start":{"line":190,"column":21},"end":{"line":190,"column":57}},"66":{"start":{"line":191,"column":17},"end":{"line":191,"column":47}},"67":{"start":{"line":192,"column":26},"end":{"line":192,"column":55}},"68":{"start":{"line":193,"column":32},"end":{"line":193,"column":64}},"69":{"start":{"line":195,"column":22},"end":{"line":221,"column":null}},"70":{"start":{"line":197,"column":21},"end":{"line":197,"column":45}},"71":{"start":{"line":198,"column":29},"end":{"line":198,"column":98}},"72":{"start":{"line":203,"column":21},"end":{"line":203,"column":73}},"73":{"start":{"line":207,"column":8},"end":{"line":212,"column":9}},"74":{"start":{"line":208,"column":10},"end":{"line":211,"column":12}},"75":{"start":{"line":214,"column":8},"end":{"line":214,"column":46}},"76":{"start":{"line":216,"column":8},"end":{"line":220,"column":10}},"77":{"start":{"line":224,"column":19},"end":{"line":227,"column":6}},"78":{"start":{"line":228,"column":21},"end":{"line":228,"column":75}},"79":{"start":{"line":229,"column":26},"end":{"line":229,"column":101}},"80":{"start":{"line":231,"column":4},"end":{"line":231,"column":null}},"81":{"start":{"line":233,"column":25},"end":{"line":233,"column":109}},"82":{"start":{"line":234,"column":37},"end":{"line":234,"column":77}},"83":{"start":{"line":236,"column":4},"end":{"line":238,"column":5}},"84":{"start":{"line":237,"column":6},"end":{"line":237,"column":61}},"85":{"start":{"line":240,"column":4},"end":{"line":250,"column":6}},"86":{"start":{"line":256,"column":17},"end":{"line":256,"column":46}},"87":{"start":{"line":258,"column":21},"end":{"line":258,"column":56}},"88":{"start":{"line":259,"column":19},"end":{"line":262,"column":6}},"89":{"start":{"line":263,"column":32},"end":{"line":263,"column":64}},"90":{"start":{"line":265,"column":26},"end":{"line":267,"column":null}},"91":{"start":{"line":270,"column":26},"end":{"line":270,"column":100}},"92":{"start":{"line":272,"column":4},"end":{"line":272,"column":51}},"93":{"start":{"line":274,"column":25},"end":{"line":274,"column":113}},"94":{"start":{"line":275,"column":37},"end":{"line":275,"column":77}},"95":{"start":{"line":277,"column":4},"end":{"line":279,"column":5}},"96":{"start":{"line":278,"column":6},"end":{"line":278,"column":61}},"97":{"start":{"line":281,"column":4},"end":{"line":290,"column":6}},"98":{"start":{"line":296,"column":4},"end":{"line":299,"column":7}},"99":{"start":{"line":297,"column":6},"end":{"line":297,"column":null}},"100":{"start":{"line":298,"column":6},"end":{"line":298,"column":null}},"101":{"start":{"line":307,"column":4},"end":{"line":314,"column":6}},"102":{"start":{"line":311,"column":10},"end":{"line":311,"column":83}},"103":{"start":{"line":322,"column":46},"end":{"line":322,"column":115}},"104":{"start":{"line":324,"column":4},"end":{"line":438,"column":5}},"105":{"start":{"line":326,"column":21},"end":{"line":326,"column":45}},"106":{"start":{"line":327,"column":8},"end":{"line":327,"column":54}},"107":{"start":{"line":327,"column":36},"end":{"line":327,"column":53}},"108":{"start":{"line":328,"column":22},"end":{"line":328,"column":48}},"109":{"start":{"line":330,"column":25},"end":{"line":330,"column":62}},"110":{"start":{"line":331,"column":8},"end":{"line":336,"column":9}},"111":{"start":{"line":332,"column":10},"end":{"line":335,"column":12}},"112":{"start":{"line":338,"column":26},"end":{"line":338,"column":39}},"113":{"start":{"line":339,"column":35},"end":{"line":339,"column":62}},"114":{"start":{"line":341,"column":8},"end":{"line":341,"column":60}},"115":{"start":{"line":343,"column":51},"end":{"line":343,"column":59}},"116":{"start":{"line":344,"column":44},"end":{"line":344,"column":95}},"117":{"start":{"line":346,"column":30},"end":{"line":356,"column":10}},"118":{"start":{"line":359,"column":10},"end":{"line":369,"column":11}},"119":{"start":{"line":360,"column":32},"end":{"line":360,"column":63}},"120":{"start":{"line":361,"column":46},"end":{"line":361,"column":104}},"121":{"start":{"line":363,"column":12},"end":{"line":368,"column":13}},"122":{"start":{"line":364,"column":14},"end":{"line":367,"column":16}},"123":{"start":{"line":372,"column":8},"end":{"line":376,"column":9}},"124":{"start":{"line":373,"column":10},"end":{"line":373,"column":null}},"125":{"start":{"line":374,"column":15},"end":{"line":376,"column":9}},"126":{"start":{"line":375,"column":10},"end":{"line":375,"column":null}},"127":{"start":{"line":378,"column":8},"end":{"line":395,"column":9}},"128":{"start":{"line":379,"column":35},"end":{"line":379,"column":61}},"129":{"start":{"line":381,"column":10},"end":{"line":388,"column":11}},"130":{"start":{"line":382,"column":12},"end":{"line":387,"column":14}},"131":{"start":{"line":390,"column":10},"end":{"line":394,"column":12}},"132":{"start":{"line":396,"column":8},"end":{"line":396,"column":21}},"133":{"start":{"line":399,"column":25},"end":{"line":399,"column":52}},"134":{"start":{"line":400,"column":30},"end":{"line":402,"column":22}},"135":{"start":{"line":404,"column":8},"end":{"line":404,"column":41}},"136":{"start":{"line":406,"column":8},"end":{"line":415,"column":10}},"137":{"start":{"line":418,"column":29},"end":{"line":418,"column":53}},"138":{"start":{"line":420,"column":25},"end":{"line":420,"column":50}},"139":{"start":{"line":421,"column":8},"end":{"line":426,"column":9}},"140":{"start":{"line":422,"column":10},"end":{"line":425,"column":12}},"141":{"start":{"line":428,"column":8},"end":{"line":428,"column":51}},"142":{"start":{"line":430,"column":50},"end":{"line":435,"column":10}},"143":{"start":{"line":436,"column":8},"end":{"line":436,"column":30}},"144":{"start":{"line":446,"column":52},"end":{"line":446,"column":64}},"145":{"start":{"line":447,"column":4},"end":{"line":469,"column":18}},"146":{"start":{"line":449,"column":21},"end":{"line":449,"column":35}},"147":{"start":{"line":450,"column":23},"end":{"line":451,"column":null}},"148":{"start":{"line":451,"column":22},"end":{"line":451,"column":52}},"149":{"start":{"line":453,"column":27},"end":{"line":453,"column":39}},"150":{"start":{"line":455,"column":8},"end":{"line":460,"column":9}},"151":{"start":{"line":456,"column":10},"end":{"line":459,"column":12}},"152":{"start":{"line":462,"column":8},"end":{"line":467,"column":10}},"153":{"start":{"line":475,"column":4},"end":{"line":508,"column":5}},"154":{"start":{"line":476,"column":49},"end":{"line":476,"column":51}},"155":{"start":{"line":477,"column":59},"end":{"line":477,"column":61}},"156":{"start":{"line":479,"column":6},"end":{"line":499,"column":7}},"157":{"start":{"line":480,"column":21},"end":{"line":480,"column":41}},"158":{"start":{"line":481,"column":29},"end":{"line":481,"column":54}},"159":{"start":{"line":483,"column":8},"end":{"line":488,"column":9}},"160":{"start":{"line":484,"column":10},"end":{"line":487,"column":12}},"161":{"start":{"line":490,"column":8},"end":{"line":495,"column":10}},"162":{"start":{"line":497,"column":26},"end":{"line":497,"column":76}},"163":{"start":{"line":498,"column":8},"end":{"line":498,"column":62}},"164":{"start":{"line":498,"column":25},"end":{"line":498,"column":61}},"165":{"start":{"line":501,"column":6},"end":{"line":504,"column":null}},"166":{"start":{"line":507,"column":6},"end":{"line":507,"column":23}},"167":{"start":{"line":515,"column":4},"end":{"line":542,"column":5}},"168":{"start":{"line":516,"column":24},"end":{"line":516,"column":58}},"169":{"start":{"line":517,"column":25},"end":{"line":517,"column":52}},"170":{"start":{"line":519,"column":6},"end":{"line":539,"column":7}},"171":{"start":{"line":521,"column":10},"end":{"line":525,"column":11}},"172":{"start":{"line":522,"column":12},"end":{"line":522,"column":60}},"173":{"start":{"line":524,"column":12},"end":{"line":524,"column":60}},"174":{"start":{"line":528,"column":10},"end":{"line":531,"column":null}},"175":{"start":{"line":534,"column":10},"end":{"line":537,"column":12}},"176":{"start":{"line":538,"column":10},"end":{"line":538,"column":16}},"177":{"start":{"line":541,"column":6},"end":{"line":541,"column":null}}},"fnMap":{"0":{"name":"filePathForNode","decl":{"start":{"line":45,"column":9},"end":{"line":45,"column":24}},"loc":{"start":{"line":45,"column":38},"end":{"line":47,"column":1}}},"1":{"name":"compileToIR","decl":{"start":{"line":57,"column":16},"end":{"line":57,"column":27}},"loc":{"start":{"line":62,"column":38},"end":{"line":545,"column":1}}},"2":{"name":"addReferencedType","decl":{"start":{"line":111,"column":11},"end":{"line":111,"column":28}},"loc":{"start":{"line":111,"column":51},"end":{"line":144,"column":3}}},"3":{"name":"addReferencedTypesFromInputObject","decl":{"start":{"line":146,"column":11},"end":{"line":146,"column":44}},"loc":{"start":{"line":147,"column":39},"end":{"line":154,"column":3}}},"4":{"name":"hasTypePolicyDirective","decl":{"start":{"line":156,"column":11},"end":{"line":156,"column":33}},"loc":{"start":{"line":157,"column":30},"end":{"line":166,"column":3}}},"5":{"name":"getFragment","decl":{"start":{"line":168,"column":11},"end":{"line":168,"column":22}},"loc":{"start":{"line":168,"column":35},"end":{"line":181,"column":3}}},"6":{"name":"compileOperation","decl":{"start":{"line":183,"column":11},"end":{"line":183,"column":27}},"loc":{"start":{"line":184,"column":48},"end":{"line":251,"column":3}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":196,"column":6},"end":{"line":196,"column":7}},"loc":{"start":{"line":196,"column":15},"end":{"line":221,"column":7}}},"8":{"name":"compileFragment","decl":{"start":{"line":253,"column":11},"end":{"line":253,"column":26}},"loc":{"start":{"line":254,"column":46},"end":{"line":291,"column":3}}},"9":{"name":"overrideAsLocalCacheMutation","decl":{"start":{"line":293,"column":11},"end":{"line":293,"column":39}},"loc":{"start":{"line":294,"column":38},"end":{"line":300,"column":3}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":296,"column":22},"end":{"line":296,"column":29}},"loc":{"start":{"line":296,"column":32},"end":{"line":299,"column":5}}},"11":{"name":"compileSelectionSet","decl":{"start":{"line":302,"column":11},"end":{"line":302,"column":30}},"loc":{"start":{"line":305,"column":60},"end":{"line":315,"column":3}}},"12":{"name":"(anonymous_12)","decl":{"start":{"line":310,"column":13},"end":{"line":310,"column":14}},"loc":{"start":{"line":311,"column":10},"end":{"line":311,"column":83}}},"13":{"name":"compileSelection","decl":{"start":{"line":317,"column":11},"end":{"line":317,"column":27}},"loc":{"start":{"line":320,"column":60},"end":{"line":439,"column":3}}},"14":{"name":"validateFieldName","decl":{"start":{"line":358,"column":17},"end":{"line":358,"column":34}},"loc":{"start":{"line":358,"column":109},"end":{"line":370,"column":9}}},"15":{"name":"compileArguments","decl":{"start":{"line":441,"column":11},"end":{"line":441,"column":27}},"loc":{"start":{"line":444,"column":72},"end":{"line":470,"column":3}}},"16":{"name":"(anonymous_16)","decl":{"start":{"line":448,"column":20},"end":{"line":448,"column":21}},"loc":{"start":{"line":448,"column":28},"end":{"line":468,"column":7}}},"17":{"name":"(anonymous_17)","decl":{"start":{"line":451,"column":10},"end":{"line":451,"column":11}},"loc":{"start":{"line":451,"column":22},"end":{"line":451,"column":52}}},"18":{"name":"compileDirectives","decl":{"start":{"line":472,"column":11},"end":{"line":472,"column":28}},"loc":{"start":{"line":473,"column":45},"end":{"line":509,"column":3}}},"19":{"name":"compileInclusionCondition","decl":{"start":{"line":511,"column":11},"end":{"line":511,"column":36}},"loc":{"start":{"line":513,"column":34},"end":{"line":543,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":46,"column":9},"end":{"line":46,"column":31}},"type":"cond-expr","locations":[{"start":{"line":46,"column":25},"end":{"line":46,"column":27}},{"start":{"line":46,"column":25},"end":{"line":46,"column":31}}]},"1":{"loc":{"start":{"line":46,"column":9},"end":{"line":46,"column":27}},"type":"binary-expr","locations":[{"start":{"line":46,"column":9},"end":{"line":46,"column":27}},{"start":{"line":46,"column":25},"end":{"line":46,"column":27}}]},"2":{"loc":{"start":{"line":46,"column":9},"end":{"line":46,"column":25}},"type":"cond-expr","locations":[{"start":{"line":46,"column":17},"end":{"line":46,"column":19}},{"start":{"line":46,"column":17},"end":{"line":46,"column":25}}]},"3":{"loc":{"start":{"line":46,"column":9},"end":{"line":46,"column":19}},"type":"binary-expr","locations":[{"start":{"line":46,"column":9},"end":{"line":46,"column":19}},{"start":{"line":46,"column":17},"end":{"line":46,"column":19}}]},"4":{"loc":{"start":{"line":68,"column":4},"end":{"line":68,"column":67}},"type":"if","locations":[{"start":{"line":68,"column":4},"end":{"line":68,"column":67}}]},"5":{"loc":{"start":{"line":79,"column":2},"end":{"line":81,"column":3}},"type":"if","locations":[{"start":{"line":79,"column":2},"end":{"line":81,"column":3}}]},"6":{"loc":{"start":{"line":85,"column":18},"end":{"line":85,"column":55}},"type":"cond-expr","locations":[{"start":{"line":85,"column":42},"end":{"line":85,"column":46}},{"start":{"line":85,"column":46},"end":{"line":85,"column":55}}]},"7":{"loc":{"start":{"line":85,"column":18},"end":{"line":85,"column":46}},"type":"binary-expr","locations":[{"start":{"line":85,"column":18},"end":{"line":85,"column":46}},{"start":{"line":85,"column":42},"end":{"line":85,"column":46}}]},"8":{"loc":{"start":{"line":86,"column":22},"end":{"line":86,"column":63}},"type":"cond-expr","locations":[{"start":{"line":86,"column":50},"end":{"line":86,"column":54}},{"start":{"line":86,"column":54},"end":{"line":86,"column":63}}]},"9":{"loc":{"start":{"line":86,"column":22},"end":{"line":86,"column":54}},"type":"binary-expr","locations":[{"start":{"line":86,"column":22},"end":{"line":86,"column":54}},{"start":{"line":86,"column":50},"end":{"line":86,"column":54}}]},"10":{"loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":68}},"type":"if","locations":[{"start":{"line":90,"column":4},"end":{"line":90,"column":68}}]},"11":{"loc":{"start":{"line":108,"column":25},"end":{"line":108,"column":56}},"type":"cond-expr","locations":[{"start":{"line":108,"column":43},"end":{"line":108,"column":47}},{"start":{"line":108,"column":47},"end":{"line":108,"column":56}}]},"12":{"loc":{"start":{"line":108,"column":25},"end":{"line":108,"column":47}},"type":"binary-expr","locations":[{"start":{"line":108,"column":25},"end":{"line":108,"column":47}},{"start":{"line":108,"column":43},"end":{"line":108,"column":47}}]},"13":{"loc":{"start":{"line":112,"column":4},"end":{"line":112,"column":45}},"type":"if","locations":[{"start":{"line":112,"column":4},"end":{"line":112,"column":45}}]},"14":{"loc":{"start":{"line":116,"column":4},"end":{"line":126,"column":5}},"type":"if","locations":[{"start":{"line":116,"column":4},"end":{"line":126,"column":5}}]},"15":{"loc":{"start":{"line":122,"column":8},"end":{"line":124,"column":9}},"type":"if","locations":[{"start":{"line":122,"column":8},"end":{"line":124,"column":9}}]},"16":{"loc":{"start":{"line":122,"column":12},"end":{"line":122,"column":68}},"type":"binary-expr","locations":[{"start":{"line":122,"column":12},"end":{"line":122,"column":30}},{"start":{"line":122,"column":34},"end":{"line":122,"column":68}}]},"17":{"loc":{"start":{"line":128,"column":4},"end":{"line":133,"column":5}},"type":"if","locations":[{"start":{"line":128,"column":4},"end":{"line":133,"column":5}}]},"18":{"loc":{"start":{"line":135,"column":4},"end":{"line":137,"column":5}},"type":"if","locations":[{"start":{"line":135,"column":4},"end":{"line":137,"column":5}}]},"19":{"loc":{"start":{"line":139,"column":4},"end":{"line":143,"column":5}},"type":"if","locations":[{"start":{"line":139,"column":4},"end":{"line":143,"column":5}}]},"20":{"loc":{"start":{"line":160,"column":28},"end":{"line":160,"column":58}},"type":"cond-expr","locations":[{"start":{"line":160,"column":52},"end":{"line":160,"column":56}},{"start":{"line":160,"column":56},"end":{"line":160,"column":58}}]},"21":{"loc":{"start":{"line":160,"column":28},"end":{"line":160,"column":56}},"type":"binary-expr","locations":[{"start":{"line":160,"column":28},"end":{"line":160,"column":56}},{"start":{"line":160,"column":52},"end":{"line":160,"column":56}}]},"22":{"loc":{"start":{"line":160,"column":28},"end":{"line":160,"column":52}},"type":"cond-expr","locations":[{"start":{"line":160,"column":40},"end":{"line":160,"column":42}},{"start":{"line":160,"column":40},"end":{"line":160,"column":52}}]},"23":{"loc":{"start":{"line":160,"column":28},"end":{"line":160,"column":42}},"type":"binary-expr","locations":[{"start":{"line":160,"column":28},"end":{"line":160,"column":42}},{"start":{"line":160,"column":40},"end":{"line":160,"column":42}}]},"24":{"loc":{"start":{"line":161,"column":6},"end":{"line":163,"column":7}},"type":"if","locations":[{"start":{"line":161,"column":6},"end":{"line":163,"column":7}}]},"25":{"loc":{"start":{"line":170,"column":4},"end":{"line":170,"column":34}},"type":"if","locations":[{"start":{"line":170,"column":4},"end":{"line":170,"column":34}}]},"26":{"loc":{"start":{"line":173,"column":4},"end":{"line":173,"column":40}},"type":"if","locations":[{"start":{"line":173,"column":4},"end":{"line":173,"column":40}}]},"27":{"loc":{"start":{"line":186,"column":4},"end":{"line":188,"column":5}},"type":"if","locations":[{"start":{"line":186,"column":4},"end":{"line":188,"column":5}}]},"28":{"loc":{"start":{"line":195,"column":23},"end":{"line":195,"column":68}},"type":"binary-expr","locations":[{"start":{"line":195,"column":23},"end":{"line":195,"column":62}},{"start":{"line":195,"column":66},"end":{"line":195,"column":68}}]},"29":{"loc":{"start":{"line":198,"column":29},"end":{"line":198,"column":98}},"type":"cond-expr","locations":[{"start":{"line":198,"column":49},"end":{"line":198,"column":86}},{"start":{"line":198,"column":89},"end":{"line":198,"column":98}}]},"30":{"loc":{"start":{"line":207,"column":8},"end":{"line":212,"column":9}},"type":"if","locations":[{"start":{"line":207,"column":8},"end":{"line":212,"column":9}}]},"31":{"loc":{"start":{"line":229,"column":26},"end":{"line":229,"column":101}},"type":"cond-expr","locations":[{"start":{"line":229,"column":75},"end":{"line":229,"column":79}},{"start":{"line":229,"column":79},"end":{"line":229,"column":101}}]},"32":{"loc":{"start":{"line":229,"column":26},"end":{"line":229,"column":79}},"type":"binary-expr","locations":[{"start":{"line":229,"column":26},"end":{"line":229,"column":79}},{"start":{"line":229,"column":75},"end":{"line":229,"column":79}}]},"33":{"loc":{"start":{"line":236,"column":4},"end":{"line":238,"column":5}},"type":"if","locations":[{"start":{"line":236,"column":4},"end":{"line":238,"column":5}}]},"34":{"loc":{"start":{"line":270,"column":26},"end":{"line":270,"column":100}},"type":"cond-expr","locations":[{"start":{"line":270,"column":74},"end":{"line":270,"column":78}},{"start":{"line":270,"column":78},"end":{"line":270,"column":100}}]},"35":{"loc":{"start":{"line":270,"column":26},"end":{"line":270,"column":78}},"type":"binary-expr","locations":[{"start":{"line":270,"column":26},"end":{"line":270,"column":78}},{"start":{"line":270,"column":74},"end":{"line":270,"column":78}}]},"36":{"loc":{"start":{"line":277,"column":4},"end":{"line":279,"column":5}},"type":"if","locations":[{"start":{"line":277,"column":4},"end":{"line":279,"column":5}}]},"37":{"loc":{"start":{"line":322,"column":46},"end":{"line":322,"column":115}},"type":"cond-expr","locations":[{"start":{"line":322,"column":89},"end":{"line":322,"column":93}},{"start":{"line":322,"column":93},"end":{"line":322,"column":115}}]},"38":{"loc":{"start":{"line":322,"column":46},"end":{"line":322,"column":93}},"type":"binary-expr","locations":[{"start":{"line":322,"column":46},"end":{"line":322,"column":93}},{"start":{"line":322,"column":89},"end":{"line":322,"column":93}}]},"39":{"loc":{"start":{"line":324,"column":4},"end":{"line":438,"column":5}},"type":"switch","locations":[{"start":{"line":325,"column":6},"end":{"line":397,"column":7}},{"start":{"line":398,"column":6},"end":{"line":416,"column":7}},{"start":{"line":417,"column":6},"end":{"line":437,"column":7}}]},"40":{"loc":{"start":{"line":327,"column":8},"end":{"line":327,"column":54}},"type":"if","locations":[{"start":{"line":327,"column":8},"end":{"line":327,"column":54}}]},"41":{"loc":{"start":{"line":328,"column":22},"end":{"line":328,"column":48}},"type":"cond-expr","locations":[{"start":{"line":328,"column":41},"end":{"line":328,"column":43}},{"start":{"line":328,"column":41},"end":{"line":328,"column":48}}]},"42":{"loc":{"start":{"line":328,"column":22},"end":{"line":328,"column":43}},"type":"binary-expr","locations":[{"start":{"line":328,"column":22},"end":{"line":328,"column":43}},{"start":{"line":328,"column":41},"end":{"line":328,"column":43}}]},"43":{"loc":{"start":{"line":331,"column":8},"end":{"line":336,"column":9}},"type":"if","locations":[{"start":{"line":331,"column":8},"end":{"line":336,"column":9}}]},"44":{"loc":{"start":{"line":353,"column":23},"end":{"line":353,"column":86}},"type":"cond-expr","locations":[{"start":{"line":353,"column":63},"end":{"line":353,"column":74}},{"start":{"line":353,"column":77},"end":{"line":353,"column":86}}]},"45":{"loc":{"start":{"line":353,"column":23},"end":{"line":353,"column":60}},"type":"binary-expr","locations":[{"start":{"line":353,"column":23},"end":{"line":353,"column":45}},{"start":{"line":353,"column":49},"end":{"line":353,"column":60}}]},"46":{"loc":{"start":{"line":354,"column":29},"end":{"line":354,"column":59}},"type":"binary-expr","locations":[{"start":{"line":354,"column":29},"end":{"line":354,"column":46}},{"start":{"line":354,"column":50},"end":{"line":354,"column":59}}]},"47":{"loc":{"start":{"line":359,"column":10},"end":{"line":369,"column":11}},"type":"if","locations":[{"start":{"line":359,"column":10},"end":{"line":369,"column":11}}]},"48":{"loc":{"start":{"line":359,"column":14},"end":{"line":359,"column":48}},"type":"binary-expr","locations":[{"start":{"line":359,"column":14},"end":{"line":359,"column":29}},{"start":{"line":359,"column":33},"end":{"line":359,"column":48}}]},"49":{"loc":{"start":{"line":360,"column":33},"end":{"line":360,"column":56}},"type":"cond-expr","locations":[{"start":{"line":360,"column":43},"end":{"line":360,"column":47}},{"start":{"line":360,"column":47},"end":{"line":360,"column":56}}]},"50":{"loc":{"start":{"line":360,"column":33},"end":{"line":360,"column":47}},"type":"binary-expr","locations":[{"start":{"line":360,"column":33},"end":{"line":360,"column":47}},{"start":{"line":360,"column":43},"end":{"line":360,"column":47}}]},"51":{"loc":{"start":{"line":363,"column":12},"end":{"line":368,"column":13}},"type":"if","locations":[{"start":{"line":363,"column":12},"end":{"line":368,"column":13}}]},"52":{"loc":{"start":{"line":363,"column":16},"end":{"line":363,"column":68}},"type":"cond-expr","locations":[{"start":{"line":363,"column":31},"end":{"line":363,"column":33}},{"start":{"line":363,"column":16},"end":{"line":363,"column":68}}]},"53":{"loc":{"start":{"line":363,"column":16},"end":{"line":363,"column":33}},"type":"binary-expr","locations":[{"start":{"line":363,"column":16},"end":{"line":363,"column":33}},{"start":{"line":363,"column":16},"end":{"line":363,"column":33}}]},"54":{"loc":{"start":{"line":372,"column":8},"end":{"line":376,"column":9}},"type":"if","locations":[{"start":{"line":372,"column":8},"end":{"line":376,"column":9}},{"start":{"line":374,"column":15},"end":{"line":376,"column":9}}]},"55":{"loc":{"start":{"line":372,"column":12},"end":{"line":372,"column":95}},"type":"binary-expr","locations":[{"start":{"line":372,"column":12},"end":{"line":372,"column":33}},{"start":{"line":372,"column":38},"end":{"line":372,"column":62}},{"start":{"line":372,"column":66},"end":{"line":372,"column":94}}]},"56":{"loc":{"start":{"line":373,"column":43},"end":{"line":373,"column":93}},"type":"cond-expr","locations":[{"start":{"line":373,"column":81},"end":{"line":373,"column":83}},{"start":{"line":373,"column":81},"end":{"line":373,"column":93}}]},"57":{"loc":{"start":{"line":373,"column":43},"end":{"line":373,"column":83}},"type":"binary-expr","locations":[{"start":{"line":373,"column":43},"end":{"line":373,"column":83}},{"start":{"line":373,"column":81},"end":{"line":373,"column":83}}]},"58":{"loc":{"start":{"line":374,"column":15},"end":{"line":376,"column":9}},"type":"if","locations":[{"start":{"line":374,"column":15},"end":{"line":376,"column":9}}]},"59":{"loc":{"start":{"line":375,"column":43},"end":{"line":375,"column":89}},"type":"cond-expr","locations":[{"start":{"line":375,"column":81},"end":{"line":375,"column":83}},{"start":{"line":375,"column":81},"end":{"line":375,"column":89}}]},"60":{"loc":{"start":{"line":375,"column":43},"end":{"line":375,"column":83}},"type":"binary-expr","locations":[{"start":{"line":375,"column":43},"end":{"line":375,"column":83}},{"start":{"line":375,"column":81},"end":{"line":375,"column":83}}]},"61":{"loc":{"start":{"line":378,"column":8},"end":{"line":395,"column":9}},"type":"if","locations":[{"start":{"line":378,"column":8},"end":{"line":395,"column":9}}]},"62":{"loc":{"start":{"line":381,"column":10},"end":{"line":388,"column":11}},"type":"if","locations":[{"start":{"line":381,"column":10},"end":{"line":388,"column":11}}]},"63":{"loc":{"start":{"line":400,"column":30},"end":{"line":402,"column":22}},"type":"cond-expr","locations":[{"start":{"line":401,"column":13},"end":{"line":401,"column":67}},{"start":{"line":402,"column":12},"end":{"line":402,"column":22}}]},"64":{"loc":{"start":{"line":421,"column":8},"end":{"line":426,"column":9}},"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":426,"column":9}}]},"65":{"loc":{"start":{"line":447,"column":11},"end":{"line":469,"column":17}},"type":"cond-expr","locations":[{"start":{"line":448,"column":8},"end":{"line":468,"column":8}},{"start":{"line":469,"column":8},"end":{"line":469,"column":17}}]},"66":{"loc":{"start":{"line":447,"column":11},"end":{"line":447,"column":40}},"type":"binary-expr","locations":[{"start":{"line":447,"column":11},"end":{"line":447,"column":18}},{"start":{"line":447,"column":22},"end":{"line":447,"column":40}}]},"67":{"loc":{"start":{"line":453,"column":27},"end":{"line":453,"column":39}},"type":"cond-expr","locations":[{"start":{"line":453,"column":33},"end":{"line":453,"column":35}},{"start":{"line":453,"column":27},"end":{"line":453,"column":39}}]},"68":{"loc":{"start":{"line":453,"column":27},"end":{"line":453,"column":35}},"type":"binary-expr","locations":[{"start":{"line":453,"column":27},"end":{"line":453,"column":35}},{"start":{"line":453,"column":27},"end":{"line":453,"column":35}}]},"69":{"loc":{"start":{"line":455,"column":8},"end":{"line":460,"column":9}},"type":"if","locations":[{"start":{"line":455,"column":8},"end":{"line":460,"column":9}}]},"70":{"loc":{"start":{"line":466,"column":29},"end":{"line":466,"column":66}},"type":"cond-expr","locations":[{"start":{"line":466,"column":53},"end":{"line":466,"column":57}},{"start":{"line":466,"column":57},"end":{"line":466,"column":66}}]},"71":{"loc":{"start":{"line":466,"column":29},"end":{"line":466,"column":57}},"type":"binary-expr","locations":[{"start":{"line":466,"column":29},"end":{"line":466,"column":57}},{"start":{"line":466,"column":53},"end":{"line":466,"column":57}}]},"72":{"loc":{"start":{"line":475,"column":4},"end":{"line":508,"column":5}},"type":"if","locations":[{"start":{"line":475,"column":4},"end":{"line":508,"column":5}},{"start":{"line":506,"column":11},"end":{"line":508,"column":5}}]},"73":{"loc":{"start":{"line":475,"column":8},"end":{"line":475,"column":43}},"type":"binary-expr","locations":[{"start":{"line":475,"column":8},"end":{"line":475,"column":18}},{"start":{"line":475,"column":22},"end":{"line":475,"column":43}}]},"74":{"loc":{"start":{"line":483,"column":8},"end":{"line":488,"column":9}},"type":"if","locations":[{"start":{"line":483,"column":8},"end":{"line":488,"column":9}}]},"75":{"loc":{"start":{"line":498,"column":8},"end":{"line":498,"column":62}},"type":"if","locations":[{"start":{"line":498,"column":8},"end":{"line":498,"column":62}}]},"76":{"loc":{"start":{"line":503,"column":8},"end":{"line":503,"column":72}},"type":"cond-expr","locations":[{"start":{"line":503,"column":41},"end":{"line":503,"column":60}},{"start":{"line":503,"column":63},"end":{"line":503,"column":72}}]},"77":{"loc":{"start":{"line":515,"column":4},"end":{"line":542,"column":5}},"type":"if","locations":[{"start":{"line":515,"column":4},"end":{"line":542,"column":5}},{"start":{"line":540,"column":11},"end":{"line":542,"column":5}}]},"78":{"loc":{"start":{"line":515,"column":8},"end":{"line":515,"column":69}},"type":"binary-expr","locations":[{"start":{"line":515,"column":8},"end":{"line":515,"column":38}},{"start":{"line":515,"column":42},"end":{"line":515,"column":69}}]},"79":{"loc":{"start":{"line":516,"column":24},"end":{"line":516,"column":58}},"type":"cond-expr","locations":[{"start":{"line":516,"column":47},"end":{"line":516,"column":50}},{"start":{"line":516,"column":47},"end":{"line":516,"column":58}}]},"80":{"loc":{"start":{"line":516,"column":24},"end":{"line":516,"column":50}},"type":"binary-expr","locations":[{"start":{"line":516,"column":24},"end":{"line":516,"column":50}},{"start":{"line":516,"column":47},"end":{"line":516,"column":50}}]},"81":{"loc":{"start":{"line":519,"column":6},"end":{"line":539,"column":7}},"type":"switch","locations":[{"start":{"line":520,"column":8},"end":{"line":525,"column":11}},{"start":{"line":527,"column":8},"end":{"line":531,"column":null}},{"start":{"line":533,"column":8},"end":{"line":538,"column":16}}]},"82":{"loc":{"start":{"line":519,"column":14},"end":{"line":519,"column":29}},"type":"cond-expr","locations":[{"start":{"line":519,"column":23},"end":{"line":519,"column":25}},{"start":{"line":519,"column":14},"end":{"line":519,"column":29}}]},"83":{"loc":{"start":{"line":519,"column":14},"end":{"line":519,"column":25}},"type":"binary-expr","locations":[{"start":{"line":519,"column":14},"end":{"line":519,"column":25}},{"start":{"line":519,"column":14},"end":{"line":519,"column":25}}]},"84":{"loc":{"start":{"line":521,"column":10},"end":{"line":525,"column":11}},"type":"if","locations":[{"start":{"line":521,"column":10},"end":{"line":525,"column":11}},{"start":{"line":523,"column":17},"end":{"line":525,"column":11}}]},"85":{"loc":{"start":{"line":522,"column":19},"end":{"line":522,"column":59}},"type":"cond-expr","locations":[{"start":{"line":522,"column":37},"end":{"line":522,"column":46}},{"start":{"line":522,"column":49},"end":{"line":522,"column":59}}]},"86":{"loc":{"start":{"line":524,"column":19},"end":{"line":524,"column":59}},"type":"cond-expr","locations":[{"start":{"line":524,"column":37},"end":{"line":524,"column":47}},{"start":{"line":524,"column":50},"end":{"line":524,"column":59}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0],"5":[0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0],"11":[0,0],"12":[0,0],"13":[0],"14":[0],"15":[0],"16":[0,0],"17":[0],"18":[0],"19":[0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0],"25":[0],"26":[0],"27":[0],"28":[0,0],"29":[0,0],"30":[0],"31":[0,0],"32":[0,0],"33":[0],"34":[0,0],"35":[0,0],"36":[0],"37":[0,0],"38":[0,0],"39":[0,0,0],"40":[0],"41":[0,0],"42":[0,0],"43":[0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0,0],"56":[0,0],"57":[0,0],"58":[0],"59":[0,0],"60":[0,0],"61":[0],"62":[0],"63":[0,0],"64":[0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0],"75":[0],"76":[0,0],"77":[0,0],"78":[0,0],"79":[0,0],"80":[0,0],"81":[0,0,0],"82":[0,0],"83":[0,0],"84":[0,0],"85":[0,0],"86":[0,0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/values.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/values.ts","statementMap":{"0":{"start":{"line":28,"column":0},"end":{"line":28,"column":16}},"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}},"2":{"start":{"line":29,"column":2},"end":{"line":47,"column":3}},"3":{"start":{"line":31,"column":6},"end":{"line":31,"column":67}},"4":{"start":{"line":33,"column":6},"end":{"line":36,"column":8}},"5":{"start":{"line":38,"column":6},"end":{"line":44,"column":8}},"6":{"start":{"line":41,"column":10},"end":{"line":41,"column":69}},"7":{"start":{"line":42,"column":10},"end":{"line":42,"column":24}},"8":{"start":{"line":46,"column":6},"end":{"line":46,"column":23}}},"fnMap":{"0":{"name":"valueFromValueNode","decl":{"start":{"line":28,"column":16},"end":{"line":28,"column":34}},"loc":{"start":{"line":28,"column":55},"end":{"line":48,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":40,"column":39},"end":{"line":40,"column":40}},"loc":{"start":{"line":40,"column":57},"end":{"line":43,"column":9}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":2},"end":{"line":47,"column":3}},"type":"switch","locations":[{"start":{"line":30,"column":4},"end":{"line":31,"column":67}},{"start":{"line":32,"column":4},"end":{"line":36,"column":8}},{"start":{"line":37,"column":4},"end":{"line":44,"column":8}},{"start":{"line":45,"column":4},"end":{"line":46,"column":23}}]}},"s":{"0":1,"1":1,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"f":{"0":0,"1":0},"b":{"0":[0,0,0,0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts","statementMap":{"0":{"start":{"line":73,"column":0},"end":{"line":73,"column":16}},"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":96}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":76}},"3":{"start":{"line":4,"column":13},"end":{"line":10,"column":null}},"4":{"start":{"line":12,"column":13},"end":{"line":26,"column":null}},"5":{"start":{"line":28,"column":13},"end":{"line":48,"column":null}},"6":{"start":{"line":50,"column":13},"end":{"line":64,"column":null}},"7":{"start":{"line":66,"column":25},"end":{"line":71,"column":null}},"8":{"start":{"line":74,"column":21},"end":{"line":77,"column":4}},"9":{"start":{"line":74,"column":58},"end":{"line":76,"column":null}},"10":{"start":{"line":75,"column":4},"end":{"line":76,"column":49}},"11":{"start":{"line":79,"column":2},"end":{"line":82,"column":6}}},"fnMap":{"0":{"name":"addApolloCodegenSchemaExtensionToDocument","decl":{"start":{"line":73,"column":16},"end":{"line":73,"column":57}},"loc":{"start":{"line":73,"column":80},"end":{"line":83,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":74,"column":45},"end":{"line":74,"column":54}},"loc":{"start":{"line":74,"column":58},"end":{"line":76,"column":null}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":74,"column":85},"end":{"line":74,"column":95}},"loc":{"start":{"line":75,"column":4},"end":{"line":76,"column":49}}}},"branchMap":{"0":{"loc":{"start":{"line":75,"column":4},"end":{"line":76,"column":49}},"type":"binary-expr","locations":[{"start":{"line":75,"column":4},"end":{"line":75,"column":48}},{"start":{"line":76,"column":4},"end":{"line":76,"column":49}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":12,"9":48,"10":140,"11":12},"f":{"0":12,"1":48,"2":140},"b":{"0":[140,0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/experimentalDeferDirective.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/experimentalDeferDirective.ts","statementMap":{"0":{"start":{"line":19,"column":0},"end":{"line":19,"column":16}},"1":{"start":{"line":53,"column":0},"end":{"line":53,"column":16}},"2":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"3":{"start":{"line":11,"column":0},"end":{"line":11,"column":47}},"4":{"start":{"line":20,"column":21},"end":{"line":20,"column":87}},"5":{"start":{"line":22,"column":2},"end":{"line":24,"column":3}},"6":{"start":{"line":23,"column":4},"end":{"line":23,"column":null}},"7":{"start":{"line":26,"column":30},"end":{"line":26,"column":67}},"8":{"start":{"line":28,"column":2},"end":{"line":39,"column":3}},"9":{"start":{"line":29,"column":4},"end":{"line":29,"column":null}},"10":{"start":{"line":31,"column":43},"end":{"line":36,"column":null}},"11":{"start":{"line":34,"column":19},"end":{"line":34,"column":86}},"12":{"start":{"line":38,"column":4},"end":{"line":38,"column":null}},"13":{"start":{"line":41,"column":2},"end":{"line":41,"column":null}},"14":{"start":{"line":54,"column":20},"end":{"line":54,"column":67}},"15":{"start":{"line":56,"column":2},"end":{"line":58,"column":3}},"16":{"start":{"line":57,"column":4},"end":{"line":57,"column":null}},"17":{"start":{"line":60,"column":2},"end":{"line":64,"column":3}},"18":{"start":{"line":61,"column":4},"end":{"line":61,"column":null}},"19":{"start":{"line":63,"column":4},"end":{"line":63,"column":null}},"20":{"start":{"line":66,"column":2},"end":{"line":66,"column":null}},"21":{"start":{"line":71,"column":2},"end":{"line":74,"column":null}},"22":{"start":{"line":78,"column":2},"end":{"line":81,"column":null}},"23":{"start":{"line":87,"column":2},"end":{"line":91,"column":null}},"24":{"start":{"line":89,"column":39},"end":{"line":89,"column":49}},"25":{"start":{"line":90,"column":41},"end":{"line":90,"column":57}},"26":{"start":{"line":90,"column":108},"end":{"line":90,"column":118}},"27":{"start":{"line":97,"column":2},"end":{"line":101,"column":null}},"28":{"start":{"line":100,"column":34},"end":{"line":100,"column":44}},"29":{"start":{"line":100,"column":95},"end":{"line":100,"column":105}}},"fnMap":{"0":{"name":"addExperimentalDeferDirectiveToSDLDocument","decl":{"start":{"line":19,"column":16},"end":{"line":19,"column":58}},"loc":{"start":{"line":19,"column":81},"end":{"line":42,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":34,"column":8},"end":{"line":34,"column":9}},"loc":{"start":{"line":34,"column":19},"end":{"line":34,"column":86}}},"2":{"name":"addExperimentalDeferDirectiveToIntrospectionSchema","decl":{"start":{"line":53,"column":16},"end":{"line":53,"column":66}},"loc":{"start":{"line":53,"column":112},"end":{"line":67,"column":1}}},"3":{"name":"isDeferDirectiveDefinitionNodePredicate","decl":{"start":{"line":70,"column":9},"end":{"line":70,"column":48}},"loc":{"start":{"line":70,"column":70},"end":{"line":75,"column":1}}},"4":{"name":"experimentalDeferDirectiveDocumentNode","decl":{"start":{"line":77,"column":9},"end":{"line":77,"column":47}},"loc":{"start":{"line":77,"column":47},"end":{"line":82,"column":1}}},"5":{"name":"matchDirectiveDefinition","decl":{"start":{"line":86,"column":9},"end":{"line":86,"column":33}},"loc":{"start":{"line":86,"column":95},"end":{"line":92,"column":1}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":89,"column":29},"end":{"line":89,"column":30}},"loc":{"start":{"line":89,"column":39},"end":{"line":89,"column":49}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":90,"column":30},"end":{"line":90,"column":31}},"loc":{"start":{"line":90,"column":41},"end":{"line":90,"column":57}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":90,"column":97},"end":{"line":90,"column":98}},"loc":{"start":{"line":90,"column":108},"end":{"line":90,"column":118}}},"9":{"name":"matchDirective","decl":{"start":{"line":96,"column":9},"end":{"line":96,"column":23}},"loc":{"start":{"line":96,"column":77},"end":{"line":102,"column":1}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":100,"column":23},"end":{"line":100,"column":24}},"loc":{"start":{"line":100,"column":34},"end":{"line":100,"column":44}}},"11":{"name":"(anonymous_11)","decl":{"start":{"line":100,"column":84},"end":{"line":100,"column":85}},"loc":{"start":{"line":100,"column":95},"end":{"line":100,"column":105}}}},"branchMap":{"0":{"loc":{"start":{"line":22,"column":2},"end":{"line":24,"column":3}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":24,"column":3}}]},"1":{"loc":{"start":{"line":28,"column":2},"end":{"line":39,"column":3}},"type":"if","locations":[{"start":{"line":28,"column":2},"end":{"line":39,"column":3}}]},"2":{"loc":{"start":{"line":34,"column":19},"end":{"line":34,"column":86}},"type":"cond-expr","locations":[{"start":{"line":34,"column":69},"end":{"line":34,"column":74}},{"start":{"line":34,"column":77},"end":{"line":34,"column":86}}]},"3":{"loc":{"start":{"line":56,"column":2},"end":{"line":58,"column":3}},"type":"if","locations":[{"start":{"line":56,"column":2},"end":{"line":58,"column":3}}]},"4":{"loc":{"start":{"line":60,"column":2},"end":{"line":64,"column":3}},"type":"if","locations":[{"start":{"line":60,"column":2},"end":{"line":64,"column":3}}]},"5":{"loc":{"start":{"line":72,"column":4},"end":{"line":73,"column":51}},"type":"binary-expr","locations":[{"start":{"line":72,"column":4},"end":{"line":72,"column":44}},{"start":{"line":73,"column":4},"end":{"line":73,"column":51}}]},"6":{"loc":{"start":{"line":88,"column":4},"end":{"line":90,"column":137}},"type":"binary-expr","locations":[{"start":{"line":88,"column":4},"end":{"line":88,"column":49}},{"start":{"line":89,"column":4},"end":{"line":89,"column":116}},{"start":{"line":90,"column":4},"end":{"line":90,"column":137}}]},"7":{"loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":76}},"type":"cond-expr","locations":[{"start":{"line":90,"column":24},"end":{"line":90,"column":26}},{"start":{"line":90,"column":24},"end":{"line":90,"column":76}}]},"8":{"loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":26}},"type":"binary-expr","locations":[{"start":{"line":90,"column":4},"end":{"line":90,"column":26}},{"start":{"line":90,"column":24},"end":{"line":90,"column":26}}]},"9":{"loc":{"start":{"line":98,"column":4},"end":{"line":100,"column":124}},"type":"binary-expr","locations":[{"start":{"line":98,"column":4},"end":{"line":98,"column":50}},{"start":{"line":99,"column":4},"end":{"line":99,"column":98}},{"start":{"line":100,"column":4},"end":{"line":100,"column":124}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":12,"5":12,"6":12,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":83,"22":12,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0},"f":{"0":12,"1":0,"2":0,"3":83,"4":12,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"b":{"0":[12],"1":[0],"2":[0,0],"3":[0],"4":[0],"5":[83,48],"6":[0,0,0],"7":[0,0],"8":[0,0],"9":[0,0,0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts","statementMap":{"0":{"start":{"line":24,"column":0},"end":{"line":24,"column":16}},"1":{"start":{"line":39,"column":0},"end":{"line":39,"column":16}},"2":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"3":{"start":{"line":15,"column":0},"end":{"line":15,"column":71}},"4":{"start":{"line":17,"column":22},"end":{"line":17,"column":54}},"5":{"start":{"line":27,"column":16},"end":{"line":27,"column":35}},"6":{"start":{"line":29,"column":2},"end":{"line":36,"column":3}},"7":{"start":{"line":30,"column":17},"end":{"line":30,"column":25}},"8":{"start":{"line":32,"column":4},"end":{"line":35,"column":5}},"9":{"start":{"line":34,"column":6},"end":{"line":34,"column":34}},"10":{"start":{"line":42,"column":21},"end":{"line":42,"column":51}},"11":{"start":{"line":43,"column":2},"end":{"line":45,"column":3}},"12":{"start":{"line":44,"column":4},"end":{"line":44,"column":11}},"13":{"start":{"line":47,"column":21},"end":{"line":47,"column":37}},"14":{"start":{"line":49,"column":2},"end":{"line":138,"column":3}},"15":{"start":{"line":50,"column":30},"end":{"line":52,"column":12}},"16":{"start":{"line":51,"column":13},"end":{"line":51,"column":40}},"17":{"start":{"line":53,"column":39},"end":{"line":53,"column":48}},"18":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"19":{"start":{"line":55,"column":6},"end":{"line":55,"column":null}},"20":{"start":{"line":58,"column":4},"end":{"line":63,"column":5}},"21":{"start":{"line":59,"column":6},"end":{"line":62,"column":8}},"22":{"start":{"line":65,"column":29},"end":{"line":67,"column":12}},"23":{"start":{"line":66,"column":13},"end":{"line":66,"column":39}},"24":{"start":{"line":68,"column":40},"end":{"line":68,"column":49}},"25":{"start":{"line":69,"column":4},"end":{"line":72,"column":5}},"26":{"start":{"line":70,"column":22},"end":{"line":70,"column":55}},"27":{"start":{"line":71,"column":6},"end":{"line":71,"column":54}},"28":{"start":{"line":74,"column":4},"end":{"line":79,"column":5}},"29":{"start":{"line":75,"column":6},"end":{"line":78,"column":8}},"30":{"start":{"line":82,"column":24},"end":{"line":82,"column":44}},"31":{"start":{"line":83,"column":4},"end":{"line":88,"column":5}},"32":{"start":{"line":84,"column":6},"end":{"line":87,"column":8}},"33":{"start":{"line":91,"column":19},"end":{"line":91,"column":49}},"34":{"start":{"line":92,"column":23},"end":{"line":92,"column":76}},"35":{"start":{"line":92,"column":52},"end":{"line":92,"column":68}},"36":{"start":{"line":93,"column":4},"end":{"line":102,"column":5}},"37":{"start":{"line":94,"column":6},"end":{"line":101,"column":7}},"38":{"start":{"line":95,"column":8},"end":{"line":100,"column":10}},"39":{"start":{"line":105,"column":4},"end":{"line":131,"column":5}},"40":{"start":{"line":106,"column":26},"end":{"line":106,"column":27}},"41":{"start":{"line":107,"column":32},"end":{"line":107,"column":60}},"42":{"start":{"line":109,"column":6},"end":{"line":113,"column":7}},"43":{"start":{"line":110,"column":8},"end":{"line":112,"column":9}},"44":{"start":{"line":111,"column":10},"end":{"line":111,"column":29}},"45":{"start":{"line":116,"column":6},"end":{"line":121,"column":7}},"46":{"start":{"line":117,"column":8},"end":{"line":120,"column":10}},"47":{"start":{"line":125,"column":6},"end":{"line":130,"column":7}},"48":{"start":{"line":126,"column":8},"end":{"line":129,"column":10}},"49":{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},"50":{"start":{"line":134,"column":7},"end":{"line":134,"column":null}},"51":{"start":{"line":136,"column":7},"end":{"line":136,"column":null}},"52":{"start":{"line":144,"column":2},"end":{"line":146,"column":3}},"53":{"start":{"line":145,"column":4},"end":{"line":145,"column":21}},"54":{"start":{"line":148,"column":34},"end":{"line":148,"column":36}},"55":{"start":{"line":150,"column":2},"end":{"line":157,"column":3}},"56":{"start":{"line":151,"column":22},"end":{"line":152,"column":null}},"57":{"start":{"line":152,"column":13},"end":{"line":152,"column":43}},"58":{"start":{"line":154,"column":4},"end":{"line":156,"column":5}},"59":{"start":{"line":155,"column":6},"end":{"line":155,"column":null}},"60":{"start":{"line":159,"column":2},"end":{"line":163,"column":3}},"61":{"start":{"line":160,"column":4},"end":{"line":162,"column":5}},"62":{"start":{"line":161,"column":6},"end":{"line":161,"column":29}},"63":{"start":{"line":165,"column":2},"end":{"line":186,"column":3}},"64":{"start":{"line":166,"column":4},"end":{"line":185,"column":5}},"65":{"start":{"line":167,"column":20},"end":{"line":167,"column":59}},"66":{"start":{"line":168,"column":6},"end":{"line":170,"column":7}},"67":{"start":{"line":169,"column":8},"end":{"line":169,"column":17}},"68":{"start":{"line":172,"column":6},"end":{"line":184,"column":7}},"69":{"start":{"line":173,"column":24},"end":{"line":173,"column":29}},"70":{"start":{"line":174,"column":8},"end":{"line":179,"column":9}},"71":{"start":{"line":175,"column":10},"end":{"line":178,"column":11}},"72":{"start":{"line":176,"column":12},"end":{"line":176,"column":29}},"73":{"start":{"line":177,"column":12},"end":{"line":177,"column":18}},"74":{"start":{"line":181,"column":8},"end":{"line":183,"column":9}},"75":{"start":{"line":182,"column":10},"end":{"line":182,"column":38}},"76":{"start":{"line":188,"column":2},"end":{"line":188,"column":null}},"77":{"start":{"line":195,"column":2},"end":{"line":208,"column":4}},"78":{"start":{"line":198,"column":8},"end":{"line":198,"column":74}},"79":{"start":{"line":204,"column":8},"end":{"line":204,"column":74}}},"fnMap":{"0":{"name":"addFieldPolicyDirectivesToSchema","decl":{"start":{"line":24,"column":16},"end":{"line":24,"column":48}},"loc":{"start":{"line":25,"column":23},"end":{"line":37,"column":1}}},"1":{"name":"applyFieldPoliciesFor","decl":{"start":{"line":39,"column":16},"end":{"line":39,"column":37}},"loc":{"start":{"line":40,"column":28},"end":{"line":139,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":51,"column":6},"end":{"line":51,"column":7}},"loc":{"start":{"line":51,"column":13},"end":{"line":51,"column":40}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":66,"column":6},"end":{"line":66,"column":7}},"loc":{"start":{"line":66,"column":13},"end":{"line":66,"column":39}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":92,"column":43},"end":{"line":92,"column":48}},"loc":{"start":{"line":92,"column":52},"end":{"line":92,"column":68}}},"5":{"name":"fieldPolicyDirectivesFor","decl":{"start":{"line":141,"column":9},"end":{"line":141,"column":33}},"loc":{"start":{"line":142,"column":28},"end":{"line":189,"column":1}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":152,"column":6},"end":{"line":152,"column":7}},"loc":{"start":{"line":152,"column":13},"end":{"line":152,"column":43}}},"7":{"name":"matchDirectiveArguments","decl":{"start":{"line":191,"column":9},"end":{"line":191,"column":32}},"loc":{"start":{"line":193,"column":23},"end":{"line":209,"column":1}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":197,"column":11},"end":{"line":197,"column":12}},"loc":{"start":{"line":198,"column":8},"end":{"line":198,"column":74}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":203,"column":11},"end":{"line":203,"column":12}},"loc":{"start":{"line":204,"column":8},"end":{"line":204,"column":74}}}},"branchMap":{"0":{"loc":{"start":{"line":32,"column":4},"end":{"line":35,"column":5}},"type":"if","locations":[{"start":{"line":32,"column":4},"end":{"line":35,"column":5}}]},"1":{"loc":{"start":{"line":32,"column":8},"end":{"line":32,"column":81}},"type":"binary-expr","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":41}},{"start":{"line":32,"column":45},"end":{"line":32,"column":81}}]},"2":{"loc":{"start":{"line":43,"column":2},"end":{"line":45,"column":3}},"type":"if","locations":[{"start":{"line":43,"column":2},"end":{"line":45,"column":3}}]},"3":{"loc":{"start":{"line":43,"column":6},"end":{"line":43,"column":38}},"type":"binary-expr","locations":[{"start":{"line":43,"column":6},"end":{"line":43,"column":17}},{"start":{"line":43,"column":21},"end":{"line":43,"column":38}}]},"4":{"loc":{"start":{"line":50,"column":30},"end":{"line":52,"column":12}},"type":"cond-expr","locations":[{"start":{"line":52,"column":5},"end":{"line":52,"column":7}},{"start":{"line":52,"column":5},"end":{"line":52,"column":12}}]},"5":{"loc":{"start":{"line":50,"column":30},"end":{"line":52,"column":7}},"type":"binary-expr","locations":[{"start":{"line":50,"column":30},"end":{"line":52,"column":7}},{"start":{"line":52,"column":5},"end":{"line":52,"column":7}}]},"6":{"loc":{"start":{"line":50,"column":30},"end":{"line":51,"column":null}},"type":"cond-expr","locations":[{"start":{"line":50,"column":49},"end":{"line":50,"column":51}},{"start":{"line":50,"column":49},"end":{"line":51,"column":null}}]},"7":{"loc":{"start":{"line":50,"column":30},"end":{"line":50,"column":51}},"type":"binary-expr","locations":[{"start":{"line":50,"column":30},"end":{"line":50,"column":51}},{"start":{"line":50,"column":49},"end":{"line":50,"column":51}}]},"8":{"loc":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":56,"column":5}}]},"9":{"loc":{"start":{"line":54,"column":8},"end":{"line":54,"column":31}},"type":"cond-expr","locations":[{"start":{"line":54,"column":25},"end":{"line":54,"column":27}},{"start":{"line":54,"column":8},"end":{"line":54,"column":31}}]},"10":{"loc":{"start":{"line":54,"column":8},"end":{"line":54,"column":27}},"type":"binary-expr","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":27}},{"start":{"line":54,"column":8},"end":{"line":54,"column":27}}]},"11":{"loc":{"start":{"line":58,"column":4},"end":{"line":63,"column":5}},"type":"if","locations":[{"start":{"line":58,"column":4},"end":{"line":63,"column":5}}]},"12":{"loc":{"start":{"line":65,"column":29},"end":{"line":67,"column":12}},"type":"cond-expr","locations":[{"start":{"line":67,"column":5},"end":{"line":67,"column":7}},{"start":{"line":67,"column":5},"end":{"line":67,"column":12}}]},"13":{"loc":{"start":{"line":65,"column":29},"end":{"line":67,"column":7}},"type":"binary-expr","locations":[{"start":{"line":65,"column":29},"end":{"line":67,"column":7}},{"start":{"line":67,"column":5},"end":{"line":67,"column":7}}]},"14":{"loc":{"start":{"line":65,"column":29},"end":{"line":66,"column":null}},"type":"cond-expr","locations":[{"start":{"line":65,"column":48},"end":{"line":65,"column":50}},{"start":{"line":65,"column":48},"end":{"line":66,"column":null}}]},"15":{"loc":{"start":{"line":65,"column":29},"end":{"line":65,"column":50}},"type":"binary-expr","locations":[{"start":{"line":65,"column":29},"end":{"line":65,"column":50}},{"start":{"line":65,"column":48},"end":{"line":65,"column":50}}]},"16":{"loc":{"start":{"line":69,"column":4},"end":{"line":72,"column":5}},"type":"if","locations":[{"start":{"line":69,"column":4},"end":{"line":72,"column":5}}]},"17":{"loc":{"start":{"line":69,"column":8},"end":{"line":69,"column":30}},"type":"cond-expr","locations":[{"start":{"line":69,"column":24},"end":{"line":69,"column":26}},{"start":{"line":69,"column":8},"end":{"line":69,"column":30}}]},"18":{"loc":{"start":{"line":69,"column":8},"end":{"line":69,"column":26}},"type":"binary-expr","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":26}},{"start":{"line":69,"column":8},"end":{"line":69,"column":26}}]},"19":{"loc":{"start":{"line":74,"column":4},"end":{"line":79,"column":5}},"type":"if","locations":[{"start":{"line":74,"column":4},"end":{"line":79,"column":5}}]},"20":{"loc":{"start":{"line":83,"column":4},"end":{"line":88,"column":5}},"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":88,"column":5}}]},"21":{"loc":{"start":{"line":86,"column":17},"end":{"line":86,"column":69}},"type":"cond-expr","locations":[{"start":{"line":86,"column":32},"end":{"line":86,"column":57}},{"start":{"line":86,"column":60},"end":{"line":86,"column":69}}]},"22":{"loc":{"start":{"line":91,"column":19},"end":{"line":91,"column":49}},"type":"cond-expr","locations":[{"start":{"line":91,"column":38},"end":{"line":91,"column":40}},{"start":{"line":91,"column":38},"end":{"line":91,"column":49}}]},"23":{"loc":{"start":{"line":91,"column":19},"end":{"line":91,"column":40}},"type":"binary-expr","locations":[{"start":{"line":91,"column":19},"end":{"line":91,"column":40}},{"start":{"line":91,"column":38},"end":{"line":91,"column":40}}]},"24":{"loc":{"start":{"line":92,"column":31},"end":{"line":92,"column":75}},"type":"cond-expr","locations":[{"start":{"line":92,"column":69},"end":{"line":92,"column":73}},{"start":{"line":92,"column":73},"end":{"line":92,"column":75}}]},"25":{"loc":{"start":{"line":92,"column":31},"end":{"line":92,"column":73}},"type":"binary-expr","locations":[{"start":{"line":92,"column":31},"end":{"line":92,"column":73}},{"start":{"line":92,"column":69},"end":{"line":92,"column":73}}]},"26":{"loc":{"start":{"line":92,"column":31},"end":{"line":92,"column":69}},"type":"cond-expr","locations":[{"start":{"line":92,"column":37},"end":{"line":92,"column":39}},{"start":{"line":92,"column":31},"end":{"line":92,"column":69}}]},"27":{"loc":{"start":{"line":92,"column":31},"end":{"line":92,"column":39}},"type":"binary-expr","locations":[{"start":{"line":92,"column":31},"end":{"line":92,"column":39}},{"start":{"line":92,"column":31},"end":{"line":92,"column":39}}]},"28":{"loc":{"start":{"line":94,"column":6},"end":{"line":101,"column":7}},"type":"if","locations":[{"start":{"line":94,"column":6},"end":{"line":101,"column":7}}]},"29":{"loc":{"start":{"line":105,"column":4},"end":{"line":131,"column":5}},"type":"if","locations":[{"start":{"line":105,"column":4},"end":{"line":131,"column":5}}]},"30":{"loc":{"start":{"line":110,"column":8},"end":{"line":112,"column":9}},"type":"if","locations":[{"start":{"line":110,"column":8},"end":{"line":112,"column":9}}]},"31":{"loc":{"start":{"line":116,"column":6},"end":{"line":121,"column":7}},"type":"if","locations":[{"start":{"line":116,"column":6},"end":{"line":121,"column":7}}]},"32":{"loc":{"start":{"line":125,"column":6},"end":{"line":130,"column":7}},"type":"if","locations":[{"start":{"line":125,"column":6},"end":{"line":130,"column":7}}]},"33":{"loc":{"start":{"line":125,"column":10},"end":{"line":125,"column":97}},"type":"binary-expr","locations":[{"start":{"line":125,"column":11},"end":{"line":125,"column":28}},{"start":{"line":125,"column":32},"end":{"line":125,"column":50}},{"start":{"line":125,"column":56},"end":{"line":125,"column":74}},{"start":{"line":125,"column":78},"end":{"line":125,"column":96}}]},"34":{"loc":{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},"type":"if","locations":[{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},{"start":{"line":135,"column":11},"end":{"line":137,"column":5}}]},"35":{"loc":{"start":{"line":144,"column":2},"end":{"line":146,"column":3}},"type":"if","locations":[{"start":{"line":144,"column":2},"end":{"line":146,"column":3}}]},"36":{"loc":{"start":{"line":144,"column":5},"end":{"line":144,"column":50}},"type":"binary-expr","locations":[{"start":{"line":144,"column":5},"end":{"line":144,"column":24}},{"start":{"line":144,"column":28},"end":{"line":144,"column":50}}]},"37":{"loc":{"start":{"line":150,"column":26},"end":{"line":150,"column":54}},"type":"cond-expr","locations":[{"start":{"line":150,"column":48},"end":{"line":150,"column":52}},{"start":{"line":150,"column":52},"end":{"line":150,"column":54}}]},"38":{"loc":{"start":{"line":150,"column":26},"end":{"line":150,"column":52}},"type":"binary-expr","locations":[{"start":{"line":150,"column":26},"end":{"line":150,"column":52}},{"start":{"line":150,"column":48},"end":{"line":150,"column":52}}]},"39":{"loc":{"start":{"line":151,"column":22},"end":{"line":152,"column":null}},"type":"cond-expr","locations":[{"start":{"line":151,"column":42},"end":{"line":151,"column":44}},{"start":{"line":151,"column":42},"end":{"line":152,"column":null}}]},"40":{"loc":{"start":{"line":151,"column":22},"end":{"line":151,"column":44}},"type":"binary-expr","locations":[{"start":{"line":151,"column":22},"end":{"line":151,"column":44}},{"start":{"line":151,"column":42},"end":{"line":151,"column":44}}]},"41":{"loc":{"start":{"line":154,"column":4},"end":{"line":156,"column":5}},"type":"if","locations":[{"start":{"line":154,"column":4},"end":{"line":156,"column":5}}]},"42":{"loc":{"start":{"line":159,"column":26},"end":{"line":159,"column":56}},"type":"cond-expr","locations":[{"start":{"line":159,"column":50},"end":{"line":159,"column":54}},{"start":{"line":159,"column":54},"end":{"line":159,"column":56}}]},"43":{"loc":{"start":{"line":159,"column":26},"end":{"line":159,"column":54}},"type":"binary-expr","locations":[{"start":{"line":159,"column":26},"end":{"line":159,"column":54}},{"start":{"line":159,"column":50},"end":{"line":159,"column":54}}]},"44":{"loc":{"start":{"line":159,"column":26},"end":{"line":159,"column":50}},"type":"cond-expr","locations":[{"start":{"line":159,"column":38},"end":{"line":159,"column":40}},{"start":{"line":159,"column":38},"end":{"line":159,"column":50}}]},"45":{"loc":{"start":{"line":159,"column":26},"end":{"line":159,"column":40}},"type":"binary-expr","locations":[{"start":{"line":159,"column":26},"end":{"line":159,"column":40}},{"start":{"line":159,"column":38},"end":{"line":159,"column":40}}]},"46":{"loc":{"start":{"line":160,"column":4},"end":{"line":162,"column":5}},"type":"if","locations":[{"start":{"line":160,"column":4},"end":{"line":162,"column":5}}]},"47":{"loc":{"start":{"line":165,"column":2},"end":{"line":186,"column":3}},"type":"if","locations":[{"start":{"line":165,"column":2},"end":{"line":186,"column":3}}]},"48":{"loc":{"start":{"line":168,"column":6},"end":{"line":170,"column":7}},"type":"if","locations":[{"start":{"line":168,"column":6},"end":{"line":170,"column":7}}]},"49":{"loc":{"start":{"line":175,"column":10},"end":{"line":178,"column":11}},"type":"if","locations":[{"start":{"line":175,"column":10},"end":{"line":178,"column":11}}]},"50":{"loc":{"start":{"line":181,"column":8},"end":{"line":183,"column":9}},"type":"if","locations":[{"start":{"line":181,"column":8},"end":{"line":183,"column":9}}]},"51":{"loc":{"start":{"line":196,"column":5},"end":{"line":196,"column":26}},"type":"cond-expr","locations":[{"start":{"line":196,"column":20},"end":{"line":196,"column":24}},{"start":{"line":196,"column":24},"end":{"line":196,"column":26}}]},"52":{"loc":{"start":{"line":196,"column":5},"end":{"line":196,"column":24}},"type":"binary-expr","locations":[{"start":{"line":196,"column":5},"end":{"line":196,"column":24}},{"start":{"line":196,"column":20},"end":{"line":196,"column":24}}]},"53":{"loc":{"start":{"line":202,"column":5},"end":{"line":202,"column":27}},"type":"cond-expr","locations":[{"start":{"line":202,"column":21},"end":{"line":202,"column":25}},{"start":{"line":202,"column":25},"end":{"line":202,"column":27}}]},"54":{"loc":{"start":{"line":202,"column":5},"end":{"line":202,"column":25}},"type":"binary-expr","locations":[{"start":{"line":202,"column":5},"end":{"line":202,"column":25}},{"start":{"line":202,"column":21},"end":{"line":202,"column":25}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":12,"6":12,"7":98,"8":98,"9":62,"10":62,"11":62,"12":0,"13":62,"14":62,"15":15,"16":15,"17":15,"18":15,"19":15,"20":15,"21":0,"22":15,"23":30,"24":15,"25":15,"26":15,"27":15,"28":15,"29":0,"30":15,"31":15,"32":0,"33":15,"34":15,"35":18,"36":15,"37":18,"38":1,"39":14,"40":14,"41":14,"42":14,"43":16,"44":4,"45":14,"46":1,"47":13,"48":3,"49":10,"50":10,"51":0,"52":66,"53":0,"54":66,"55":66,"56":12,"57":12,"58":12,"59":12,"60":66,"61":5,"62":5,"63":66,"64":66,"65":4,"66":4,"67":0,"68":4,"69":4,"70":4,"71":2,"72":2,"73":2,"74":4,"75":2,"76":66,"77":2,"78":4,"79":4},"f":{"0":12,"1":62,"2":15,"3":30,"4":18,"5":66,"6":12,"7":2,"8":4,"9":4},"b":{"0":[62],"1":[98,41],"2":[0],"3":[62,62],"4":[0,15],"5":[15,15],"6":[0,15],"7":[15,15],"8":[15],"9":[0,15],"10":[15,15],"11":[0],"12":[0,15],"13":[15,15],"14":[0,15],"15":[15,15],"16":[15],"17":[0,15],"18":[15,15],"19":[0],"20":[0],"21":[0,0],"22":[0,15],"23":[15,15],"24":[15,0],"25":[15,15],"26":[0,15],"27":[15,15],"28":[1],"29":[14],"30":[4],"31":[1],"32":[3],"33":[13,3,11,2],"34":[10,0],"35":[0],"36":[66,9],"37":[66,0],"38":[66,66],"39":[0,12],"40":[12,12],"41":[12],"42":[5,61],"43":[66,66],"44":[42,24],"45":[66,66],"46":[5],"47":[66],"48":[0],"49":[2],"50":[2],"51":[2,0],"52":[2,2],"53":[2,0],"54":[2,2]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/graphql.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/graphql.ts","statementMap":{"0":{"start":{"line":36,"column":0},"end":{"line":36,"column":16}},"1":{"start":{"line":43,"column":0},"end":{"line":43,"column":16}},"2":{"start":{"line":50,"column":0},"end":{"line":50,"column":16}},"3":{"start":{"line":54,"column":0},"end":{"line":54,"column":16}},"4":{"start":{"line":58,"column":0},"end":{"line":58,"column":16}},"5":{"start":{"line":62,"column":0},"end":{"line":62,"column":16}},"6":{"start":{"line":79,"column":0},"end":{"line":79,"column":16}},"7":{"start":{"line":158,"column":0},"end":{"line":158,"column":16}},"8":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"9":{"start":{"line":23,"column":0},"end":{"line":23,"column":46}},"10":{"start":{"line":24,"column":0},"end":{"line":24,"column":58}},"11":{"start":{"line":25,"column":0},"end":{"line":25,"column":124}},"12":{"start":{"line":26,"column":0},"end":{"line":26,"column":84}},"13":{"start":{"line":30,"column":4},"end":{"line":30,"column":71}},"14":{"start":{"line":30,"column":42},"end":{"line":30,"column":55}},"15":{"start":{"line":29,"column":21},"end":{"line":29,"column":62}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":47}},"17":{"start":{"line":28,"column":0},"end":{"line":28,"column":13}},"18":{"start":{"line":37,"column":17},"end":{"line":37,"column":38}},"19":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"20":{"start":{"line":39,"column":4},"end":{"line":39,"column":51}},"21":{"start":{"line":44,"column":17},"end":{"line":44,"column":39}},"22":{"start":{"line":45,"column":2},"end":{"line":47,"column":3}},"23":{"start":{"line":46,"column":4},"end":{"line":46,"column":51}},"24":{"start":{"line":51,"column":2},"end":{"line":51,"column":66}},"25":{"start":{"line":55,"column":2},"end":{"line":55,"column":32}},"26":{"start":{"line":59,"column":2},"end":{"line":59,"column":31}},"27":{"start":{"line":63,"column":2},"end":{"line":63,"column":null}},"28":{"start":{"line":63,"column":19},"end":{"line":63,"column":null}},"29":{"start":{"line":65,"column":2},"end":{"line":69,"column":3}},"30":{"start":{"line":66,"column":4},"end":{"line":68,"column":5}},"31":{"start":{"line":67,"column":6},"end":{"line":67,"column":null}},"32":{"start":{"line":71,"column":2},"end":{"line":71,"column":null}},"33":{"start":{"line":74,"column":33},"end":{"line":77,"column":2}},"34":{"start":{"line":83,"column":2},"end":{"line":85,"column":3}},"35":{"start":{"line":84,"column":4},"end":{"line":84,"column":null}},"36":{"start":{"line":87,"column":2},"end":{"line":106,"column":5}},"37":{"start":{"line":90,"column":8},"end":{"line":92,"column":9}},"38":{"start":{"line":91,"column":10},"end":{"line":91,"column":null}},"39":{"start":{"line":93,"column":8},"end":{"line":93,"column":null}},"40":{"start":{"line":98,"column":8},"end":{"line":98,"column":null}},"41":{"start":{"line":103,"column":8},"end":{"line":103,"column":null}},"42":{"start":{"line":110,"column":27},"end":{"line":111,"column":null}},"43":{"start":{"line":111,"column":4},"end":{"line":111,"column":92}},"44":{"start":{"line":114,"column":2},"end":{"line":121,"column":3}},"45":{"start":{"line":115,"column":4},"end":{"line":115,"column":null}},"46":{"start":{"line":117,"column":4},"end":{"line":120,"column":6}},"47":{"start":{"line":125,"column":2},"end":{"line":133,"column":3}},"48":{"start":{"line":126,"column":4},"end":{"line":130,"column":null}},"49":{"start":{"line":132,"column":4},"end":{"line":132,"column":16}},"50":{"start":{"line":137,"column":68},"end":{"line":140,"column":null}},"51":{"start":{"line":142,"column":2},"end":{"line":146,"column":3}},"52":{"start":{"line":143,"column":4},"end":{"line":145,"column":5}},"53":{"start":{"line":144,"column":6},"end":{"line":144,"column":null}},"54":{"start":{"line":148,"column":2},"end":{"line":148,"column":null}},"55":{"start":{"line":163,"column":2},"end":{"line":168,"column":3}},"56":{"start":{"line":167,"column":4},"end":{"line":167,"column":30}},"57":{"start":{"line":169,"column":2},"end":{"line":171,"column":3}},"58":{"start":{"line":170,"column":4},"end":{"line":170,"column":28}},"59":{"start":{"line":172,"column":2},"end":{"line":179,"column":3}},"60":{"start":{"line":178,"column":4},"end":{"line":178,"column":32}},"61":{"start":{"line":180,"column":2},"end":{"line":182,"column":3}},"62":{"start":{"line":181,"column":4},"end":{"line":181,"column":45}},"63":{"start":{"line":184,"column":2},"end":{"line":184,"column":19}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":29,"column":2},"end":{"line":29,"column":21}},"loc":{"start":{"line":29,"column":62},"end":{"line":33,"column":3}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":30,"column":31},"end":{"line":30,"column":32}},"loc":{"start":{"line":30,"column":42},"end":{"line":30,"column":55}}},"2":{"name":"assertValidSDL","decl":{"start":{"line":36,"column":16},"end":{"line":36,"column":30}},"loc":{"start":{"line":36,"column":53},"end":{"line":41,"column":1}}},"3":{"name":"assertValidSchema","decl":{"start":{"line":43,"column":16},"end":{"line":43,"column":33}},"loc":{"start":{"line":43,"column":55},"end":{"line":48,"column":1}}},"4":{"name":"sourceAt","decl":{"start":{"line":50,"column":16},"end":{"line":50,"column":24}},"loc":{"start":{"line":50,"column":43},"end":{"line":52,"column":1}}},"5":{"name":"filePathForNode","decl":{"start":{"line":54,"column":16},"end":{"line":54,"column":31}},"loc":{"start":{"line":54,"column":45},"end":{"line":56,"column":1}}},"6":{"name":"isMetaFieldName","decl":{"start":{"line":58,"column":16},"end":{"line":58,"column":31}},"loc":{"start":{"line":58,"column":44},"end":{"line":60,"column":1}}},"7":{"name":"containsLocalCacheMutationDirective","decl":{"start":{"line":62,"column":16},"end":{"line":62,"column":51}},"loc":{"start":{"line":62,"column":100},"end":{"line":72,"column":1}}},"8":{"name":"transformToNetworkRequestSourceDefinition","decl":{"start":{"line":79,"column":16},"end":{"line":79,"column":57}},"loc":{"start":{"line":81,"column":48},"end":{"line":107,"column":1}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":89,"column":6},"end":{"line":89,"column":11}},"loc":{"start":{"line":89,"column":45},"end":{"line":94,"column":7}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":97,"column":6},"end":{"line":97,"column":11}},"loc":{"start":{"line":97,"column":27},"end":{"line":99,"column":7}}},"11":{"name":"(anonymous_11)","decl":{"start":{"line":102,"column":6},"end":{"line":102,"column":11}},"loc":{"start":{"line":102,"column":31},"end":{"line":104,"column":7}}},"12":{"name":"addTypenameFieldToSelectionSetIfNeeded","decl":{"start":{"line":109,"column":9},"end":{"line":109,"column":47}},"loc":{"start":{"line":109,"column":70},"end":{"line":122,"column":1}}},"13":{"name":"(anonymous_13)","decl":{"start":{"line":110,"column":48},"end":{"line":110,"column":49}},"loc":{"start":{"line":111,"column":4},"end":{"line":111,"column":92}}},"14":{"name":"transformTypenameFieldIfNeeded","decl":{"start":{"line":124,"column":9},"end":{"line":124,"column":39}},"loc":{"start":{"line":124,"column":55},"end":{"line":134,"column":1}}},"15":{"name":"stripApolloClientSpecificDirectives","decl":{"start":{"line":136,"column":9},"end":{"line":136,"column":44}},"loc":{"start":{"line":136,"column":64},"end":{"line":149,"column":1}}},"16":{"name":"getFieldDef","decl":{"start":{"line":158,"column":16},"end":{"line":158,"column":27}},"loc":{"start":{"line":161,"column":19},"end":{"line":185,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"type":"if","locations":[{"start":{"line":38,"column":2},"end":{"line":40,"column":3}}]},"1":{"loc":{"start":{"line":45,"column":2},"end":{"line":47,"column":3}},"type":"if","locations":[{"start":{"line":45,"column":2},"end":{"line":47,"column":3}}]},"2":{"loc":{"start":{"line":55,"column":9},"end":{"line":55,"column":31}},"type":"cond-expr","locations":[{"start":{"line":55,"column":25},"end":{"line":55,"column":27}},{"start":{"line":55,"column":25},"end":{"line":55,"column":31}}]},"3":{"loc":{"start":{"line":55,"column":9},"end":{"line":55,"column":27}},"type":"binary-expr","locations":[{"start":{"line":55,"column":9},"end":{"line":55,"column":27}},{"start":{"line":55,"column":25},"end":{"line":55,"column":27}}]},"4":{"loc":{"start":{"line":55,"column":9},"end":{"line":55,"column":25}},"type":"cond-expr","locations":[{"start":{"line":55,"column":17},"end":{"line":55,"column":19}},{"start":{"line":55,"column":17},"end":{"line":55,"column":25}}]},"5":{"loc":{"start":{"line":55,"column":9},"end":{"line":55,"column":19}},"type":"binary-expr","locations":[{"start":{"line":55,"column":9},"end":{"line":55,"column":19}},{"start":{"line":55,"column":17},"end":{"line":55,"column":19}}]},"6":{"loc":{"start":{"line":63,"column":2},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":63,"column":2},"end":{"line":63,"column":null}}]},"7":{"loc":{"start":{"line":66,"column":4},"end":{"line":68,"column":5}},"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":68,"column":5}}]},"8":{"loc":{"start":{"line":83,"column":2},"end":{"line":85,"column":3}},"type":"if","locations":[{"start":{"line":83,"column":2},"end":{"line":85,"column":3}}]},"9":{"loc":{"start":{"line":90,"column":8},"end":{"line":92,"column":9}},"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":92,"column":9}}]},"10":{"loc":{"start":{"line":90,"column":12},"end":{"line":90,"column":91}},"type":"binary-expr","locations":[{"start":{"line":90,"column":12},"end":{"line":90,"column":26}},{"start":{"line":90,"column":30},"end":{"line":90,"column":91}}]},"11":{"loc":{"start":{"line":111,"column":4},"end":{"line":111,"column":92}},"type":"binary-expr","locations":[{"start":{"line":111,"column":4},"end":{"line":111,"column":40}},{"start":{"line":111,"column":44},"end":{"line":111,"column":92}}]},"12":{"loc":{"start":{"line":114,"column":2},"end":{"line":121,"column":3}},"type":"if","locations":[{"start":{"line":114,"column":2},"end":{"line":121,"column":3}},{"start":{"line":116,"column":9},"end":{"line":121,"column":3}}]},"13":{"loc":{"start":{"line":125,"column":2},"end":{"line":133,"column":3}},"type":"if","locations":[{"start":{"line":125,"column":2},"end":{"line":133,"column":3}},{"start":{"line":131,"column":9},"end":{"line":133,"column":3}}]},"14":{"loc":{"start":{"line":143,"column":4},"end":{"line":145,"column":5}},"type":"if","locations":[{"start":{"line":143,"column":4},"end":{"line":145,"column":5}}]},"15":{"loc":{"start":{"line":163,"column":2},"end":{"line":168,"column":3}},"type":"if","locations":[{"start":{"line":163,"column":2},"end":{"line":168,"column":3}}]},"16":{"loc":{"start":{"line":164,"column":4},"end":{"line":165,"column":40}},"type":"binary-expr","locations":[{"start":{"line":164,"column":4},"end":{"line":164,"column":41}},{"start":{"line":165,"column":4},"end":{"line":165,"column":40}}]},"17":{"loc":{"start":{"line":169,"column":2},"end":{"line":171,"column":3}},"type":"if","locations":[{"start":{"line":169,"column":2},"end":{"line":171,"column":3}}]},"18":{"loc":{"start":{"line":169,"column":6},"end":{"line":169,"column":81}},"type":"binary-expr","locations":[{"start":{"line":169,"column":6},"end":{"line":169,"column":41}},{"start":{"line":169,"column":45},"end":{"line":169,"column":81}}]},"19":{"loc":{"start":{"line":172,"column":2},"end":{"line":179,"column":3}},"type":"if","locations":[{"start":{"line":172,"column":2},"end":{"line":179,"column":3}}]},"20":{"loc":{"start":{"line":173,"column":4},"end":{"line":176,"column":30}},"type":"binary-expr","locations":[{"start":{"line":173,"column":4},"end":{"line":173,"column":43}},{"start":{"line":174,"column":5},"end":{"line":174,"column":29}},{"start":{"line":175,"column":6},"end":{"line":175,"column":33}},{"start":{"line":176,"column":6},"end":{"line":176,"column":29}}]},"21":{"loc":{"start":{"line":180,"column":2},"end":{"line":182,"column":3}},"type":"if","locations":[{"start":{"line":180,"column":2},"end":{"line":182,"column":3}}]},"22":{"loc":{"start":{"line":180,"column":6},"end":{"line":180,"column":61}},"type":"binary-expr","locations":[{"start":{"line":180,"column":6},"end":{"line":180,"column":30}},{"start":{"line":180,"column":34},"end":{"line":180,"column":61}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":0,"14":0,"15":0,"16":0,"17":1,"18":12,"19":12,"20":0,"21":7,"22":7,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":1,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0},"f":{"0":0,"1":0,"2":12,"3":7,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0},"b":{"0":[0],"1":[0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0],"7":[0],"8":[0],"9":[0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0],"15":[0],"16":[0,0],"17":[0],"18":[0,0],"19":[0],"20":[0,0,0,0],"21":[0],"22":[0,0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/index.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/index.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":47}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":30}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1},"f":{},"b":{}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/legacySafelistingTransform.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/legacySafelistingTransform.ts","statementMap":{"0":{"start":{"line":14,"column":0},"end":{"line":14,"column":16}},"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"2":{"start":{"line":9,"column":22},"end":{"line":12,"column":2}},"3":{"start":{"line":15,"column":2},"end":{"line":54,"column":5}},"4":{"start":{"line":17,"column":6},"end":{"line":32,"column":7}},"5":{"start":{"line":20,"column":8},"end":{"line":20,"column":25}},"6":{"start":{"line":22,"column":8},"end":{"line":31,"column":10}},"7":{"start":{"line":26,"column":14},"end":{"line":28,"column":null}},"8":{"start":{"line":35,"column":6},"end":{"line":43,"column":7}},"9":{"start":{"line":42,"column":8},"end":{"line":42,"column":25}},"10":{"start":{"line":44,"column":6},"end":{"line":44,"column":47}},"11":{"start":{"line":44,"column":30},"end":{"line":44,"column":47}},"12":{"start":{"line":46,"column":6},"end":{"line":52,"column":8}}},"fnMap":{"0":{"name":"addTypeNameFieldForLegacySafelisting","decl":{"start":{"line":14,"column":16},"end":{"line":14,"column":52}},"loc":{"start":{"line":14,"column":65},"end":{"line":55,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":16,"column":4},"end":{"line":16,"column":9}},"loc":{"start":{"line":16,"column":23},"end":{"line":33,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":25,"column":12},"end":{"line":25,"column":13}},"loc":{"start":{"line":26,"column":14},"end":{"line":28,"column":null}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":34,"column":4},"end":{"line":34,"column":9}},"loc":{"start":{"line":34,"column":23},"end":{"line":53,"column":5}}}},"branchMap":{"0":{"loc":{"start":{"line":17,"column":6},"end":{"line":32,"column":7}},"type":"if","locations":[{"start":{"line":17,"column":6},"end":{"line":32,"column":7}},{"start":{"line":21,"column":13},"end":{"line":32,"column":7}}]},"1":{"loc":{"start":{"line":27,"column":16},"end":{"line":28,"column":68}},"type":"binary-expr","locations":[{"start":{"line":27,"column":16},"end":{"line":27,"column":42}},{"start":{"line":28,"column":17},"end":{"line":28,"column":68}}]},"2":{"loc":{"start":{"line":35,"column":6},"end":{"line":43,"column":7}},"type":"if","locations":[{"start":{"line":35,"column":6},"end":{"line":43,"column":7}}]},"3":{"loc":{"start":{"line":37,"column":10},"end":{"line":39,"column":44}},"type":"binary-expr","locations":[{"start":{"line":37,"column":10},"end":{"line":37,"column":34}},{"start":{"line":38,"column":10},"end":{"line":38,"column":48}},{"start":{"line":39,"column":10},"end":{"line":39,"column":44}}]},"4":{"loc":{"start":{"line":44,"column":6},"end":{"line":44,"column":47}},"type":"if","locations":[{"start":{"line":44,"column":6},"end":{"line":44,"column":47}}]}},"s":{"0":1,"1":1,"2":1,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0},"f":{"0":0,"1":0,"2":0,"3":0},"b":{"0":[0,0],"1":[0,0],"2":[0],"3":[0,0,0],"4":[0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/nodeHelpers.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/nodeHelpers.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}},"1":{"start":{"line":10,"column":0},"end":{"line":10,"column":16}},"2":{"start":{"line":17,"column":0},"end":{"line":17,"column":16}},"3":{"start":{"line":26,"column":0},"end":{"line":26,"column":16}},"4":{"start":{"line":37,"column":0},"end":{"line":37,"column":16}},"5":{"start":{"line":44,"column":0},"end":{"line":44,"column":16}},"6":{"start":{"line":1,"column":0},"end":{"line":1,"column":206}},"7":{"start":{"line":4,"column":2},"end":{"line":7,"column":null}},"8":{"start":{"line":11,"column":2},"end":{"line":14,"column":null}},"9":{"start":{"line":18,"column":2},"end":{"line":23,"column":null}},"10":{"start":{"line":27,"column":2},"end":{"line":34,"column":null}},"11":{"start":{"line":32,"column":47},"end":{"line":32,"column":60}},"12":{"start":{"line":33,"column":42},"end":{"line":33,"column":71}},"13":{"start":{"line":38,"column":2},"end":{"line":41,"column":null}},"14":{"start":{"line":45,"column":2},"end":{"line":48,"column":null}}},"fnMap":{"0":{"name":"nameNode","decl":{"start":{"line":3,"column":16},"end":{"line":3,"column":24}},"loc":{"start":{"line":3,"column":37},"end":{"line":8,"column":1}}},"1":{"name":"stringNode","decl":{"start":{"line":10,"column":16},"end":{"line":10,"column":26}},"loc":{"start":{"line":10,"column":40},"end":{"line":15,"column":1}}},"2":{"name":"inputValueDefinitionNode","decl":{"start":{"line":17,"column":16},"end":{"line":17,"column":40}},"loc":{"start":{"line":17,"column":61},"end":{"line":24,"column":1}}},"3":{"name":"definitionNode","decl":{"start":{"line":26,"column":16},"end":{"line":26,"column":30}},"loc":{"start":{"line":26,"column":59},"end":{"line":35,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":32,"column":40},"end":{"line":32,"column":43}},"loc":{"start":{"line":32,"column":47},"end":{"line":32,"column":60}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":33,"column":35},"end":{"line":33,"column":38}},"loc":{"start":{"line":33,"column":42},"end":{"line":33,"column":71}}},"6":{"name":"typeNode","decl":{"start":{"line":37,"column":16},"end":{"line":37,"column":24}},"loc":{"start":{"line":37,"column":47},"end":{"line":42,"column":1}}},"7":{"name":"nonNullNode","decl":{"start":{"line":44,"column":16},"end":{"line":44,"column":27}},"loc":{"start":{"line":44,"column":62},"end":{"line":49,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":17},"end":{"line":29,"column":88}},"type":"cond-expr","locations":[{"start":{"line":29,"column":42},"end":{"line":29,"column":76}},{"start":{"line":29,"column":79},"end":{"line":29,"column":88}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":108,"8":44,"9":24,"10":12,"11":24,"12":24,"13":28,"14":4},"f":{"0":108,"1":44,"2":24,"3":12,"4":24,"5":24,"6":28,"7":4},"b":{"0":[12,0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/predicates.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/predicates.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}},"1":{"start":{"line":7,"column":0},"end":{"line":7,"column":16}},"2":{"start":{"line":4,"column":2},"end":{"line":4,"column":56}},"3":{"start":{"line":8,"column":2},"end":{"line":13,"column":4}}},"fnMap":{"0":{"name":"isNotNullOrUndefined","decl":{"start":{"line":1,"column":16},"end":{"line":1,"column":36}},"loc":{"start":{"line":2,"column":29},"end":{"line":5,"column":1}}},"1":{"name":"isObject","decl":{"start":{"line":7,"column":16},"end":{"line":7,"column":24}},"loc":{"start":{"line":7,"column":35},"end":{"line":14,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":55}},"type":"binary-expr","locations":[{"start":{"line":4,"column":9},"end":{"line":4,"column":23}},{"start":{"line":4,"column":27},"end":{"line":4,"column":55}}]},"1":{"loc":{"start":{"line":9,"column":4},"end":{"line":12,"column":25}},"type":"binary-expr","locations":[{"start":{"line":9,"column":4},"end":{"line":9,"column":23}},{"start":{"line":10,"column":4},"end":{"line":10,"column":18}},{"start":{"line":11,"column":4},"end":{"line":11,"column":29}},{"start":{"line":12,"column":4},"end":{"line":12,"column":25}}]}},"s":{"0":1,"1":1,"2":0,"3":0},"f":{"0":0,"1":0},"b":{"0":[0,0],"1":[0,0,0,0]}} +,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/typePolicyDirective.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/typePolicyDirective.ts","statementMap":{"0":{"start":{"line":147,"column":0},"end":{"line":147,"column":16}},"1":{"start":{"line":167,"column":0},"end":{"line":167,"column":16}},"2":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"3":{"start":{"line":15,"column":0},"end":{"line":15,"column":70}},"4":{"start":{"line":17,"column":22},"end":{"line":17,"column":53}},"5":{"start":{"line":28,"column":2},"end":{"line":41,"column":4}},"6":{"start":{"line":31,"column":8},"end":{"line":31,"column":74}},"7":{"start":{"line":37,"column":8},"end":{"line":37,"column":74}},"8":{"start":{"line":47,"column":2},"end":{"line":49,"column":3}},"9":{"start":{"line":48,"column":4},"end":{"line":48,"column":21}},"10":{"start":{"line":51,"column":2},"end":{"line":58,"column":3}},"11":{"start":{"line":52,"column":22},"end":{"line":53,"column":null}},"12":{"start":{"line":53,"column":13},"end":{"line":53,"column":43}},"13":{"start":{"line":55,"column":4},"end":{"line":57,"column":5}},"14":{"start":{"line":56,"column":6},"end":{"line":56,"column":41}},"15":{"start":{"line":61,"column":2},"end":{"line":66,"column":3}},"16":{"start":{"line":62,"column":4},"end":{"line":65,"column":5}},"17":{"start":{"line":63,"column":6},"end":{"line":63,"column":43}},"18":{"start":{"line":64,"column":6},"end":{"line":64,"column":12}},"19":{"start":{"line":68,"column":2},"end":{"line":89,"column":3}},"20":{"start":{"line":69,"column":4},"end":{"line":88,"column":5}},"21":{"start":{"line":70,"column":20},"end":{"line":70,"column":57}},"22":{"start":{"line":71,"column":6},"end":{"line":71,"column":27}},"23":{"start":{"line":71,"column":18},"end":{"line":71,"column":27}},"24":{"start":{"line":73,"column":6},"end":{"line":87,"column":7}},"25":{"start":{"line":74,"column":8},"end":{"line":74,"column":23}},"26":{"start":{"line":75,"column":13},"end":{"line":87,"column":7}},"27":{"start":{"line":76,"column":8},"end":{"line":86,"column":9}},"28":{"start":{"line":77,"column":10},"end":{"line":80,"column":12}},"29":{"start":{"line":82,"column":10},"end":{"line":85,"column":12}},"30":{"start":{"line":91,"column":2},"end":{"line":91,"column":16}},"31":{"start":{"line":98,"column":38},"end":{"line":98,"column":44}},"32":{"start":{"line":100,"column":2},"end":{"line":102,"column":3}},"33":{"start":{"line":101,"column":4},"end":{"line":101,"column":11}},"34":{"start":{"line":104,"column":16},"end":{"line":104,"column":62}},"35":{"start":{"line":106,"column":18},"end":{"line":106,"column":34}},"36":{"start":{"line":107,"column":2},"end":{"line":144,"column":3}},"37":{"start":{"line":108,"column":4},"end":{"line":113,"column":5}},"38":{"start":{"line":109,"column":6},"end":{"line":112,"column":8}},"39":{"start":{"line":115,"column":24},"end":{"line":115,"column":43}},"40":{"start":{"line":116,"column":4},"end":{"line":121,"column":5}},"41":{"start":{"line":117,"column":6},"end":{"line":120,"column":8}},"42":{"start":{"line":123,"column":4},"end":{"line":132,"column":5}},"43":{"start":{"line":124,"column":6},"end":{"line":131,"column":8}},"44":{"start":{"line":134,"column":4},"end":{"line":143,"column":5}},"45":{"start":{"line":135,"column":6},"end":{"line":142,"column":8}},"46":{"start":{"line":148,"column":17},"end":{"line":148,"column":45}},"47":{"start":{"line":149,"column":2},"end":{"line":151,"column":3}},"48":{"start":{"line":150,"column":4},"end":{"line":150,"column":14}},"49":{"start":{"line":153,"column":24},"end":{"line":155,"column":10}},"50":{"start":{"line":154,"column":11},"end":{"line":154,"column":39}},"51":{"start":{"line":156,"column":2},"end":{"line":158,"column":3}},"52":{"start":{"line":157,"column":4},"end":{"line":157,"column":14}},"53":{"start":{"line":160,"column":17},"end":{"line":160,"column":47}},"54":{"start":{"line":162,"column":2},"end":{"line":162,"column":36}},"55":{"start":{"line":164,"column":2},"end":{"line":164,"column":16}},"56":{"start":{"line":168,"column":16},"end":{"line":168,"column":35}},"57":{"start":{"line":170,"column":2},"end":{"line":176,"column":3}},"58":{"start":{"line":171,"column":17},"end":{"line":171,"column":27}},"59":{"start":{"line":173,"column":4},"end":{"line":175,"column":5}},"60":{"start":{"line":174,"column":7},"end":{"line":174,"column":58}}},"fnMap":{"0":{"name":"matchDirectiveArguments","decl":{"start":{"line":24,"column":9},"end":{"line":24,"column":32}},"loc":{"start":{"line":26,"column":23},"end":{"line":42,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":30,"column":11},"end":{"line":30,"column":12}},"loc":{"start":{"line":31,"column":8},"end":{"line":31,"column":74}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":36,"column":11},"end":{"line":36,"column":12}},"loc":{"start":{"line":37,"column":8},"end":{"line":37,"column":74}}},"3":{"name":"typePolicyDirectiveFor","decl":{"start":{"line":44,"column":9},"end":{"line":44,"column":31}},"loc":{"start":{"line":45,"column":28},"end":{"line":92,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":53,"column":6},"end":{"line":53,"column":7}},"loc":{"start":{"line":53,"column":13},"end":{"line":53,"column":43}}},"5":{"name":"validateKeyFields","decl":{"start":{"line":94,"column":9},"end":{"line":94,"column":26}},"loc":{"start":{"line":96,"column":21},"end":{"line":145,"column":1}}},"6":{"name":"keyFieldsFor","decl":{"start":{"line":147,"column":16},"end":{"line":147,"column":28}},"loc":{"start":{"line":147,"column":55},"end":{"line":165,"column":1}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":154,"column":4},"end":{"line":154,"column":5}},"loc":{"start":{"line":154,"column":11},"end":{"line":154,"column":39}}},"8":{"name":"addTypePolicyDirectivesToSchema","decl":{"start":{"line":167,"column":16},"end":{"line":167,"column":47}},"loc":{"start":{"line":167,"column":69},"end":{"line":177,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":5},"end":{"line":29,"column":26}},"type":"cond-expr","locations":[{"start":{"line":29,"column":20},"end":{"line":29,"column":24}},{"start":{"line":29,"column":24},"end":{"line":29,"column":26}}]},"1":{"loc":{"start":{"line":29,"column":5},"end":{"line":29,"column":24}},"type":"binary-expr","locations":[{"start":{"line":29,"column":5},"end":{"line":29,"column":24}},{"start":{"line":29,"column":20},"end":{"line":29,"column":24}}]},"2":{"loc":{"start":{"line":35,"column":5},"end":{"line":35,"column":27}},"type":"cond-expr","locations":[{"start":{"line":35,"column":21},"end":{"line":35,"column":25}},{"start":{"line":35,"column":25},"end":{"line":35,"column":27}}]},"3":{"loc":{"start":{"line":35,"column":5},"end":{"line":35,"column":25}},"type":"binary-expr","locations":[{"start":{"line":35,"column":5},"end":{"line":35,"column":25}},{"start":{"line":35,"column":21},"end":{"line":35,"column":25}}]},"4":{"loc":{"start":{"line":47,"column":2},"end":{"line":49,"column":3}},"type":"if","locations":[{"start":{"line":47,"column":2},"end":{"line":49,"column":3}}]},"5":{"loc":{"start":{"line":51,"column":26},"end":{"line":51,"column":54}},"type":"cond-expr","locations":[{"start":{"line":51,"column":48},"end":{"line":51,"column":52}},{"start":{"line":51,"column":52},"end":{"line":51,"column":54}}]},"6":{"loc":{"start":{"line":51,"column":26},"end":{"line":51,"column":52}},"type":"binary-expr","locations":[{"start":{"line":51,"column":26},"end":{"line":51,"column":52}},{"start":{"line":51,"column":48},"end":{"line":51,"column":52}}]},"7":{"loc":{"start":{"line":52,"column":22},"end":{"line":53,"column":null}},"type":"cond-expr","locations":[{"start":{"line":52,"column":42},"end":{"line":52,"column":44}},{"start":{"line":52,"column":42},"end":{"line":53,"column":null}}]},"8":{"loc":{"start":{"line":52,"column":22},"end":{"line":52,"column":44}},"type":"binary-expr","locations":[{"start":{"line":52,"column":22},"end":{"line":52,"column":44}},{"start":{"line":52,"column":42},"end":{"line":52,"column":44}}]},"9":{"loc":{"start":{"line":55,"column":4},"end":{"line":57,"column":5}},"type":"if","locations":[{"start":{"line":55,"column":4},"end":{"line":57,"column":5}}]},"10":{"loc":{"start":{"line":61,"column":26},"end":{"line":61,"column":56}},"type":"cond-expr","locations":[{"start":{"line":61,"column":50},"end":{"line":61,"column":54}},{"start":{"line":61,"column":54},"end":{"line":61,"column":56}}]},"11":{"loc":{"start":{"line":61,"column":26},"end":{"line":61,"column":54}},"type":"binary-expr","locations":[{"start":{"line":61,"column":26},"end":{"line":61,"column":54}},{"start":{"line":61,"column":50},"end":{"line":61,"column":54}}]},"12":{"loc":{"start":{"line":61,"column":26},"end":{"line":61,"column":50}},"type":"cond-expr","locations":[{"start":{"line":61,"column":38},"end":{"line":61,"column":40}},{"start":{"line":61,"column":38},"end":{"line":61,"column":50}}]},"13":{"loc":{"start":{"line":61,"column":26},"end":{"line":61,"column":40}},"type":"binary-expr","locations":[{"start":{"line":61,"column":26},"end":{"line":61,"column":40}},{"start":{"line":61,"column":38},"end":{"line":61,"column":40}}]},"14":{"loc":{"start":{"line":62,"column":4},"end":{"line":65,"column":5}},"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":65,"column":5}}]},"15":{"loc":{"start":{"line":68,"column":2},"end":{"line":89,"column":3}},"type":"if","locations":[{"start":{"line":68,"column":2},"end":{"line":89,"column":3}}]},"16":{"loc":{"start":{"line":71,"column":6},"end":{"line":71,"column":27}},"type":"if","locations":[{"start":{"line":71,"column":6},"end":{"line":71,"column":27}}]},"17":{"loc":{"start":{"line":73,"column":6},"end":{"line":87,"column":7}},"type":"if","locations":[{"start":{"line":73,"column":6},"end":{"line":87,"column":7}},{"start":{"line":75,"column":13},"end":{"line":87,"column":7}}]},"18":{"loc":{"start":{"line":75,"column":13},"end":{"line":87,"column":7}},"type":"if","locations":[{"start":{"line":75,"column":13},"end":{"line":87,"column":7}}]},"19":{"loc":{"start":{"line":76,"column":8},"end":{"line":86,"column":9}},"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":86,"column":9}},{"start":{"line":81,"column":15},"end":{"line":86,"column":9}}]},"20":{"loc":{"start":{"line":100,"column":2},"end":{"line":102,"column":3}},"type":"if","locations":[{"start":{"line":100,"column":2},"end":{"line":102,"column":3}}]},"21":{"loc":{"start":{"line":104,"column":16},"end":{"line":104,"column":62}},"type":"cond-expr","locations":[{"start":{"line":104,"column":40},"end":{"line":104,"column":51}},{"start":{"line":104,"column":54},"end":{"line":104,"column":62}}]},"22":{"loc":{"start":{"line":108,"column":4},"end":{"line":113,"column":5}},"type":"if","locations":[{"start":{"line":108,"column":4},"end":{"line":113,"column":5}}]},"23":{"loc":{"start":{"line":116,"column":4},"end":{"line":121,"column":5}},"type":"if","locations":[{"start":{"line":116,"column":4},"end":{"line":121,"column":5}}]},"24":{"loc":{"start":{"line":119,"column":17},"end":{"line":119,"column":69}},"type":"cond-expr","locations":[{"start":{"line":119,"column":32},"end":{"line":119,"column":57}},{"start":{"line":119,"column":60},"end":{"line":119,"column":69}}]},"25":{"loc":{"start":{"line":123,"column":4},"end":{"line":132,"column":5}},"type":"if","locations":[{"start":{"line":123,"column":4},"end":{"line":132,"column":5}}]},"26":{"loc":{"start":{"line":127,"column":17},"end":{"line":129,"column":23}},"type":"cond-expr","locations":[{"start":{"line":128,"column":14},"end":{"line":128,"column":46}},{"start":{"line":129,"column":14},"end":{"line":129,"column":23}}]},"27":{"loc":{"start":{"line":134,"column":4},"end":{"line":143,"column":5}},"type":"if","locations":[{"start":{"line":134,"column":4},"end":{"line":143,"column":5}}]},"28":{"loc":{"start":{"line":138,"column":17},"end":{"line":140,"column":23}},"type":"cond-expr","locations":[{"start":{"line":139,"column":14},"end":{"line":139,"column":46}},{"start":{"line":140,"column":14},"end":{"line":140,"column":23}}]},"29":{"loc":{"start":{"line":149,"column":2},"end":{"line":151,"column":3}},"type":"if","locations":[{"start":{"line":149,"column":2},"end":{"line":151,"column":3}}]},"30":{"loc":{"start":{"line":153,"column":24},"end":{"line":155,"column":10}},"type":"cond-expr","locations":[{"start":{"line":155,"column":3},"end":{"line":155,"column":5}},{"start":{"line":155,"column":3},"end":{"line":155,"column":10}}]},"31":{"loc":{"start":{"line":153,"column":24},"end":{"line":155,"column":5}},"type":"binary-expr","locations":[{"start":{"line":153,"column":24},"end":{"line":155,"column":5}},{"start":{"line":155,"column":3},"end":{"line":155,"column":5}}]},"32":{"loc":{"start":{"line":153,"column":24},"end":{"line":154,"column":null}},"type":"cond-expr","locations":[{"start":{"line":153,"column":51},"end":{"line":153,"column":53}},{"start":{"line":153,"column":51},"end":{"line":154,"column":null}}]},"33":{"loc":{"start":{"line":153,"column":24},"end":{"line":153,"column":53}},"type":"binary-expr","locations":[{"start":{"line":153,"column":24},"end":{"line":153,"column":53}},{"start":{"line":153,"column":51},"end":{"line":153,"column":53}}]},"34":{"loc":{"start":{"line":153,"column":24},"end":{"line":153,"column":51}},"type":"cond-expr","locations":[{"start":{"line":153,"column":40},"end":{"line":153,"column":42}},{"start":{"line":153,"column":40},"end":{"line":153,"column":51}}]},"35":{"loc":{"start":{"line":153,"column":24},"end":{"line":153,"column":42}},"type":"binary-expr","locations":[{"start":{"line":153,"column":24},"end":{"line":153,"column":42}},{"start":{"line":153,"column":40},"end":{"line":153,"column":42}}]},"36":{"loc":{"start":{"line":156,"column":2},"end":{"line":158,"column":3}},"type":"if","locations":[{"start":{"line":156,"column":2},"end":{"line":158,"column":3}}]},"37":{"loc":{"start":{"line":156,"column":6},"end":{"line":156,"column":58}},"type":"binary-expr","locations":[{"start":{"line":156,"column":6},"end":{"line":156,"column":20}},{"start":{"line":156,"column":24},"end":{"line":156,"column":58}}]},"38":{"loc":{"start":{"line":173,"column":4},"end":{"line":175,"column":5}},"type":"if","locations":[{"start":{"line":173,"column":4},"end":{"line":175,"column":5}}]},"39":{"loc":{"start":{"line":173,"column":8},"end":{"line":173,"column":81}},"type":"binary-expr","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":41}},{"start":{"line":173,"column":45},"end":{"line":173,"column":81}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":0,"6":0,"7":0,"8":101,"9":0,"10":101,"11":12,"12":12,"13":12,"14":0,"15":101,"16":5,"17":0,"18":0,"19":101,"20":101,"21":4,"22":4,"23":4,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":101,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":97,"47":97,"48":97,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":12,"57":12,"58":158,"59":158,"60":97},"f":{"0":0,"1":0,"2":0,"3":101,"4":12,"5":0,"6":97,"7":0,"8":12},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0],"5":[101,0],"6":[101,101],"7":[0,12],"8":[12,12],"9":[0],"10":[5,96],"11":[101,101],"12":[72,29],"13":[101,101],"14":[0],"15":[101],"16":[4],"17":[0,0],"18":[0],"19":[0,0],"20":[0],"21":[0,0],"22":[0],"23":[0],"24":[0,0],"25":[0],"26":[0,0],"27":[0],"28":[0,0],"29":[97],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0],"37":[0,0],"38":[97],"39":[158,66]}} +} diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/base.css b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/base.css new file mode 100644 index 000000000..f418035b4 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/base.css @@ -0,0 +1,224 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* yellow */ +.cbranch-no { background: yellow !important; color: #111; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +.highlighted, +.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ + background: #C21F39 !important; +} +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +.medium .chart { border:1px solid #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +span.cline-neutral { background: #eaeaea; } + +.coverage-summary td.empty { + opacity: .5; + padding-top: 4px; + padding-bottom: 4px; + line-height: 1; + color: #888; +} + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/block-navigation.js b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/block-navigation.js new file mode 100644 index 000000000..cc1213023 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/block-navigation.js @@ -0,0 +1,87 @@ +/* eslint-disable */ +var jumpToCode = (function init() { + // Classes of code we would like to highlight in the file view + var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; + + // Elements to highlight in the file listing view + var fileListingElements = ['td.pct.low']; + + // We don't want to select elements that are direct descendants of another match + var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` + + // Selecter that finds elements on the page to which we can jump + var selector = + fileListingElements.join(', ') + + ', ' + + notSelector + + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` + + // The NodeList of matching elements + var missingCoverageElements = document.querySelectorAll(selector); + + var currentIndex; + + function toggleClass(index) { + missingCoverageElements + .item(currentIndex) + .classList.remove('highlighted'); + missingCoverageElements.item(index).classList.add('highlighted'); + } + + function makeCurrent(index) { + toggleClass(index); + currentIndex = index; + missingCoverageElements.item(index).scrollIntoView({ + behavior: 'smooth', + block: 'center', + inline: 'center' + }); + } + + function goToPrevious() { + var nextIndex = 0; + if (typeof currentIndex !== 'number' || currentIndex === 0) { + nextIndex = missingCoverageElements.length - 1; + } else if (missingCoverageElements.length > 1) { + nextIndex = currentIndex - 1; + } + + makeCurrent(nextIndex); + } + + function goToNext() { + var nextIndex = 0; + + if ( + typeof currentIndex === 'number' && + currentIndex < missingCoverageElements.length - 1 + ) { + nextIndex = currentIndex + 1; + } + + makeCurrent(nextIndex); + } + + return function jump(event) { + if ( + document.getElementById('fileSearch') === document.activeElement && + document.activeElement != null + ) { + // if we're currently focused on the search input, we don't want to navigate + return; + } + + switch (event.which) { + case 78: // n + case 74: // j + goToNext(); + break; + case 66: // b + case 75: // k + case 80: // p + goToPrevious(); + break; + } + }; +})(); +window.addEventListener('keydown', jumpToCode); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/favicon.png b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..c1525b811a167671e9de1fa78aab9f5c0b61cef7 GIT binary patch literal 445 zcmV;u0Yd(XP))rP{nL}Ln%S7`m{0DjX9TLF* zFCb$4Oi7vyLOydb!7n&^ItCzb-%BoB`=x@N2jll2Nj`kauio%aw_@fe&*}LqlFT43 z8doAAe))z_%=P%v^@JHp3Hjhj^6*Kr_h|g_Gr?ZAa&y>wxHE99Gk>A)2MplWz2xdG zy8VD2J|Uf#EAw*bo5O*PO_}X2Tob{%bUoO2G~T`@%S6qPyc}VkhV}UifBuRk>%5v( z)x7B{I~z*k<7dv#5tC+m{km(D087J4O%+<<;K|qwefb6@GSX45wCK}Sn*> + + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+ +
+ 37.43% + Statements + 216/577 +
+ + +
+ 23% + Branches + 98/426 +
+ + +
+ 25.61% + Functions + 31/121 +
+ + +
+ 37.78% + Lines + 212/561 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
src +
+
42.99%46/1075.12%2/392.94%1/3442.45%45/106
src/compiler +
+
3.74%7/1870%0/1540%0/223.88%7/180
src/utilities +
+
57.59%163/28341.2%96/23346.15%30/6558.18%160/275
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.css b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.css new file mode 100644 index 000000000..b317a7cda --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.js b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.js new file mode 100644 index 000000000..b3225238f --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sort-arrow-sprite.png b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed68316eb3f65dec9063332d2f69bf3093bbfab GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qh}Z>jv*C{$p!i!8j}?a+@3A= zIAGwzjijN=FBi!|L1t?LM;Q;gkwn>2cAy-KV{dn nf0J1DIvEHQu*n~6U}x}qyky7vi4|9XhBJ7&`njxgN@xNA8m%nc literal 0 HcmV?d00001 diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sorter.js b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sorter.js new file mode 100644 index 000000000..2bb296a8c --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sorter.js @@ -0,0 +1,196 @@ +/* eslint-disable */ +var addSorting = (function() { + 'use strict'; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { + return document.querySelector('.coverage-summary'); + } + // returns the thead element of the summary table + function getTableHeader() { + return getTable().querySelector('thead tr'); + } + // returns the tbody element of the summary table + function getTableBody() { + return getTable().querySelector('tbody'); + } + // returns the th element for nth column + function getNthColumn(n) { + return getTableHeader().querySelectorAll('th')[n]; + } + + function onFilterInput() { + const searchValue = document.getElementById('fileSearch').value; + const rows = document.getElementsByTagName('tbody')[0].children; + for (let i = 0; i < rows.length; i++) { + const row = rows[i]; + if ( + row.textContent + .toLowerCase() + .includes(searchValue.toLowerCase()) + ) { + row.style.display = ''; + } else { + row.style.display = 'none'; + } + } + } + + // loads the search box + function addSearchBox() { + var template = document.getElementById('filterTemplate'); + var templateClone = template.content.cloneNode(true); + templateClone.getElementById('fileSearch').oninput = onFilterInput; + template.parentElement.appendChild(templateClone); + } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = + colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function(a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function(a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc + ? ' sorted-desc' + : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function() { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i = 0; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function() { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(); + addSearchBox(); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.html new file mode 100644 index 000000000..28089819f --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for src/compiler + + + + + + + + + +
+
+

All files src/compiler

+
+ +
+ 3.74% + Statements + 7/187 +
+ + +
+ 0% + Branches + 0/154 +
+ + +
+ 0% + Functions + 0/22 +
+ + +
+ 3.88% + Lines + 7/180 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.ts +
+
2.8%5/1780%0/1500%0/202.92%5/171
values.ts +
+
22.22%2/90%0/40%0/222.22%2/9
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.ts.html new file mode 100644 index 000000000..6416f4c8e --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.ts.html @@ -0,0 +1,1720 @@ + + + + + + Code coverage report for src/compiler/index.ts + + + + + + + + + +
+
+

All files / src/compiler index.ts

+
+ +
+ 2.8% + Statements + 5/178 +
+ + +
+ 0% + Branches + 0/150 +
+ + +
+ 0% + Functions + 0/20 +
+ + +
+ 2.92% + Lines + 5/171 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +5461x +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import {
+  containsLocalCacheMutationDirective,
+  getFieldDef,
+  isMetaFieldName,
+  isNotNullOrUndefined,
+  transformToNetworkRequestSourceDefinition,
+} from "../utilities";
+import {
+  ArgumentNode,
+  ASTNode,
+  DocumentNode,
+  DirectiveNode,
+  FragmentDefinitionNode,
+  getNamedType,
+  GraphQLArgument,
+  GraphQLCompositeType,
+  GraphQLDirective,
+  GraphQLError,
+  GraphQLField,
+  GraphQLInputObjectType,
+  GraphQLNamedType,
+  GraphQLObjectType,
+  GraphQLSchema,
+  GraphQLType,
+  isCompositeType,
+  isInputObjectType,
+  isUnionType,
+  Kind,
+  OperationDefinitionNode,
+  print,
+  SelectionNode,
+  SelectionSetNode,
+  typeFromAST,
+  isObjectType,
+  isInterfaceType,
+  isListType,
+  isNonNullType,
+  FieldNode,
+} from "graphql";
+import * as ir from "./ir";
+import { valueFromValueNode } from "./values";
+import { ValidationOptions } from "../validationRules";
+import { directive_typePolicy } from "../utilities/apolloCodegenSchemaExtension";
+ 
+function filePathForNode(node: ASTNode): string | undefined {
+  return node.loc?.source?.name;
+}
+ 
+export interface CompilationResult {
+  rootTypes: ir.RootTypeDefinition;
+  operations: ir.OperationDefinition[];
+  fragments: ir.FragmentDefinition[];
+  referencedTypes: GraphQLNamedType[];
+  schemaDocumentation: string | undefined;
+}
+ 
+export function compileToIR(
+  schema: GraphQLSchema,
+  document: DocumentNode,
+  legacySafelistingCompatibleOperations: boolean,
+  reduceGeneratedSchemaTypes: boolean,
+  validationOptions: ValidationOptions
+): CompilationResult {
+  // Collect fragment definition nodes upfront so we can compile these as we encounter them.
+  const fragmentNodeMap = new Map<String, FragmentDefinitionNode>();
+ 
+  for (const definitionNode of document.definitions) {
+    Iif (definitionNode.kind !== Kind.FRAGMENT_DEFINITION) continue;
+ 
+    fragmentNodeMap.set(definitionNode.name.value, definitionNode);
+  }
+ 
+  const operations: ir.OperationDefinition[] = [];
+  const fragmentMap = new Map<String, ir.FragmentDefinition>();
+  const referencedTypes = new Set<GraphQLNamedType>();
+  const reduceSchemaTypes: boolean = reduceGeneratedSchemaTypes
+ 
+  const queryType = schema.getQueryType() as GraphQLNamedType;
+  Iif (queryType === undefined) {
+    throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.", { });
+  }
+ 
+  const rootTypes: ir.RootTypeDefinition = {
+    queryType: queryType,
+    mutationType: schema.getMutationType() ?? undefined,
+    subscriptionType: schema.getSubscriptionType() ?? undefined
+  };
+ 
+  for (const definitionNode of document.definitions) {
+    Iif (definitionNode.kind !== Kind.OPERATION_DEFINITION) continue;
+ 
+    operations.push(compileOperation(definitionNode));
+  }
+ 
+  // We should have encountered all fragments because GraphQL validation normally makes sure
+  // there are no unused fragments in the document. But to allow for situations where you want that
+  // validation rule removed, we compile the remaining ones separately.
+ 
+  for (const [name, fragmentNode] of fragmentNodeMap.entries()) {
+    fragmentMap.set(name, compileFragment(fragmentNode));
+  }
+ 
+  return {
+    rootTypes: rootTypes,
+    operations: operations,
+    fragments: Array.from(fragmentMap.values()),
+    referencedTypes: Array.from(referencedTypes.values()),
+    schemaDocumentation: schema.description ?? undefined
+  };
+ 
+  function addReferencedType(type: GraphQLNamedType) {
+    Iif (referencedTypes.has(type)) { return }
+ 
+    referencedTypes.add(type)
+    
+    Iif (isInterfaceType(type)) {
+      const possibleTypes = schema.getPossibleTypes(type);
+ 
+      (type as any)._implementingObjects = possibleTypes;
+ 
+      for (const objectType of possibleTypes) {
+        Iif (!reduceSchemaTypes || hasTypePolicyDirective(objectType)) {
+          addReferencedType(getNamedType(objectType))
+        }
+      }
+    }
+ 
+    Iif (isUnionType(type)) {
+      const unionReferencedTypes = type.getTypes()
+      for (type of unionReferencedTypes) {
+        addReferencedType(getNamedType(type))
+      }
+    }
+ 
+    Iif (isInputObjectType(type)) {
+      addReferencedTypesFromInputObject(type)
+    }
+ 
+    Iif (isObjectType(type)) {
+      for (const interfaceType of type.getInterfaces()) {
+        addReferencedType(getNamedType(interfaceType))
+      }
+    }
+  }
+ 
+  function addReferencedTypesFromInputObject(
+    inputObject: GraphQLInputObjectType
+  ) {
+    const fieldMap = inputObject.getFields()
+    for (const key in fieldMap) {
+      const field = fieldMap[key]
+      addReferencedType(getNamedType(field.type))
+    }
+  }
+ 
+  function hasTypePolicyDirective(
+    type: GraphQLCompositeType
+  ): boolean {
+    const directiveName = directive_typePolicy.name.value;
+    for (const directive of type.astNode?.directives ?? []) {
+      Iif (directive.name.value === directiveName) {
+        return true;
+      }
+    }
+    return false;
+  }
+ 
+  function getFragment(name: string): ir.FragmentDefinition | undefined {
+    let fragment = fragmentMap.get(name);
+    Iif (fragment) return fragment;
+ 
+    const fragmentNode = fragmentNodeMap.get(name);
+    Iif (!fragmentNode) return undefined;
+ 
+    // Remove the fragment node from the map so we know which ones we haven't encountered yet.
+    fragmentNodeMap.delete(name);
+ 
+    fragment = compileFragment(fragmentNode);
+    fragmentMap.set(name, fragment);
+    return fragment;
+  }
+ 
+  function compileOperation(
+    operationDefinition: OperationDefinitionNode
+  ): ir.OperationDefinition {
+    Iif (!operationDefinition.name) {
+      throw new GraphQLError("Operations should be named", { nodes: operationDefinition });
+    }
+ 
+    const filePath = filePathForNode(operationDefinition);
+    const name = operationDefinition.name.value;
+    const operationType = operationDefinition.operation;
+    const referencedFragments = new Set<ir.FragmentDefinition>();
+ 
+    const variables = (operationDefinition.variableDefinitions || []).map(
+      (node) => {
+        const name = node.variable.name.value;
+        const defaultValue = node.defaultValue ? valueFromValueNode(node.defaultValue) : undefined
+ 
+        // The casts are a workaround for the lack of support for passing a type union
+        // to overloaded functions in TypeScript.
+        // See https://github.com/microsoft/TypeScript/issues/14107
+        const type = typeFromAST(schema, node.type as any) as GraphQLType;
+ 
+        // `typeFromAST` returns `undefined` when a named type is not found
+        // in the schema.
+        Iif (!type) {
+          throw new GraphQLError(
+            `Couldn't get type from type node "${node.type}"`,
+            { nodes: node }
+          );
+        }
+ 
+        addReferencedType(getNamedType(type));
+ 
+        return {
+          name,
+          type,
+          defaultValue
+        };
+      }
+    );
+ 
+    const source = print(transformToNetworkRequestSourceDefinition(
+      operationDefinition,
+      legacySafelistingCompatibleOperations
+    ));
+    const rootType = schema.getRootType(operationType) as GraphQLObjectType;
+    const [directives,] = compileDirectives(operationDefinition.directives) ?? [undefined, undefined];
+ 
+    addReferencedType(rootType)
+ 
+    const selectionSet = compileSelectionSet(operationDefinition.selectionSet, rootType, referencedFragments)
+    const referencedFragmentsArray = Array.from(referencedFragments.values())
+ 
+    Iif (containsLocalCacheMutationDirective(operationDefinition.directives)) {
+      overrideAsLocalCacheMutation(referencedFragmentsArray);
+    }
+ 
+    return {
+      name,
+      operationType,
+      variables,
+      rootType,
+      selectionSet: selectionSet,
+      directives: directives,
+      referencedFragments: referencedFragmentsArray,
+      source,
+      filePath
+    };
+  }
+ 
+  function compileFragment(
+    fragmentDefinition: FragmentDefinitionNode
+  ): ir.FragmentDefinition {
+    const name = fragmentDefinition.name.value;
+ 
+    const filePath = filePathForNode(fragmentDefinition);
+    const source = print(transformToNetworkRequestSourceDefinition(
+      fragmentDefinition,
+      legacySafelistingCompatibleOperations
+    ));
+    const referencedFragments = new Set<ir.FragmentDefinition>();
+ 
+    const typeCondition = typeFromAST(
+      schema,
+      fragmentDefinition.typeCondition
+    ) as GraphQLCompositeType;
+ 
+    const [directives,] = compileDirectives(fragmentDefinition.directives) ?? [undefined, undefined];
+ 
+    addReferencedType(getNamedType(typeCondition));
+ 
+    const selectionSet = compileSelectionSet(fragmentDefinition.selectionSet, typeCondition, referencedFragments)
+    const referencedFragmentsArray = Array.from(referencedFragments.values())
+ 
+    Iif (containsLocalCacheMutationDirective(fragmentDefinition.directives)) {
+      overrideAsLocalCacheMutation(referencedFragmentsArray);
+    }
+ 
+    return {
+      name,
+      filePath,
+      source,
+      typeCondition,
+      selectionSet: selectionSet,
+      directives: directives,
+      referencedFragments: referencedFragmentsArray,
+      overrideAsLocalCacheMutation: false
+    };
+  }
+ 
+  function overrideAsLocalCacheMutation(
+    fragments: ir.FragmentDefinition[]
+  ) {
+    fragments.forEach(element => {
+      element.overrideAsLocalCacheMutation = true
+      overrideAsLocalCacheMutation(element.referencedFragments)
+    });
+  }
+ 
+  function compileSelectionSet(
+    selectionSetNode: SelectionSetNode,
+    parentType: GraphQLCompositeType,
+    operationReferencedFragments: Set<ir.FragmentDefinition>,
+  ): ir.SelectionSet {
+    return {
+      parentType,
+      selections: selectionSetNode.selections
+        .map((selectionNode) =>
+          compileSelection(selectionNode, parentType, operationReferencedFragments)
+        )
+        .filter(isNotNullOrUndefined),
+    };
+  }
+ 
+  function compileSelection(
+    selectionNode: SelectionNode,
+    parentType: GraphQLCompositeType,
+    operationReferencedFragments: Set<ir.FragmentDefinition>,
+  ): ir.Selection | undefined {
+    const [directives, inclusionConditions] = compileDirectives(selectionNode.directives) ?? [undefined, undefined];
+ 
+    switch (selectionNode.kind) {
+      case Kind.FIELD: {
+        const name = selectionNode.name.value;
+        Iif (name == "__typename") { return undefined }
+        const alias = selectionNode.alias?.value;
+ 
+        const fieldDef = getFieldDef(schema, parentType, name);
+        Iif (!fieldDef) {
+          throw new GraphQLError(
+            `Cannot query field "${name}" on type "${String(parentType)}"`,
+            { nodes: selectionNode }
+          );
+        }
+ 
+        const fieldType = fieldDef.type;
+        const unwrappedFieldType = getNamedType(fieldDef.type);
+ 
+        addReferencedType(getNamedType(unwrappedFieldType));
+ 
+        const { description, deprecationReason } = fieldDef;
+        const args: ir.Field["arguments"] = compileArguments(fieldDef, selectionNode.arguments);
+ 
+        let field: ir.Field = {
+          kind: "Field",
+          name,
+          alias,
+          type: fieldType,
+          arguments: args,
+          inclusionConditions: inclusionConditions,
+          description: !isMetaFieldName(name) && description ? description : undefined,
+          deprecationReason: deprecationReason || undefined,
+          directives: directives,
+        };
+ 
+        function validateFieldName(node: FieldNode, disallowedNames?: Array<string>, schemaNamespace?: string) {
+          Iif (disallowedNames && schemaNamespace) {
+            const responseKey = (node.alias ?? node.name).value
+            const responseKeyFirstLowercase = responseKey.charAt(0).toLowerCase() + responseKey.slice(1)
+ 
+            Iif (disallowedNames?.includes(responseKeyFirstLowercase)) {
+              throw new GraphQLError(
+                `Schema name "${schemaNamespace}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${schemaNamespace}Schema", "${schemaNamespace}GraphQL", "${schemaNamespace}API"`,
+                { nodes: node }
+              );
+            }
+          }
+        }
+ 
+        if (isListType(fieldType) || (isNonNullType(fieldType) && isListType(fieldType.ofType))) {
+          validateFieldName(selectionNode, validationOptions.disallowedFieldNames?.entityList, validationOptions.schemaNamespace)
+        } else Iif (isCompositeType(unwrappedFieldType)) {
+          validateFieldName(selectionNode, validationOptions.disallowedFieldNames?.entity, validationOptions.schemaNamespace)
+        }
+ 
+        Iif (isCompositeType(unwrappedFieldType)) {
+          const selectionSetNode = selectionNode.selectionSet;
+ 
+          Iif (!selectionSetNode) {
+            throw new GraphQLError(
+              `Composite field "${name}" on type "${String(
+                parentType
+              )}" requires selection set`,
+              { nodes: selectionNode }
+            );
+          }
+ 
+          field.selectionSet = compileSelectionSet(
+            selectionSetNode,
+            unwrappedFieldType,
+            operationReferencedFragments
+          );
+        }
+        return field;
+      }
+      case Kind.INLINE_FRAGMENT: {
+        const typeNode = selectionNode.typeCondition;
+        const typeCondition = typeNode
+          ? (typeFromAST(schema, typeNode) as GraphQLCompositeType)
+          : parentType;
+ 
+        addReferencedType(typeCondition);
+ 
+        return {
+          kind: "InlineFragment",
+          selectionSet: compileSelectionSet(
+            selectionNode.selectionSet,
+            typeCondition,
+            operationReferencedFragments
+          ),
+          inclusionConditions: inclusionConditions,
+          directives: directives
+        };
+      }
+      case Kind.FRAGMENT_SPREAD: {
+        const fragmentName = selectionNode.name.value;
+ 
+        const fragment = getFragment(fragmentName);
+        Iif (!fragment) {
+          throw new GraphQLError(
+            `Unknown fragment "${fragmentName}".`,
+            { nodes: selectionNode.name }
+          );
+        }
+ 
+        operationReferencedFragments.add(fragment);
+ 
+        const fragmentSpread: ir.FragmentSpread = {
+          kind: "FragmentSpread",
+          fragment,
+          inclusionConditions: inclusionConditions,
+          directives: directives
+        };
+        return fragmentSpread;
+      }
+    }
+  }
+ 
+  function compileArguments(
+    ...args:
+    [fieldDef: GraphQLField<any, any, any>, args?: ReadonlyArray<ArgumentNode>] |
+    [directiveDef: GraphQLDirective, args?: ReadonlyArray<ArgumentNode>]
+  ): ir.Argument[] | undefined {
+    const argDefs: ReadonlyArray<GraphQLArgument> = args[0].args
+    return args[1] && args[1].length > 0
+      ? args[1].map((arg) => {
+        const name = arg.name.value;
+        const argDef = argDefs.find(
+          (argDef) => argDef.name === arg.name.value
+        );
+        const argDefType = argDef?.type;
+ 
+        Iif (!argDefType) {
+          throw new GraphQLError(
+            `Cannot find directive argument type for argument "${name}".`,
+            { nodes: [arg] }
+          );
+        }
+ 
+        return {
+          name,
+          value: valueFromValueNode(arg.value),
+          type: argDefType,
+          deprecationReason: argDef.deprecationReason ?? undefined
+        };
+      })
+      : undefined;
+  }
+ 
+  function compileDirectives(
+    directives?: ReadonlyArray<DirectiveNode>
+  ): [ir.Directive[], ir.InclusionCondition[]?] | undefined {
+    if (directives && directives.length > 0) {
+      const compiledDirectives: ir.Directive[] = [];
+      const inclusionConditions: ir.InclusionCondition[] = [];
+ 
+      for (const directive of directives) {
+        const name = directive.name.value;
+        const directiveDef = schema.getDirective(name)
+ 
+        Iif (!directiveDef) {
+          throw new GraphQLError(
+            `Cannot find directive "${name}".`,
+            { nodes: directive }
+          );
+        }
+ 
+        compiledDirectives.push(
+          {
+            name: name,
+            arguments: compileArguments(directiveDef, directive.arguments)
+          }
+        );
+ 
+        const condition = compileInclusionCondition(directive, directiveDef);
+        Iif (condition) { inclusionConditions.push(condition) };
+      }
+ 
+      return [
+        compiledDirectives,
+        inclusionConditions.length > 0 ? inclusionConditions : undefined
+      ]
+ 
+    } else {
+      return undefined;
+    }
+  }
+ 
+  function compileInclusionCondition(
+    directiveNode: DirectiveNode,
+    directiveDef: GraphQLDirective
+  ): ir.InclusionCondition | undefined {
+    if (directiveDef.name == "include" || directiveDef.name == "skip") {
+      const condition = directiveNode.arguments?.[0].value;
+      const isInverted = directiveDef.name == "skip";
+ 
+      switch (condition?.kind) {
+        case Kind.BOOLEAN:
+          if (isInverted) {
+            return condition.value ? "SKIPPED" : "INCLUDED";
+          } else {
+            return condition.value ? "INCLUDED" : "SKIPPED";
+          }
+ 
+        case Kind.VARIABLE:
+          return {
+            variable: condition.name.value,
+            isInverted: isInverted
+          }
+ 
+        default:
+          throw new GraphQLError(
+            `Conditional inclusion directive has invalid "if" argument.`,
+            { nodes: directiveNode }
+          );
+          break;
+      }
+    } else {
+      return undefined
+    }
+  }
+ 
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/values.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/values.ts.html new file mode 100644 index 000000000..aa4872c5c --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/values.ts.html @@ -0,0 +1,229 @@ + + + + + + Code coverage report for src/compiler/values.ts + + + + + + + + + +
+
+

All files / src/compiler values.ts

+
+ +
+ 22.22% + Statements + 2/9 +
+ + +
+ 0% + Branches + 0/4 +
+ + +
+ 0% + Functions + 0/2 +
+ + +
+ 22.22% + Lines + 2/9 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +491x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { Kind, ValueNode } from 'graphql';
+ 
+export type GraphQLValue =
+  | {
+      kind:
+        | 'Variable'
+        | 'IntValue'
+        | 'FloatValue'
+        | 'StringValue'
+        | 'EnumValue';
+      value: string;
+    }
+  | { kind: 'BooleanValue'; value: boolean }
+  | { kind: 'NullValue' }
+  | GraphQLListValue
+  | GraphQLObjectValue;
+ 
+export interface GraphQLListValue {
+  kind: 'ListValue';
+  value: GraphQLValue[];
+}
+ 
+export interface GraphQLObjectValue {
+  kind: 'ObjectValue';
+  value: { [name: string]: GraphQLValue };
+}
+ 
+export function valueFromValueNode(valueNode: ValueNode): GraphQLValue {
+  switch (valueNode.kind) {
+    case Kind.VARIABLE:
+      return { kind: valueNode.kind, value: valueNode.name.value };
+    case Kind.LIST:
+      return {
+        kind: valueNode.kind,
+        value: valueNode.values.map(valueFromValueNode),
+      };
+    case Kind.OBJECT:
+      return {
+        kind: valueNode.kind,
+        value: valueNode.fields.reduce((object, field) => {
+          object[field.name.value] = valueFromValueNode(field.value);
+          return object;
+        }, {} as GraphQLObjectValue['value']),
+      };
+    default:
+      return valueNode;
+  }
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.html new file mode 100644 index 000000000..482394c46 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for src + + + + + + + + + +
+
+

All files src

+
+ +
+ 42.99% + Statements + 46/107 +
+ + +
+ 5.12% + Branches + 2/39 +
+ + +
+ 2.94% + Functions + 1/34 +
+ + +
+ 42.45% + Lines + 45/106 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.ts +
+
66.1%39/5928.57%2/75.88%1/1765.51%38/58
validationRules.ts +
+
14.58%7/480%0/320%0/1714.58%7/48
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.ts.html new file mode 100644 index 000000000..516a5780e --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.ts.html @@ -0,0 +1,463 @@ + + + + + + Code coverage report for src/index.ts + + + + + + + + + +
+
+

All files / src index.ts

+
+ +
+ 66.1% + Statements + 39/59 +
+ + +
+ 28.57% + Branches + 2/7 +
+ + +
+ 5.88% + Functions + 1/17 +
+ + +
+ 65.51% + Lines + 38/58 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +1271x +  +  +  +  +  +  +  +  +  +  +  +  +1x +1x +1x +1x +  +  +1x +  +  +  +1x +1x +  +  +  +1x +1x +1x +1x +1x +1x +1x +1x +1x +1x +  +1x +  +1x +  +  +12x +12x +12x +  +  +  +  +  +  +  +12x +  +  +  +12x +  +12x +12x +12x +  +12x +12x +12x +7x +  +7x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +1x +  +  +  +1x +  +  +  +1x +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  + 
import {
+  Source,
+  buildClientSchema,
+  GraphQLSchema,
+  parse,
+  DocumentNode,
+  concatAST,
+  GraphQLError,
+  validate,
+  buildASTSchema,
+  printSchema,
+  extendSchema,
+} from "graphql";
+import { defaultValidationRules, ValidationOptions } from "./validationRules";
+import { compileToIR, CompilationResult } from "./compiler";
+import { assertValidSchema, assertValidSDL } from "./utilities/graphql";
+import {
+  addApolloCodegenSchemaExtensionToDocument,
+} from "./utilities/apolloCodegenSchemaExtension";
+import {
+  addExperimentalDeferDirectiveToSDLDocument,
+  addExperimentalDeferDirectiveToIntrospectionSchema
+} from "./utilities/experimentalDeferDirective";
+import { addTypePolicyDirectivesToSchema } from "./utilities/typePolicyDirective";
+import { addFieldPolicyDirectivesToSchema } from "./utilities/fieldPolicyDirective";
+ 
+// We need to export all the classes we want to map to native objects,
+// so we have access to the constructor functions for type checks.
+export {
+  Source,
+  GraphQLError,
+  GraphQLSchema,
+  GraphQLScalarType,
+  GraphQLObjectType,
+  GraphQLInterfaceType,
+  GraphQLUnionType,
+  GraphQLEnumType,
+  GraphQLInputObjectType,
+} from "graphql";
+export { GraphQLSchemaValidationError } from "./utilities/graphql";
+ 
+export function loadSchemaFromSources(sources: Source[]): GraphQLSchema {
+  var introspectionJSONResult: Source | undefined
+ 
+  var documents = new Array<DocumentNode>()
+  for (const source of sources) {
+    Iif (source.name.endsWith(".json")) {
+      if (!introspectionJSONResult) {
+        introspectionJSONResult = source
+      } else {
+        throw new Error(`Schema search paths can only include one JSON schema definition.
+        Found "${introspectionJSONResult.name} & "${source.name}".`)
+      }
+    } else {
+      documents.push(parse(source))
+    }
+  }
+ 
+  var document = addApolloCodegenSchemaExtensionToDocument(concatAST(documents))
+ 
+  if (!introspectionJSONResult) {
+    document = addExperimentalDeferDirectiveToSDLDocument(document)
+    assertValidSDL(document)
+ 
+    const schema = buildASTSchema(document, { assumeValid: true, assumeValidSDL: true })
+    addTypePolicyDirectivesToSchema(schema)
+    addFieldPolicyDirectivesToSchema(schema)
+    assertValidSchema(schema)
+ 
+    return schema
+ 
+  } else E{
+    var schema = loadSchemaFromIntrospectionResult(introspectionJSONResult.body)
+    document = addExperimentalDeferDirectiveToIntrospectionSchema(schema, document)
+    schema = extendSchema(schema, document, { assumeValid: true, assumeValidSDL: true })
+    addTypePolicyDirectivesToSchema(schema)
+    addFieldPolicyDirectivesToSchema(schema)
+    assertValidSchema(schema)
+ 
+    return schema
+  }
+}
+ 
+function loadSchemaFromIntrospectionResult(
+  introspectionResult: string
+): GraphQLSchema {
+  let payload = JSON.parse(introspectionResult);
+ 
+  Iif (payload.data) {
+    payload = payload.data;
+  }
+ 
+  const schema = buildClientSchema(payload);
+ 
+  return schema;
+}
+ 
+export function printSchemaToSDL(schema: GraphQLSchema): string {
+  return printSchema(schema)
+}
+ 
+export function parseOperationDocument(source: Source): DocumentNode {
+  return parse(source);
+}
+ 
+export function mergeDocuments(documents: DocumentNode[]): DocumentNode {
+  return concatAST(documents);
+}
+ 
+export function validateDocument(
+  schema: GraphQLSchema,
+  document: DocumentNode,
+  validationOptions: ValidationOptions,
+): readonly GraphQLError[] {
+  return validate(schema, document, defaultValidationRules(validationOptions));
+}
+ 
+export function compileDocument(
+  schema: GraphQLSchema,
+  document: DocumentNode,
+  legacySafelistingCompatibleOperations: boolean,
+  reduceGeneratedSchemaTypes: boolean,
+  validationOptions: ValidationOptions
+): CompilationResult {
+  return compileToIR(schema, document, legacySafelistingCompatibleOperations, reduceGeneratedSchemaTypes, validationOptions);
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/apolloCodegenSchemaExtension.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/apolloCodegenSchemaExtension.ts.html new file mode 100644 index 000000000..27cafbaaf --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/apolloCodegenSchemaExtension.ts.html @@ -0,0 +1,334 @@ + + + + + + Code coverage report for src/utilities/apolloCodegenSchemaExtension.ts + + + + + + + + + +
+
+

All files / src/utilities apolloCodegenSchemaExtension.ts

+
+ +
+ 100% + Statements + 12/12 +
+ + +
+ 50% + Branches + 1/2 +
+ + +
+ 100% + Functions + 3/3 +
+ + +
+ 100% + Lines + 11/11 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +841x +1x +  +1x +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +1x +48x +140x +  +  +  +12x +  +  +  +  + 
import { DirectiveDefinitionNode, DocumentNode, Kind, concatAST, GraphQLString } from "graphql";
+import { nameNode, nonNullNode, stringNode, typeNode } from "./nodeHelpers";
+ 
+export const directive_apollo_client_ios_localCacheMutation: DirectiveDefinitionNode = {
+  kind: Kind.DIRECTIVE_DEFINITION,
+  description: stringNode("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),
+  name: nameNode("apollo_client_ios_localCacheMutation"),
+  repeatable: false,
+  locations: [nameNode("QUERY"), nameNode("MUTATION"), nameNode("SUBSCRIPTION"), nameNode("FRAGMENT_DEFINITION")]
+}
+ 
+export const directive_typePolicy: DirectiveDefinitionNode = {
+  kind: Kind.DIRECTIVE_DEFINITION,
+  description: stringNode("Attach extra information to a given type."),
+  name: nameNode("typePolicy"),
+  arguments: [
+    {
+      kind: Kind.INPUT_VALUE_DEFINITION,
+      description: stringNode("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),
+      name: nameNode("keyFields"),
+      type: nonNullNode(typeNode(GraphQLString))
+    }
+  ],
+  repeatable: false,
+  locations: [nameNode("OBJECT"), nameNode("INTERFACE")]
+}
+ 
+export const directive_fieldPolicy: DirectiveDefinitionNode = {
+  kind: Kind.DIRECTIVE_DEFINITION,
+  description: stringNode("A directive used by Apollo iOS to map query input data to cache keys of objects."),
+  name: nameNode("fieldPolicy"),
+  arguments: [
+    {
+      kind: Kind.INPUT_VALUE_DEFINITION,
+      description: stringNode("The field you are setting the @fieldPolicy for."),
+      name: nameNode("forField"),
+      type: nonNullNode(typeNode(GraphQLString))
+    },
+    {
+      kind: Kind.INPUT_VALUE_DEFINITION,
+      description: stringNode("Set of fields used to compute the cache key."),
+      name: nameNode("keyArgs"),
+      type: nonNullNode(typeNode(GraphQLString))
+    }
+  ],
+  repeatable: true,
+  locations: [nameNode("OBJECT"), nameNode("INTERFACE")]
+}
+ 
+export const directive_import_statement: DirectiveDefinitionNode = {
+  kind: Kind.DIRECTIVE_DEFINITION,
+  description: stringNode("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),
+  name: nameNode("import"),
+  arguments: [
+    {
+      kind: Kind.INPUT_VALUE_DEFINITION,
+      description: stringNode("The name of the module to import."),
+      name: nameNode("module"),
+      type: nonNullNode(typeNode(GraphQLString))
+    }
+  ],
+  repeatable: true,
+  locations: [nameNode("QUERY"), nameNode("MUTATION"), nameNode("SUBSCRIPTION"), nameNode("FRAGMENT_DEFINITION")]
+}
+ 
+const apolloDirectives = [
+  directive_apollo_client_ios_localCacheMutation,
+  directive_import_statement,
+  directive_typePolicy,
+  directive_fieldPolicy
+]
+ 
+export function addApolloCodegenSchemaExtensionToDocument(document: DocumentNode): DocumentNode {
+  const directives = apolloDirectives.filter(directive => !document.definitions.some(definition =>
+    definition.kind == Kind.DIRECTIVE_DEFINITION &&
+    definition.name.value == directive.name.value
+  ));
+ 
+  return concatAST([document, {
+    kind: Kind.DOCUMENT,
+    definitions: directives
+  }]);
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/experimentalDeferDirective.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/experimentalDeferDirective.ts.html new file mode 100644 index 000000000..cc7639795 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/experimentalDeferDirective.ts.html @@ -0,0 +1,391 @@ + + + + + + Code coverage report for src/utilities/experimentalDeferDirective.ts + + + + + + + + + +
+
+

All files / src/utilities experimentalDeferDirective.ts

+
+ +
+ 30% + Statements + 9/30 +
+ + +
+ 16.66% + Branches + 3/18 +
+ + +
+ 25% + Functions + 3/12 +
+ + +
+ 32.14% + Lines + 9/28 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +1031x +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +1x +12x +  +12x +12x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +83x +  +  +  +  +  +  +12x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import {
+  DefinitionNode,
+  DirectiveDefinitionNode,
+  DocumentNode,
+  GraphQLDeferDirective,
+  GraphQLDirective,
+  GraphQLSchema,
+  Kind,
+  concatAST,
+} from "graphql";
+import { definitionNode } from "./nodeHelpers";
+ 
+// While @defer is experimental the directive needs to be manually added to the list of directives
+// available to operations. If the directive is already in the document it must be validated to 
+// ensure it matches the @defer directive definition supported by Apollo iOS.
+//
+// Once defer is part of the GraphQL spec and the directive is no longer considered experimental
+// this function can be removed.
+export function addExperimentalDeferDirectiveToSDLDocument(document: DocumentNode): DocumentNode {
+  const definition = document.definitions.find(isDeferDirectiveDefinitionNodePredicate)
+ 
+  if (!definition) {
+    return concatAST([document, experimentalDeferDirectiveDocumentNode()])
+  }
+ 
+  const directiveDefinition = definition as DirectiveDefinitionNode
+ 
+  Iif (!matchDirectiveDefinition(directiveDefinition, GraphQLDeferDirective)) {
+    console.warn(`Unsupported ${directiveDefinition.name.value} directive found. It will be replaced with a supported definition instead.`)
+ 
+    const modifiedDocument: DocumentNode = {
+      kind: Kind.DOCUMENT,
+      definitions: document.definitions.filter(
+        (value) => !isDeferDirectiveDefinitionNodePredicate(value) ? value : undefined)
+        .concat(definitionNode(GraphQLDeferDirective))
+    }
+ 
+    return modifiedDocument
+  }
+ 
+  return document
+}
+ 
+// NOTE: This function is used for adding the experimental defer directive to a document after
+// validating the existing of the defer directive in a schema built from an introspection result.
+//
+// While @defer is experimental the directive needs to be manually added to the list of directives
+// available to operations. If the directive is already in the document it must be validated to 
+// ensure it matches the @defer directive definition supported by Apollo iOS.
+//
+// Once defer is part of the GraphQL spec and the directive is no longer considered experimental
+// this function can be removed.
+export function addExperimentalDeferDirectiveToIntrospectionSchema(schema: GraphQLSchema, document: DocumentNode): DocumentNode {
+  const directive = schema.getDirective(GraphQLDeferDirective.name)
+ 
+  Iif (!directive) {
+    return concatAST([document, experimentalDeferDirectiveDocumentNode()])
+  }
+ 
+  Iif (!matchDirective(directive, GraphQLDeferDirective)) {
+    console.warn(`Unsupported ${directive.name} directive found. It will be replaced with a supported definition instead.`)
+ 
+    return concatAST([document, experimentalDeferDirectiveDocumentNode()])
+  }
+ 
+  return document
+}
+ 
+// Checks whether the definition node is a defer directive definition node.
+function isDeferDirectiveDefinitionNodePredicate(value: DefinitionNode) {
+  return (
+    value.kind === Kind.DIRECTIVE_DEFINITION && 
+    value.name.value === GraphQLDeferDirective.name
+  )
+}
+ 
+function experimentalDeferDirectiveDocumentNode(): DocumentNode {
+  return {
+    kind: Kind.DOCUMENT,
+    definitions: [definitionNode(GraphQLDeferDirective)]
+  }
+}
+ 
+// Checks whether the supplied directive definition node matches against important properties
+// of the experimentally defined defer directive that Apollo iOS expects.
+function matchDirectiveDefinition(definition: DirectiveDefinitionNode, target: GraphQLDirective): Boolean {
+  return(
+    definition.repeatable === target.isRepeatable &&
+    definition.locations.map((node) => node.value).sort().toString() === target.locations.slice(0).sort().toString() &&
+    definition.arguments?.map((value) => value.name.value).sort().toString() === target.args.map((value) => value.name).sort().toString()
+  )
+}
+ 
+// Checks whether the supplied directive matches against important properties
+// of the experimentally defined defer directive that Apollo iOS expects.
+function matchDirective(directive: GraphQLDirective, target: GraphQLDirective): Boolean {
+  return(
+    directive.isRepeatable === target.isRepeatable &&
+    directive.locations.slice(0).sort().toString() === target.locations.slice(0).sort().toString() &&
+    directive.args.map((value) => value.name).sort().toString() === target.args.map((value) => value.name).sort().toString()
+  )
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/fieldPolicyDirective.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/fieldPolicyDirective.ts.html new file mode 100644 index 000000000..5ddea69da --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/fieldPolicyDirective.ts.html @@ -0,0 +1,709 @@ + + + + + + Code coverage report for src/utilities/fieldPolicyDirective.ts + + + + + + + + + +
+
+

All files / src/utilities fieldPolicyDirective.ts

+
+ +
+ 91.25% + Statements + 73/80 +
+ + +
+ 76.34% + Branches + 71/93 +
+ + +
+ 100% + Functions + 10/10 +
+ + +
+ 91.13% + Lines + 72/79 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +2091x +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +1x +  +  +  +  +  +  +1x +  +  +12x +  +12x +98x +  +98x +  +62x +  +  +  +  +1x +  +  +62x +62x +  +  +  +62x +  +62x +15x +15x +  +15x +15x +15x +  +  +15x +  +  +  +  +  +  +15x +30x +  +15x +15x +15x +15x +  +  +15x +  +  +  +  +  +  +  +15x +15x +  +  +  +  +  +  +  +15x +18x +15x +18x +1x +  +  +  +  +  +  +  +  +  +14x +14x +14x +  +14x +16x +4x +  +  +  +  +14x +1x +  +  +  +  +  +  +  +13x +3x +  +  +  +  +  +  +10x +10x +  +  +  +  +  +  +  +  +  +66x +  +  +  +66x +  +66x +12x +12x +  +12x +12x +  +  +  +66x +5x +5x +  +  +  +66x +66x +4x +4x +  +  +  +4x +4x +4x +2x +2x +2x +  +  +  +4x +2x +  +  +  +  +  +66x +  +  +  +  +  +  +2x +  +  +4x +  +  +  +  +  +4x +  +  +  +  + 
import {
+  DirectiveNode,
+  GraphQLCompositeType,
+  GraphQLError,
+  GraphQLInterfaceType,
+  GraphQLObjectType,
+  GraphQLSchema,
+  isInterfaceType,
+  isListType,
+  isObjectType,
+  isUnionType,
+  Kind,
+  valueFromASTUntyped,
+} from "graphql";
+import { directive_fieldPolicy } from "./apolloCodegenSchemaExtension";
+ 
+const directiveName = directive_fieldPolicy.name.value
+ 
+// type FieldPolicyDirectiveResult = {
+//   directive: DirectiveNode;
+//   source: GraphQLObjectType;
+// };
+ 
+export function addFieldPolicyDirectivesToSchema(
+  schema: GraphQLSchema
+) {
+  const types = schema.getTypeMap();
+ 
+  for (const t in types) {
+    const type = types[t];
+ 
+    if (type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) {
+      // (type as any)._apolloFieldPolicies = applyFieldPoliciesFor(type);
+      applyFieldPoliciesFor(type);
+    }
+  }
+}
+ 
+export function applyFieldPoliciesFor(
+  type: GraphQLCompositeType
+) {
+  const directives = fieldPolicyDirectivesFor(type)
+  Iif (!directives || isUnionType(type)) {
+    return;
+  }
+ 
+  const typeFields = type.getFields()
+ 
+  for (const directive of directives) {
+    const forFieldValueNode = directive.arguments?.find(
+      (b) => b.name.value === "forField"
+    )?.value
+    let forField: string | undefined = undefined;
+    if (forFieldValueNode?.kind === Kind.STRING) {
+      forField = forFieldValueNode.value
+    }
+ 
+    Iif (!forField) {
+      throw new GraphQLError(
+        `@fieldPolicy directive must have a 'forField' value.`,
+        { nodes: directive }
+      );
+    }
+ 
+    const keyArgsValueNode = directive.arguments?.find(
+      (b) => b.name.value === "keyArgs"
+    )?.value
+    let keyArgs: string[] | undefined = undefined;
+    if (keyArgsValueNode?.kind == Kind.STRING) {
+      const rawArgs = keyArgsValueNode.value.split(" ");
+      keyArgs = [...new Set(rawArgs.filter(Boolean))];
+    }
+ 
+    Iif (!keyArgs) {
+      throw new GraphQLError(
+        `'keyArgs' must be a space-separated list of identifiers.`,
+        { nodes: directive }
+      );
+    }
+ 
+    // check that the field exists
+    const actualField = typeFields[forField]
+    Iif (!actualField) {
+      throw new GraphQLError(
+        `Field "${forField}" does not exist on type "${type.name}".`,
+        { nodes: type.astNode ? [type.astNode, directive] : directive}
+      );
+    }
+ 
+    // validate the provided key args match an input parameter
+    const inputs = actualField.astNode?.arguments;
+    const inputNames = new Set(inputs?.map(input => input.name.value) ?? []);
+    for (const keyArg of keyArgs) {
+      if (!inputNames.has(keyArg)) {
+        throw new GraphQLError(
+          `@fieldPolicy key argument "${keyArg}" does not exist as an input argument of field "${actualField.name}".`,
+          {
+            nodes: actualField.astNode
+          }
+        );
+      }
+    }
+ 
+    // List input and return type validation
+    if (inputs) {
+      var numListInputs = 0;
+      const hasListReturnType = isListType(actualField.type);
+ 
+      for (const inputArg of inputs) {
+        if (inputArg.type.kind == "ListType") {
+          numListInputs += 1;
+        }
+      }
+ 
+      // validate we have at most 1 list input parameter
+      if (numListInputs > 1) {
+        throw new GraphQLError(
+          `@fieldPolicy can only have at most 1 List type input parameter.`,
+          { nodes: actualField.astNode }
+        );
+      }
+ 
+      // validate that a list input parameter and return type exist either together
+      // or not at all
+      if ((hasListReturnType && numListInputs != 1) || (numListInputs == 1 && !hasListReturnType)) {
+        throw new GraphQLError(
+          `@fieldPolicy requires either both a List return type and 1 List input parameter, or neither.`,
+          { nodes: actualField.astNode }
+        );
+      }
+    }
+ 
+    if (!(actualField as any)._apolloFieldPolicies) {
+      (actualField as any)._apolloFieldPolicies = keyArgs
+    } else E{
+      (actualField as any)._apolloFieldPolicies = []
+    }
+  }
+}
+ 
+function fieldPolicyDirectivesFor(
+  type: GraphQLCompositeType
+): DirectiveNode[] | undefined {
+  Iif(!isObjectType(type) && !isInterfaceType(type)) {
+    return undefined;
+  }
+ 
+  const result: DirectiveNode[] = [];
+ 
+  for (const extension of type.extensionASTNodes ?? []) {
+    const directive = extension.directives?.find(
+      (d) => d.name.value === directiveName
+    );
+    if (directive) {
+      result.push(directive)
+    }
+  }
+ 
+  for (const directive of type.astNode?.directives ?? []) {
+    if (directive.name.value === directiveName) {
+      result.push(directive);
+    }
+  }
+ 
+  if("getInterfaces" in type) {
+    for (const interfaceType of type.getInterfaces()) {
+      const found = fieldPolicyDirectivesFor(interfaceType);
+      Iif (!found) {
+        continue;
+      }
+ 
+      for (const foundDirective of found) {
+        var duplicate = false;
+        for (const directive of result) {
+          if (matchDirectiveArguments(directive, foundDirective)) {
+            duplicate = true;
+            break;
+          }
+        }
+ 
+        if (!duplicate) {
+          result.push(foundDirective);
+        }
+      }
+    }
+  }
+ 
+  return result
+}
+ 
+function matchDirectiveArguments(
+  first: DirectiveNode,
+  second: DirectiveNode
+): boolean {
+  return (
+    (first.arguments ?? [])
+      .map((node) =>
+        JSON.stringify([node.name.value, valueFromASTUntyped(node.value)])
+      )
+      .sort()
+      .toString() ===
+    (second.arguments ?? [])
+      .map((node) =>
+        JSON.stringify([node.name.value, valueFromASTUntyped(node.value)])
+      )
+      .sort()
+      .toString()
+  );
+}
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/graphql.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/graphql.ts.html new file mode 100644 index 000000000..bf71eadef --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/graphql.ts.html @@ -0,0 +1,640 @@ + + + + + + Code coverage report for src/utilities/graphql.ts + + + + + + + + + +
+
+

All files / src/utilities graphql.ts

+
+ +
+ 29.68% + Statements + 19/64 +
+ + +
+ 0% + Branches + 0/37 +
+ + +
+ 11.76% + Functions + 2/17 +
+ + +
+ 30.64% + Lines + 19/62 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +1861x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +1x +1x +1x +  +1x +  +  +  +  +  +  +  +1x +12x +12x +  +  +  +  +1x +7x +7x +  +  +  +  +1x +  +  +  +1x +  +  +  +1x +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import {
+  ASTNode,
+  FieldNode,
+  GraphQLCompositeType,
+  GraphQLField,
+  GraphQLSchema,
+  isInterfaceType,
+  isObjectType,
+  isUnionType,
+  Kind,
+  Location,
+  SchemaMetaFieldDef,
+  SelectionSetNode,
+  TypeMetaFieldDef,
+  TypeNameMetaFieldDef,
+  validateSchema,
+  visit,
+  GraphQLError,
+  DocumentNode,
+  DirectiveNode,
+  DirectiveDefinitionNode
+} from "graphql";
+import { isNode } from "graphql/language/ast";
+import { validateSDL } from "graphql/validation/validate";
+import { directive_apollo_client_ios_localCacheMutation, directive_import_statement } from "./apolloCodegenSchemaExtension";
+import { addTypeNameFieldForLegacySafelisting } from "./legacySafelistingTransform";
+ 
+export class GraphQLSchemaValidationError extends Error {
+  constructor(public validationErrors: readonly GraphQLError[]) {
+    super(validationErrors.map((error) => error.message).join("\n\n"));
+ 
+    this.name = "GraphQLSchemaValidationError";
+  }
+}
+ 
+export function assertValidSDL(document: DocumentNode) {
+  const errors = validateSDL(document);
+  Iif (errors.length !== 0) {
+    throw new GraphQLSchemaValidationError(errors);
+  }
+}
+ 
+export function assertValidSchema(schema: GraphQLSchema) {
+  const errors = validateSchema(schema);
+  Iif (errors.length !== 0) {
+    throw new GraphQLSchemaValidationError(errors);
+  }
+}
+ 
+export function sourceAt(location: Location) {
+  return location.source.body.slice(location.start, location.end);
+}
+ 
+export function filePathForNode(node: ASTNode): string | undefined {
+  return node.loc?.source?.name;
+}
+ 
+export function isMetaFieldName(name: string) {
+  return name.startsWith("__");
+}
+ 
+export function containsLocalCacheMutationDirective(directives: readonly DirectiveNode[] | undefined): boolean {
+  Iif (!directives) return false
+ 
+  for (const directive of directives) {
+    Iif (directive.name.value == directive_apollo_client_ios_localCacheMutation.name.value) {
+      return true
+    }
+  }
+ 
+  return false
+}
+ 
+const typenameField: FieldNode = {
+  kind: Kind.FIELD,
+  name: { kind: Kind.NAME, value: "__typename" },
+};
+ 
+export function transformToNetworkRequestSourceDefinition(
+  ast: ASTNode,
+  legacySafelistingCompatibleOperations: boolean
+) {
+  Iif (legacySafelistingCompatibleOperations) {
+    ast = addTypeNameFieldForLegacySafelisting(ast)
+  }
+ 
+  return visit(ast, {
+    SelectionSet: {
+      leave(node: SelectionSetNode, _, parent) {
+        Iif (isNode(parent) && ![Kind.FIELD, Kind.FRAGMENT_DEFINITION].includes(parent.kind)) {
+          return node
+        }
+        return addTypenameFieldToSelectionSetIfNeeded(node)
+      }
+    },
+    Field: {
+      enter(node: FieldNode) {
+        return transformTypenameFieldIfNeeded(node)
+      }
+    },
+    Directive: {
+      enter(node: DirectiveNode) {
+        return stripApolloClientSpecificDirectives(node)
+      }
+    }
+  });
+}
+ 
+function addTypenameFieldToSelectionSetIfNeeded(node: SelectionSetNode): SelectionSetNode {
+  const hasTypenameField = node.selections.find((selection) =>
+    selection.kind == typenameField.kind && selection.name.value == typenameField.name.value
+  );
+ 
+  if (hasTypenameField) {
+    return node
+  } else {
+    return {
+      ...node,
+      selections: [typenameField, ...node.selections],
+    };
+  }
+}
+ 
+function transformTypenameFieldIfNeeded(node: FieldNode): FieldNode {
+  if (node.name.value == typenameField.name.value) {
+    return {
+      ...node,
+      alias: undefined,
+      directives: undefined
+    }
+  } else {
+    return node;
+  }
+}
+ 
+function stripApolloClientSpecificDirectives(node: DirectiveNode): DirectiveNode | null {
+  const apolloClientSpecificDirectives: DirectiveDefinitionNode[] = [
+    directive_apollo_client_ios_localCacheMutation,
+    directive_import_statement
+  ]
+ 
+  for (const directive of apolloClientSpecificDirectives) {
+    Iif (node.name.value == directive.name.value) {
+      return null
+    }
+  }
+ 
+  return node
+}
+ 
+// Utility functions extracted from graphql-js
+ 
+/**
+ * Not exactly the same as the executor's definition of getFieldDef, in this
+ * statically evaluated environment we do not always have an Object type,
+ * and need to handle Interface and Union types.
+ */
+export function getFieldDef(
+  schema: GraphQLSchema,
+  parentType: GraphQLCompositeType,
+  fieldName: string,
+): GraphQLField<any, any> | undefined {
+  Iif (
+    fieldName === SchemaMetaFieldDef.name &&
+    schema.getQueryType() === parentType
+  ) {
+    return SchemaMetaFieldDef;
+  }
+  Iif (fieldName === TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
+    return TypeMetaFieldDef;
+  }
+  Iif (
+    fieldName === TypeNameMetaFieldDef.name &&
+    (isObjectType(parentType) ||
+      isInterfaceType(parentType) ||
+      isUnionType(parentType))
+  ) {
+    return TypeNameMetaFieldDef;
+  }
+  Iif (isObjectType(parentType) || isInterfaceType(parentType)) {
+    return parentType.getFields()[fieldName];
+  }
+ 
+  return undefined;
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.html new file mode 100644 index 000000000..b7616bef7 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.html @@ -0,0 +1,236 @@ + + + + + + Code coverage report for src/utilities + + + + + + + + + +
+
+

All files src/utilities

+
+ +
+ 57.59% + Statements + 163/283 +
+ + +
+ 41.2% + Branches + 96/233 +
+ + +
+ 46.15% + Functions + 30/65 +
+ + +
+ 58.18% + Lines + 160/275 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
apolloCodegenSchemaExtension.ts +
+
100%12/1250%1/2100%3/3100%11/11
experimentalDeferDirective.ts +
+
30%9/3016.66%3/1825%3/1232.14%9/28
fieldPolicyDirective.ts +
+
91.25%73/8076.34%71/93100%10/1091.13%72/79
graphql.ts +
+
29.68%19/640%0/3711.76%2/1730.64%19/62
index.ts +
+
100%4/4100%0/0100%0/0100%4/4
legacySafelistingTransform.ts +
+
23.07%3/130%0/90%0/425%3/12
nodeHelpers.ts +
+
100%15/1550%1/2100%8/8100%15/15
predicates.ts +
+
50%2/40%0/60%0/250%2/4
typePolicyDirective.ts +
+
42.62%26/6130.3%20/6644.44%4/941.66%25/60
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.ts.html new file mode 100644 index 000000000..a01b7130a --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.ts.html @@ -0,0 +1,97 @@ + + + + + + Code coverage report for src/utilities/index.ts + + + + + + + + + +
+
+

All files / src/utilities index.ts

+
+ +
+ 100% + Statements + 4/4 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 4/4 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +51x +1x +1x +1x + 
export * from "./graphql";
+export * from "./predicates";
+export * from "./apolloCodegenSchemaExtension";
+export * from "./nodeHelpers";
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/legacySafelistingTransform.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/legacySafelistingTransform.ts.html new file mode 100644 index 000000000..84e1fa11a --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/legacySafelistingTransform.ts.html @@ -0,0 +1,247 @@ + + + + + + Code coverage report for src/utilities/legacySafelistingTransform.ts + + + + + + + + + +
+
+

All files / src/utilities legacySafelistingTransform.ts

+
+ +
+ 23.07% + Statements + 3/13 +
+ + +
+ 0% + Branches + 0/9 +
+ + +
+ 0% + Functions + 0/4 +
+ + +
+ 25% + Lines + 3/12 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +551x +  +  +  +  +  +  +  +1x +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import {
+  ASTNode,
+  FieldNode,  
+  Kind,
+  visit,  
+} from "graphql";
+ 
+// This has been copied from https://github.dev/apollographql/apollo-tooling/blob/cfe529bd83627eda7ea78818d32218af7a4e8f2b/packages/apollo-language-server/src/utilities/graphql.ts#L305-L347
+const typenameField = {
+  kind: Kind.FIELD,
+  name: { kind: Kind.NAME, value: "__typename" },
+};
+ 
+export function addTypeNameFieldForLegacySafelisting(ast: ASTNode) {
+  return visit(ast, {
+    enter(node: ASTNode) {
+      if (
+        !(node.kind === Kind.SELECTION_SET)
+      ) {
+        return undefined;
+      } else {
+        return {
+          ...node,
+          selections: node.selections.filter(
+            (selection) =>
+              !(
+                selection.kind === "Field" &&
+                (selection as FieldNode).name.value === "__typename"
+              )
+          ),
+        };
+      }
+    },
+    leave(node: ASTNode) {
+      Iif (
+        !(
+          node.kind === Kind.FIELD ||
+          node.kind === Kind.FRAGMENT_DEFINITION ||
+          node.kind === Kind.INLINE_FRAGMENT
+        )
+      ) {
+        return undefined;
+      }
+      Iif (!node.selectionSet) return undefined;
+ 
+      return {
+        ...node,
+        selectionSet: {
+          ...node.selectionSet,
+          selections: [typenameField, ...node.selectionSet.selections],
+        },
+      };
+    },
+  });
+}
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/nodeHelpers.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/nodeHelpers.ts.html new file mode 100644 index 000000000..49c3d3ff3 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/nodeHelpers.ts.html @@ -0,0 +1,232 @@ + + + + + + Code coverage report for src/utilities/nodeHelpers.ts + + + + + + + + + +
+
+

All files / src/utilities nodeHelpers.ts

+
+ +
+ 100% + Statements + 15/15 +
+ + +
+ 50% + Branches + 1/2 +
+ + +
+ 100% + Functions + 8/8 +
+ + +
+ 100% + Lines + 15/15 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +501x +  +1x +108x +  +  +  +  +  +1x +44x +  +  +  +  +  +1x +24x +  +  +  +  +  +  +  +1x +12x +  +  +  +  +24x +24x +  +  +  +1x +28x +  +  +  +  +  +1x +4x +  +  +  +  + 
import { DefinitionNode, GraphQLArgument, GraphQLDirective, GraphQLNamedType, InputValueDefinitionNode, Kind, NameNode, StringValueNode, TypeNode, NamedTypeNode, ListTypeNode, getNamedType } from "graphql";
+ 
+export function nameNode(name :string): NameNode {
+  return {
+    kind: Kind.NAME,
+    value: name
+  }
+}
+ 
+export function stringNode(value :string): StringValueNode {
+  return {
+    kind: Kind.STRING,
+    value: value
+  }
+}
+ 
+export function inputValueDefinitionNode(arg: GraphQLArgument): InputValueDefinitionNode {
+  return {
+    kind: Kind.INPUT_VALUE_DEFINITION,
+    description: stringNode(arg.description!),
+    name: nameNode(arg.name),
+    type: typeNode(getNamedType(arg.type))
+  }
+}
+ 
+export function definitionNode(definition: GraphQLDirective): DefinitionNode {
+  return {
+    kind: Kind.DIRECTIVE_DEFINITION,
+    description: definition.description ? stringNode(definition.description) : undefined,
+    name: nameNode(definition.name),
+    repeatable: false,
+    locations: definition.locations.map(loc => nameNode(loc)),
+    arguments: definition.args.map(arg => inputValueDefinitionNode(arg))
+  }
+}
+ 
+export function typeNode(type: GraphQLNamedType): NamedTypeNode {
+  return {
+    kind: Kind.NAMED_TYPE,
+    name: nameNode(type.name)
+  }
+}
+ 
+export function nonNullNode(node: NamedTypeNode | ListTypeNode): TypeNode {
+  return {
+    kind: Kind.NON_NULL_TYPE,
+    type: node
+  }
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/predicates.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/predicates.ts.html new file mode 100644 index 000000000..fb1ca21c6 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/predicates.ts.html @@ -0,0 +1,127 @@ + + + + + + Code coverage report for src/utilities/predicates.ts + + + + + + + + + +
+
+

All files / src/utilities predicates.ts

+
+ +
+ 50% + Statements + 2/4 +
+ + +
+ 0% + Branches + 0/6 +
+ + +
+ 0% + Functions + 0/2 +
+ + +
+ 50% + Lines + 2/4 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +151x +  +  +  +  +  +1x +  +  +  +  +  +  +  + 
export function isNotNullOrUndefined<T>(
+  value: T | null | undefined,
+): value is T {
+  return value !== null && typeof value !== 'undefined';
+}
+ 
+export function isObject(value: any): value is object {
+  return (
+    value !== undefined &&
+    value !== null &&
+    typeof value === 'object' &&
+    !Array.isArray(value)
+  );
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/typePolicyDirective.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/typePolicyDirective.ts.html new file mode 100644 index 000000000..b3b9f478a --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/typePolicyDirective.ts.html @@ -0,0 +1,616 @@ + + + + + + Code coverage report for src/utilities/typePolicyDirective.ts + + + + + + + + + +
+
+

All files / src/utilities typePolicyDirective.ts

+
+ +
+ 42.62% + Statements + 26/61 +
+ + +
+ 30.3% + Branches + 20/66 +
+ + +
+ 44.44% + Functions + 4/9 +
+ + +
+ 41.66% + Lines + 25/60 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +1781x +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +101x +  +  +  +101x +12x +12x +  +12x +  +  +  +  +  +101x +5x +  +  +  +  +  +101x +101x +4x +4x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +101x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +97x +97x +97x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +12x +  +12x +158x +  +158x +97x +  +  +  + 
import {
+  DirectiveNode,
+  GraphQLCompositeType,
+  GraphQLError,
+  GraphQLInterfaceType,
+  GraphQLObjectType,
+  GraphQLSchema,
+  isInterfaceType,
+  isNonNullType,
+  isScalarType,
+  isUnionType,
+  Kind,
+  valueFromASTUntyped,
+} from "graphql";
+import { directive_typePolicy } from "./apolloCodegenSchemaExtension";
+ 
+const directiveName = directive_typePolicy.name.value;
+ 
+type TypePolicyDirectiveResult = {
+  directive: DirectiveNode;
+  source: GraphQLObjectType | GraphQLInterfaceType;
+};
+ 
+function matchDirectiveArguments(
+  first: DirectiveNode,
+  second: DirectiveNode
+): boolean {
+  return (
+    (first.arguments ?? [])
+      .map((node) =>
+        JSON.stringify([node.name.value, valueFromASTUntyped(node.value)])
+      )
+      .sort()
+      .toString() ===
+    (second.arguments ?? [])
+      .map((node) =>
+        JSON.stringify([node.name.value, valueFromASTUntyped(node.value)])
+      )
+      .sort()
+      .toString()
+  );
+}
+ 
+function typePolicyDirectiveFor(
+  type: GraphQLCompositeType
+): TypePolicyDirectiveResult | undefined {
+  Iif (isUnionType(type)) {
+    return undefined;
+  }
+ 
+  for (const extension of type.extensionASTNodes ?? []) {
+    const directive = extension.directives?.find(
+      (d) => d.name.value === directiveName
+    );
+    Iif (directive) {
+      return { directive, source: type };
+    }
+  }
+ 
+  let result: TypePolicyDirectiveResult | undefined;
+  for (const directive of type.astNode?.directives ?? []) {
+    Iif (directive.name.value === directiveName) {
+      result = { directive, source: type };
+      break;
+    }
+  }
+ 
+  if ("getInterfaces" in type) {
+    for (const interfaceType of type.getInterfaces()) {
+      const found = typePolicyDirectiveFor(interfaceType);
+      if (!found) continue;
+ 
+      if (!result) {
+        result = found;
+      } else Iif (!matchDirectiveArguments(result.directive, found.directive)) {
+        if (result.source === type) {
+          throw new GraphQLError(
+            `Type "${type.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${found.source.name}".`,
+            { nodes: type.astNode }
+          );
+        } else {
+          throw new GraphQLError(
+            `Type "${type.name}" inherits conflicting @typePolicy directives from interfaces "${result.source.name}" and "${found.source.name}".`,
+            { nodes: type.astNode }
+          );
+        }
+      }
+    }
+  }
+ 
+  return result;
+}
+ 
+function validateKeyFields(
+  result: TypePolicyDirectiveResult,
+  keyFields: string[]
+) {
+  const { directive, source: type } = result;
+ 
+  Iif (isUnionType(type)) {
+    return;
+  }
+ 
+  const label = isInterfaceType(type) ? "interface" : "object";
+ 
+  var allFields = type.getFields();
+  for (const keyField of keyFields) {
+    Iif (!keyField) {
+      throw new GraphQLError(
+        `Key fields must be a space-separated list of identifiers.`,
+        { nodes: directive }
+      );
+    }
+ 
+    const actualField = allFields[keyField];
+    Iif (!actualField) {
+      throw new GraphQLError(
+        `Key field "${keyField}" does not exist on ${label} "${type.name}".`,
+        { nodes: type.astNode ? [type.astNode, directive] : directive }
+      );
+    }
+ 
+    Iif (!isNonNullType(actualField.type)) {
+      throw new GraphQLError(
+        `Key field "${keyField}" on ${label} "${type.name}" must be non-nullable.`,
+        {
+          nodes: actualField.astNode
+            ? [actualField.astNode, directive]
+            : directive,
+        }
+      );
+    }
+ 
+    Iif (!isScalarType(actualField.type.ofType)) {
+      throw new GraphQLError(
+        `Key field "${keyField}" on ${label} "${type.name}" must be a scalar type, got ${actualField.type}.`,
+        {
+          nodes: actualField.astNode
+            ? [actualField.astNode, directive]
+            : directive,
+        }
+      );
+    }
+  }
+}
+ 
+export function keyFieldsFor(type: GraphQLCompositeType): string[] {
+  const result = typePolicyDirectiveFor(type);
+  if (!result) {
+    return [];
+  }
+ 
+  const argumentValue = result.directive?.arguments?.find(
+    (b) => b.name.value === "keyFields"
+  )?.value;
+  Iif (!argumentValue || argumentValue.kind !== Kind.STRING) {
+    return [];
+  }
+ 
+  const fields = argumentValue.value.split(" ");
+ 
+  validateKeyFields(result, fields);
+ 
+  return fields;
+}
+ 
+export function addTypePolicyDirectivesToSchema(schema: GraphQLSchema) {
+  const types = schema.getTypeMap();
+ 
+  for (const key in types) {
+    const type = types[key];
+ 
+    if (type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) {
+      (type as any)._apolloKeyFields = keyFieldsFor(type);
+    }
+  }
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/validationRules.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/validationRules.ts.html new file mode 100644 index 000000000..647af99d9 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/validationRules.ts.html @@ -0,0 +1,547 @@ + + + + + + Code coverage report for src/validationRules.ts + + + + + + + + + +
+
+

All files / src validationRules.ts

+
+ +
+ 14.58% + Statements + 7/48 +
+ + +
+ 0% + Branches + 0/32 +
+ + +
+ 0% + Functions + 0/17 +
+ + +
+ 14.58% + Lines + 7/48 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +1551x +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import {
+  NoUnusedFragmentsRule,
+  ValidationRule,
+  specifiedRules,
+  FieldNode,
+  GraphQLError,
+  OperationDefinitionNode,
+  ValidationContext,
+  VariableDefinitionNode,
+  InlineFragmentNode,
+  GraphQLDeferDirective,
+} from "graphql";
+ 
+const specifiedRulesToBeRemoved: [ValidationRule] = [NoUnusedFragmentsRule];
+ 
+export interface DisallowedFieldNames {
+  allFields?: Array<string>
+  entity?: Array<string>
+  entityList?: Array<string>
+}
+ 
+export interface ValidationOptions {
+  schemaNamespace?: string
+  disallowedFieldNames?: DisallowedFieldNames
+  disallowedInputParameterNames?: Array<string>
+}
+ 
+export function defaultValidationRules(options: ValidationOptions): ValidationRule[] {
+  const disallowedFieldNamesRule = ApolloIOSDisallowedFieldNames(options.disallowedFieldNames?.allFields)
+  const disallowedInputParameterNamesRule = ApolloIOSDisallowedInputParameterNames(options.disallowedInputParameterNames)
+  return [
+    NoAnonymousQueries,
+    NoTypenameAlias,
+    DeferredInlineFragmentNoTypeCondition,
+    DeferredInlineFragmentMissingLabelArgument,
+    ...(disallowedFieldNamesRule ? [disallowedFieldNamesRule] : []),
+    ...(disallowedInputParameterNamesRule ? [disallowedInputParameterNamesRule] : []),
+    ...specifiedRules.filter((rule) => !specifiedRulesToBeRemoved.includes(rule)),
+  ];
+}
+ 
+export function NoAnonymousQueries(context: ValidationContext) {
+  return {
+    OperationDefinition(node: OperationDefinitionNode) {
+      Iif (!node.name) {
+        context.reportError(
+          new GraphQLError(
+            "Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",
+            { nodes: node })
+        );
+      }
+      return false;
+    },
+  };
+}
+ 
+export function NoTypenameAlias(context: ValidationContext) {
+  return {
+    Field(node: FieldNode) {
+      const aliasName = node.alias && node.alias.value;
+      Iif (aliasName == "__typename") {
+        context.reportError(
+          new GraphQLError(
+            "Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",
+            { nodes: node })
+        );
+      }
+    },
+  };
+}
+ 
+export function DeferredInlineFragmentNoTypeCondition(context: ValidationContext) {
+  return {
+    InlineFragment(node: InlineFragmentNode) {
+      Iif (node.directives) {
+        for (const directive of node.directives) {
+          Iif (directive.name.value == GraphQLDeferDirective.name && node.typeCondition == undefined) {
+            context.reportError(
+              new GraphQLError(
+                "Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",
+                { nodes: node }
+              )
+            )
+          }
+        }
+      }
+    },
+  };
+}
+ 
+export function DeferredInlineFragmentMissingLabelArgument(context: ValidationContext) {
+  return {
+    InlineFragment(node: InlineFragmentNode) {
+      Iif (node.directives) {
+        for (const directive of node.directives) {
+          Iif (directive.name.value == GraphQLDeferDirective.name && !(directive.arguments?.find((element) =>
+            element.name.value == 'label'
+          ))) {
+            context.reportError(
+              new GraphQLError(
+                "Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",
+                { nodes: node }
+              )
+            )
+          }
+        }
+      }
+    }
+  }
+}
+ 
+function ApolloIOSDisallowedFieldNames(fieldNames?: Array<string>) {
+  Iif (fieldNames) {
+    return function ApolloIOSDisallowedFieldNamesValidationRule(context: ValidationContext) {
+      const disallowedFieldNames = fieldNames
+      return {
+        Field(node: FieldNode) {
+          const responseKey = (node.alias ?? node.name).value
+          const responseKeyFirstLowercase = responseKey.charAt(0).toLowerCase() + responseKey.slice(1)
+          Iif (disallowedFieldNames.includes(responseKeyFirstLowercase)) {
+            context.reportError(
+              new GraphQLError(
+                `Field name "${responseKey}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,
+                { nodes: node })
+            );
+          }
+        },
+      };
+    }
+  }
+  return undefined
+}
+ 
+function ApolloIOSDisallowedInputParameterNames(names?: Array<string>) {
+  Iif (names) {
+    return function ApolloIOSDisallowedInputParameterNamesValidationRule(context: ValidationContext) {
+      const disallowedNames = names
+      return {
+        VariableDefinition(node: VariableDefinitionNode) {
+          const parameterName = node.variable.name.value
+          const parameterNameFirstLowercase = parameterName.charAt(0).toLowerCase() + parameterName.slice(1)
+          Iif (disallowedNames.includes(parameterNameFirstLowercase)) {
+            context.reportError(
+              new GraphQLError(
+                `Input Parameter name "${parameterName}" is not allowed because it conflicts with generated object APIs.`,
+                { nodes: node })
+            );
+          }
+        },
+      };
+    }
+  }
+  return undefined
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov.info b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov.info new file mode 100644 index 000000000..cba73cba3 --- /dev/null +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov.info @@ -0,0 +1,1346 @@ +TN: +SF:src/index.ts +FN:30,(anonymous_0) +FN:31,(anonymous_1) +FN:32,(anonymous_2) +FN:33,(anonymous_3) +FN:34,(anonymous_4) +FN:35,(anonymous_5) +FN:36,(anonymous_6) +FN:37,(anonymous_7) +FN:38,(anonymous_8) +FN:40,(anonymous_9) +FN:42,loadSchemaFromSources +FN:84,loadSchemaFromIntrospectionResult +FN:98,printSchemaToSDL +FN:102,parseOperationDocument +FN:106,mergeDocuments +FN:110,validateDocument +FN:118,compileDocument +FNF:17 +FNH:1 +FNDA:0,(anonymous_0) +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,(anonymous_9) +FNDA:12,loadSchemaFromSources +FNDA:0,loadSchemaFromIntrospectionResult +FNDA:0,printSchemaToSDL +FNDA:0,parseOperationDocument +FNDA:0,mergeDocuments +FNDA:0,validateDocument +FNDA:0,compileDocument +DA:1,1 +DA:14,1 +DA:15,1 +DA:16,1 +DA:17,1 +DA:20,1 +DA:24,1 +DA:25,1 +DA:29,1 +DA:30,1 +DA:31,1 +DA:32,1 +DA:33,1 +DA:34,1 +DA:35,1 +DA:36,1 +DA:37,1 +DA:38,1 +DA:40,1 +DA:42,1 +DA:45,12 +DA:46,12 +DA:47,12 +DA:48,0 +DA:49,0 +DA:51,0 +DA:55,12 +DA:59,12 +DA:61,12 +DA:62,12 +DA:63,12 +DA:65,12 +DA:66,12 +DA:67,12 +DA:68,7 +DA:70,7 +DA:73,0 +DA:74,0 +DA:75,0 +DA:76,0 +DA:77,0 +DA:78,0 +DA:80,0 +DA:87,0 +DA:89,0 +DA:90,0 +DA:93,0 +DA:95,0 +DA:98,1 +DA:99,0 +DA:102,1 +DA:103,0 +DA:106,1 +DA:107,0 +DA:110,1 +DA:115,0 +DA:118,1 +DA:125,0 +LF:58 +LH:38 +BRDA:47,0,0,0 +BRDA:47,0,1,12 +BRDA:48,1,0,0 +BRDA:48,1,1,0 +BRDA:61,2,0,12 +BRDA:61,2,1,0 +BRDA:89,3,0,0 +BRF:7 +BRH:2 +end_of_record +TN: +SF:src/validationRules.ts +FN:28,defaultValidationRules +FN:38,(anonymous_1) +FN:42,NoAnonymousQueries +FN:44,(anonymous_3) +FN:57,NoTypenameAlias +FN:59,(anonymous_5) +FN:72,DeferredInlineFragmentNoTypeCondition +FN:74,(anonymous_7) +FN:91,DeferredInlineFragmentMissingLabelArgument +FN:93,(anonymous_9) +FN:96,(anonymous_10) +FN:112,ApolloIOSDisallowedFieldNames +FN:114,ApolloIOSDisallowedFieldNamesValidationRule +FN:117,(anonymous_13) +FN:134,ApolloIOSDisallowedInputParameterNames +FN:136,ApolloIOSDisallowedInputParameterNamesValidationRule +FN:139,(anonymous_16) +FNF:17 +FNH:0 +FNDA:0,defaultValidationRules +FNDA:0,(anonymous_1) +FNDA:0,NoAnonymousQueries +FNDA:0,(anonymous_3) +FNDA:0,NoTypenameAlias +FNDA:0,(anonymous_5) +FNDA:0,DeferredInlineFragmentNoTypeCondition +FNDA:0,(anonymous_7) +FNDA:0,DeferredInlineFragmentMissingLabelArgument +FNDA:0,(anonymous_9) +FNDA:0,(anonymous_10) +FNDA:0,ApolloIOSDisallowedFieldNames +FNDA:0,ApolloIOSDisallowedFieldNamesValidationRule +FNDA:0,(anonymous_13) +FNDA:0,ApolloIOSDisallowedInputParameterNames +FNDA:0,ApolloIOSDisallowedInputParameterNamesValidationRule +FNDA:0,(anonymous_16) +DA:1,1 +DA:14,1 +DA:28,1 +DA:29,0 +DA:30,0 +DA:31,0 +DA:38,0 +DA:42,1 +DA:43,0 +DA:45,0 +DA:46,0 +DA:52,0 +DA:57,1 +DA:58,0 +DA:60,0 +DA:61,0 +DA:62,0 +DA:72,1 +DA:73,0 +DA:75,0 +DA:76,0 +DA:77,0 +DA:78,0 +DA:91,1 +DA:92,0 +DA:94,0 +DA:95,0 +DA:96,0 +DA:97,0 +DA:99,0 +DA:113,0 +DA:114,0 +DA:115,0 +DA:116,0 +DA:118,0 +DA:119,0 +DA:120,0 +DA:121,0 +DA:131,0 +DA:135,0 +DA:136,0 +DA:137,0 +DA:138,0 +DA:140,0 +DA:141,0 +DA:142,0 +DA:143,0 +DA:153,0 +LF:48 +LH:7 +BRDA:29,0,0,0 +BRDA:29,0,1,0 +BRDA:29,1,0,0 +BRDA:29,1,1,0 +BRDA:36,2,0,0 +BRDA:36,2,1,0 +BRDA:37,3,0,0 +BRDA:37,3,1,0 +BRDA:45,4,0,0 +BRDA:60,5,0,0 +BRDA:60,5,1,0 +BRDA:61,6,0,0 +BRDA:75,7,0,0 +BRDA:77,8,0,0 +BRDA:77,9,0,0 +BRDA:77,9,1,0 +BRDA:94,10,0,0 +BRDA:96,11,0,0 +BRDA:96,12,0,0 +BRDA:96,12,1,0 +BRDA:96,13,0,0 +BRDA:96,13,1,0 +BRDA:96,14,0,0 +BRDA:96,14,1,0 +BRDA:113,15,0,0 +BRDA:118,16,0,0 +BRDA:118,16,1,0 +BRDA:118,17,0,0 +BRDA:118,17,1,0 +BRDA:120,18,0,0 +BRDA:135,19,0,0 +BRDA:142,20,0,0 +BRF:32 +BRH:0 +end_of_record +TN: +SF:src/compiler/index.ts +FN:45,filePathForNode +FN:57,compileToIR +FN:111,addReferencedType +FN:146,addReferencedTypesFromInputObject +FN:156,hasTypePolicyDirective +FN:168,getFragment +FN:183,compileOperation +FN:196,(anonymous_7) +FN:253,compileFragment +FN:293,overrideAsLocalCacheMutation +FN:296,(anonymous_10) +FN:302,compileSelectionSet +FN:310,(anonymous_12) +FN:317,compileSelection +FN:358,validateFieldName +FN:441,compileArguments +FN:448,(anonymous_16) +FN:451,(anonymous_17) +FN:472,compileDirectives +FN:511,compileInclusionCondition +FNF:20 +FNH:0 +FNDA:0,filePathForNode +FNDA:0,compileToIR +FNDA:0,addReferencedType +FNDA:0,addReferencedTypesFromInputObject +FNDA:0,hasTypePolicyDirective +FNDA:0,getFragment +FNDA:0,compileOperation +FNDA:0,(anonymous_7) +FNDA:0,compileFragment +FNDA:0,overrideAsLocalCacheMutation +FNDA:0,(anonymous_10) +FNDA:0,compileSelectionSet +FNDA:0,(anonymous_12) +FNDA:0,compileSelection +FNDA:0,validateFieldName +FNDA:0,compileArguments +FNDA:0,(anonymous_16) +FNDA:0,(anonymous_17) +FNDA:0,compileDirectives +FNDA:0,compileInclusionCondition +DA:1,1 +DA:8,1 +DA:41,1 +DA:43,1 +DA:46,0 +DA:57,1 +DA:65,0 +DA:67,0 +DA:68,0 +DA:70,0 +DA:73,0 +DA:74,0 +DA:75,0 +DA:76,0 +DA:78,0 +DA:79,0 +DA:80,0 +DA:83,0 +DA:89,0 +DA:90,0 +DA:92,0 +DA:99,0 +DA:100,0 +DA:103,0 +DA:112,0 +DA:114,0 +DA:116,0 +DA:117,0 +DA:119,0 +DA:121,0 +DA:122,0 +DA:123,0 +DA:128,0 +DA:129,0 +DA:130,0 +DA:131,0 +DA:135,0 +DA:136,0 +DA:139,0 +DA:140,0 +DA:141,0 +DA:149,0 +DA:150,0 +DA:151,0 +DA:152,0 +DA:159,0 +DA:160,0 +DA:161,0 +DA:162,0 +DA:165,0 +DA:169,0 +DA:170,0 +DA:172,0 +DA:173,0 +DA:176,0 +DA:178,0 +DA:179,0 +DA:180,0 +DA:186,0 +DA:187,0 +DA:190,0 +DA:191,0 +DA:192,0 +DA:193,0 +DA:195,0 +DA:197,0 +DA:198,0 +DA:203,0 +DA:207,0 +DA:208,0 +DA:214,0 +DA:216,0 +DA:224,0 +DA:228,0 +DA:229,0 +DA:231,0 +DA:233,0 +DA:234,0 +DA:236,0 +DA:237,0 +DA:240,0 +DA:256,0 +DA:258,0 +DA:259,0 +DA:263,0 +DA:265,0 +DA:270,0 +DA:272,0 +DA:274,0 +DA:275,0 +DA:277,0 +DA:278,0 +DA:281,0 +DA:296,0 +DA:297,0 +DA:298,0 +DA:307,0 +DA:311,0 +DA:322,0 +DA:324,0 +DA:326,0 +DA:327,0 +DA:328,0 +DA:330,0 +DA:331,0 +DA:332,0 +DA:338,0 +DA:339,0 +DA:341,0 +DA:343,0 +DA:344,0 +DA:346,0 +DA:359,0 +DA:360,0 +DA:361,0 +DA:363,0 +DA:364,0 +DA:372,0 +DA:373,0 +DA:374,0 +DA:375,0 +DA:378,0 +DA:379,0 +DA:381,0 +DA:382,0 +DA:390,0 +DA:396,0 +DA:399,0 +DA:400,0 +DA:404,0 +DA:406,0 +DA:418,0 +DA:420,0 +DA:421,0 +DA:422,0 +DA:428,0 +DA:430,0 +DA:436,0 +DA:446,0 +DA:447,0 +DA:449,0 +DA:450,0 +DA:451,0 +DA:453,0 +DA:455,0 +DA:456,0 +DA:462,0 +DA:475,0 +DA:476,0 +DA:477,0 +DA:479,0 +DA:480,0 +DA:481,0 +DA:483,0 +DA:484,0 +DA:490,0 +DA:497,0 +DA:498,0 +DA:501,0 +DA:507,0 +DA:515,0 +DA:516,0 +DA:517,0 +DA:519,0 +DA:521,0 +DA:522,0 +DA:524,0 +DA:528,0 +DA:534,0 +DA:538,0 +DA:541,0 +LF:171 +LH:5 +BRDA:46,0,0,0 +BRDA:46,0,1,0 +BRDA:46,1,0,0 +BRDA:46,1,1,0 +BRDA:46,2,0,0 +BRDA:46,2,1,0 +BRDA:46,3,0,0 +BRDA:46,3,1,0 +BRDA:68,4,0,0 +BRDA:79,5,0,0 +BRDA:85,6,0,0 +BRDA:85,6,1,0 +BRDA:85,7,0,0 +BRDA:85,7,1,0 +BRDA:86,8,0,0 +BRDA:86,8,1,0 +BRDA:86,9,0,0 +BRDA:86,9,1,0 +BRDA:90,10,0,0 +BRDA:108,11,0,0 +BRDA:108,11,1,0 +BRDA:108,12,0,0 +BRDA:108,12,1,0 +BRDA:112,13,0,0 +BRDA:116,14,0,0 +BRDA:122,15,0,0 +BRDA:122,16,0,0 +BRDA:122,16,1,0 +BRDA:128,17,0,0 +BRDA:135,18,0,0 +BRDA:139,19,0,0 +BRDA:160,20,0,0 +BRDA:160,20,1,0 +BRDA:160,21,0,0 +BRDA:160,21,1,0 +BRDA:160,22,0,0 +BRDA:160,22,1,0 +BRDA:160,23,0,0 +BRDA:160,23,1,0 +BRDA:161,24,0,0 +BRDA:170,25,0,0 +BRDA:173,26,0,0 +BRDA:186,27,0,0 +BRDA:195,28,0,0 +BRDA:195,28,1,0 +BRDA:198,29,0,0 +BRDA:198,29,1,0 +BRDA:207,30,0,0 +BRDA:229,31,0,0 +BRDA:229,31,1,0 +BRDA:229,32,0,0 +BRDA:229,32,1,0 +BRDA:236,33,0,0 +BRDA:270,34,0,0 +BRDA:270,34,1,0 +BRDA:270,35,0,0 +BRDA:270,35,1,0 +BRDA:277,36,0,0 +BRDA:322,37,0,0 +BRDA:322,37,1,0 +BRDA:322,38,0,0 +BRDA:322,38,1,0 +BRDA:324,39,0,0 +BRDA:324,39,1,0 +BRDA:324,39,2,0 +BRDA:327,40,0,0 +BRDA:328,41,0,0 +BRDA:328,41,1,0 +BRDA:328,42,0,0 +BRDA:328,42,1,0 +BRDA:331,43,0,0 +BRDA:353,44,0,0 +BRDA:353,44,1,0 +BRDA:353,45,0,0 +BRDA:353,45,1,0 +BRDA:354,46,0,0 +BRDA:354,46,1,0 +BRDA:359,47,0,0 +BRDA:359,48,0,0 +BRDA:359,48,1,0 +BRDA:360,49,0,0 +BRDA:360,49,1,0 +BRDA:360,50,0,0 +BRDA:360,50,1,0 +BRDA:363,51,0,0 +BRDA:363,52,0,0 +BRDA:363,52,1,0 +BRDA:363,53,0,0 +BRDA:363,53,1,0 +BRDA:372,54,0,0 +BRDA:372,54,1,0 +BRDA:372,55,0,0 +BRDA:372,55,1,0 +BRDA:372,55,2,0 +BRDA:373,56,0,0 +BRDA:373,56,1,0 +BRDA:373,57,0,0 +BRDA:373,57,1,0 +BRDA:374,58,0,0 +BRDA:375,59,0,0 +BRDA:375,59,1,0 +BRDA:375,60,0,0 +BRDA:375,60,1,0 +BRDA:378,61,0,0 +BRDA:381,62,0,0 +BRDA:400,63,0,0 +BRDA:400,63,1,0 +BRDA:421,64,0,0 +BRDA:447,65,0,0 +BRDA:447,65,1,0 +BRDA:447,66,0,0 +BRDA:447,66,1,0 +BRDA:453,67,0,0 +BRDA:453,67,1,0 +BRDA:453,68,0,0 +BRDA:453,68,1,0 +BRDA:455,69,0,0 +BRDA:466,70,0,0 +BRDA:466,70,1,0 +BRDA:466,71,0,0 +BRDA:466,71,1,0 +BRDA:475,72,0,0 +BRDA:475,72,1,0 +BRDA:475,73,0,0 +BRDA:475,73,1,0 +BRDA:483,74,0,0 +BRDA:498,75,0,0 +BRDA:503,76,0,0 +BRDA:503,76,1,0 +BRDA:515,77,0,0 +BRDA:515,77,1,0 +BRDA:515,78,0,0 +BRDA:515,78,1,0 +BRDA:516,79,0,0 +BRDA:516,79,1,0 +BRDA:516,80,0,0 +BRDA:516,80,1,0 +BRDA:519,81,0,0 +BRDA:519,81,1,0 +BRDA:519,81,2,0 +BRDA:519,82,0,0 +BRDA:519,82,1,0 +BRDA:519,83,0,0 +BRDA:519,83,1,0 +BRDA:521,84,0,0 +BRDA:521,84,1,0 +BRDA:522,85,0,0 +BRDA:522,85,1,0 +BRDA:524,86,0,0 +BRDA:524,86,1,0 +BRF:150 +BRH:0 +end_of_record +TN: +SF:src/compiler/values.ts +FN:28,valueFromValueNode +FN:40,(anonymous_1) +FNF:2 +FNH:0 +FNDA:0,valueFromValueNode +FNDA:0,(anonymous_1) +DA:1,1 +DA:28,1 +DA:29,0 +DA:31,0 +DA:33,0 +DA:38,0 +DA:41,0 +DA:42,0 +DA:46,0 +LF:9 +LH:2 +BRDA:29,0,0,0 +BRDA:29,0,1,0 +BRDA:29,0,2,0 +BRDA:29,0,3,0 +BRF:4 +BRH:0 +end_of_record +TN: +SF:src/utilities/apolloCodegenSchemaExtension.ts +FN:73,addApolloCodegenSchemaExtensionToDocument +FN:74,(anonymous_1) +FN:74,(anonymous_2) +FNF:3 +FNH:3 +FNDA:12,addApolloCodegenSchemaExtensionToDocument +FNDA:48,(anonymous_1) +FNDA:140,(anonymous_2) +DA:1,1 +DA:2,1 +DA:4,1 +DA:12,1 +DA:28,1 +DA:50,1 +DA:66,1 +DA:73,1 +DA:74,48 +DA:75,140 +DA:79,12 +LF:11 +LH:11 +BRDA:75,0,0,140 +BRDA:75,0,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:src/utilities/experimentalDeferDirective.ts +FN:19,addExperimentalDeferDirectiveToSDLDocument +FN:34,(anonymous_1) +FN:53,addExperimentalDeferDirectiveToIntrospectionSchema +FN:70,isDeferDirectiveDefinitionNodePredicate +FN:77,experimentalDeferDirectiveDocumentNode +FN:86,matchDirectiveDefinition +FN:89,(anonymous_6) +FN:90,(anonymous_7) +FN:90,(anonymous_8) +FN:96,matchDirective +FN:100,(anonymous_10) +FN:100,(anonymous_11) +FNF:12 +FNH:3 +FNDA:12,addExperimentalDeferDirectiveToSDLDocument +FNDA:0,(anonymous_1) +FNDA:0,addExperimentalDeferDirectiveToIntrospectionSchema +FNDA:83,isDeferDirectiveDefinitionNodePredicate +FNDA:12,experimentalDeferDirectiveDocumentNode +FNDA:0,matchDirectiveDefinition +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +FNDA:0,(anonymous_8) +FNDA:0,matchDirective +FNDA:0,(anonymous_10) +FNDA:0,(anonymous_11) +DA:1,1 +DA:11,1 +DA:19,1 +DA:20,12 +DA:22,12 +DA:23,12 +DA:26,0 +DA:28,0 +DA:29,0 +DA:31,0 +DA:34,0 +DA:38,0 +DA:41,0 +DA:53,1 +DA:54,0 +DA:56,0 +DA:57,0 +DA:60,0 +DA:61,0 +DA:63,0 +DA:66,0 +DA:71,83 +DA:78,12 +DA:87,0 +DA:89,0 +DA:90,0 +DA:97,0 +DA:100,0 +LF:28 +LH:9 +BRDA:22,0,0,12 +BRDA:28,1,0,0 +BRDA:34,2,0,0 +BRDA:34,2,1,0 +BRDA:56,3,0,0 +BRDA:60,4,0,0 +BRDA:72,5,0,83 +BRDA:72,5,1,48 +BRDA:88,6,0,0 +BRDA:88,6,1,0 +BRDA:88,6,2,0 +BRDA:90,7,0,0 +BRDA:90,7,1,0 +BRDA:90,8,0,0 +BRDA:90,8,1,0 +BRDA:98,9,0,0 +BRDA:98,9,1,0 +BRDA:98,9,2,0 +BRF:18 +BRH:3 +end_of_record +TN: +SF:src/utilities/fieldPolicyDirective.ts +FN:24,addFieldPolicyDirectivesToSchema +FN:39,applyFieldPoliciesFor +FN:51,(anonymous_2) +FN:66,(anonymous_3) +FN:92,(anonymous_4) +FN:141,fieldPolicyDirectivesFor +FN:152,(anonymous_6) +FN:191,matchDirectiveArguments +FN:197,(anonymous_8) +FN:203,(anonymous_9) +FNF:10 +FNH:10 +FNDA:12,addFieldPolicyDirectivesToSchema +FNDA:62,applyFieldPoliciesFor +FNDA:15,(anonymous_2) +FNDA:30,(anonymous_3) +FNDA:18,(anonymous_4) +FNDA:66,fieldPolicyDirectivesFor +FNDA:12,(anonymous_6) +FNDA:2,matchDirectiveArguments +FNDA:4,(anonymous_8) +FNDA:4,(anonymous_9) +DA:1,1 +DA:15,1 +DA:17,1 +DA:24,1 +DA:27,12 +DA:29,12 +DA:30,98 +DA:32,98 +DA:34,62 +DA:39,1 +DA:42,62 +DA:43,62 +DA:44,0 +DA:47,62 +DA:49,62 +DA:50,15 +DA:51,15 +DA:53,15 +DA:54,15 +DA:55,15 +DA:58,15 +DA:59,0 +DA:65,15 +DA:66,30 +DA:68,15 +DA:69,15 +DA:70,15 +DA:71,15 +DA:74,15 +DA:75,0 +DA:82,15 +DA:83,15 +DA:84,0 +DA:91,15 +DA:92,18 +DA:93,15 +DA:94,18 +DA:95,1 +DA:105,14 +DA:106,14 +DA:107,14 +DA:109,14 +DA:110,16 +DA:111,4 +DA:116,14 +DA:117,1 +DA:125,13 +DA:126,3 +DA:133,10 +DA:134,10 +DA:136,0 +DA:144,66 +DA:145,0 +DA:148,66 +DA:150,66 +DA:151,12 +DA:152,12 +DA:154,12 +DA:155,12 +DA:159,66 +DA:160,5 +DA:161,5 +DA:165,66 +DA:166,66 +DA:167,4 +DA:168,4 +DA:169,0 +DA:172,4 +DA:173,4 +DA:174,4 +DA:175,2 +DA:176,2 +DA:177,2 +DA:181,4 +DA:182,2 +DA:188,66 +DA:195,2 +DA:198,4 +DA:204,4 +LF:79 +LH:72 +BRDA:32,0,0,62 +BRDA:32,1,0,98 +BRDA:32,1,1,41 +BRDA:43,2,0,0 +BRDA:43,3,0,62 +BRDA:43,3,1,62 +BRDA:50,4,0,0 +BRDA:50,4,1,15 +BRDA:50,5,0,15 +BRDA:50,5,1,15 +BRDA:50,6,0,0 +BRDA:50,6,1,15 +BRDA:50,7,0,15 +BRDA:50,7,1,15 +BRDA:54,8,0,15 +BRDA:54,9,0,0 +BRDA:54,9,1,15 +BRDA:54,10,0,15 +BRDA:54,10,1,15 +BRDA:58,11,0,0 +BRDA:65,12,0,0 +BRDA:65,12,1,15 +BRDA:65,13,0,15 +BRDA:65,13,1,15 +BRDA:65,14,0,0 +BRDA:65,14,1,15 +BRDA:65,15,0,15 +BRDA:65,15,1,15 +BRDA:69,16,0,15 +BRDA:69,17,0,0 +BRDA:69,17,1,15 +BRDA:69,18,0,15 +BRDA:69,18,1,15 +BRDA:74,19,0,0 +BRDA:83,20,0,0 +BRDA:86,21,0,0 +BRDA:86,21,1,0 +BRDA:91,22,0,0 +BRDA:91,22,1,15 +BRDA:91,23,0,15 +BRDA:91,23,1,15 +BRDA:92,24,0,15 +BRDA:92,24,1,0 +BRDA:92,25,0,15 +BRDA:92,25,1,15 +BRDA:92,26,0,0 +BRDA:92,26,1,15 +BRDA:92,27,0,15 +BRDA:92,27,1,15 +BRDA:94,28,0,1 +BRDA:105,29,0,14 +BRDA:110,30,0,4 +BRDA:116,31,0,1 +BRDA:125,32,0,3 +BRDA:125,33,0,13 +BRDA:125,33,1,3 +BRDA:125,33,2,11 +BRDA:125,33,3,2 +BRDA:133,34,0,10 +BRDA:133,34,1,0 +BRDA:144,35,0,0 +BRDA:144,36,0,66 +BRDA:144,36,1,9 +BRDA:150,37,0,66 +BRDA:150,37,1,0 +BRDA:150,38,0,66 +BRDA:150,38,1,66 +BRDA:151,39,0,0 +BRDA:151,39,1,12 +BRDA:151,40,0,12 +BRDA:151,40,1,12 +BRDA:154,41,0,12 +BRDA:159,42,0,5 +BRDA:159,42,1,61 +BRDA:159,43,0,66 +BRDA:159,43,1,66 +BRDA:159,44,0,42 +BRDA:159,44,1,24 +BRDA:159,45,0,66 +BRDA:159,45,1,66 +BRDA:160,46,0,5 +BRDA:165,47,0,66 +BRDA:168,48,0,0 +BRDA:175,49,0,2 +BRDA:181,50,0,2 +BRDA:196,51,0,2 +BRDA:196,51,1,0 +BRDA:196,52,0,2 +BRDA:196,52,1,2 +BRDA:202,53,0,2 +BRDA:202,53,1,0 +BRDA:202,54,0,2 +BRDA:202,54,1,2 +BRF:93 +BRH:71 +end_of_record +TN: +SF:src/utilities/graphql.ts +FN:29,(anonymous_0) +FN:30,(anonymous_1) +FN:36,assertValidSDL +FN:43,assertValidSchema +FN:50,sourceAt +FN:54,filePathForNode +FN:58,isMetaFieldName +FN:62,containsLocalCacheMutationDirective +FN:79,transformToNetworkRequestSourceDefinition +FN:89,(anonymous_9) +FN:97,(anonymous_10) +FN:102,(anonymous_11) +FN:109,addTypenameFieldToSelectionSetIfNeeded +FN:110,(anonymous_13) +FN:124,transformTypenameFieldIfNeeded +FN:136,stripApolloClientSpecificDirectives +FN:158,getFieldDef +FNF:17 +FNH:2 +FNDA:0,(anonymous_0) +FNDA:0,(anonymous_1) +FNDA:12,assertValidSDL +FNDA:7,assertValidSchema +FNDA:0,sourceAt +FNDA:0,filePathForNode +FNDA:0,isMetaFieldName +FNDA:0,containsLocalCacheMutationDirective +FNDA:0,transformToNetworkRequestSourceDefinition +FNDA:0,(anonymous_9) +FNDA:0,(anonymous_10) +FNDA:0,(anonymous_11) +FNDA:0,addTypenameFieldToSelectionSetIfNeeded +FNDA:0,(anonymous_13) +FNDA:0,transformTypenameFieldIfNeeded +FNDA:0,stripApolloClientSpecificDirectives +FNDA:0,getFieldDef +DA:1,1 +DA:23,1 +DA:24,1 +DA:25,1 +DA:26,1 +DA:28,1 +DA:29,0 +DA:30,0 +DA:32,0 +DA:36,1 +DA:37,12 +DA:38,12 +DA:39,0 +DA:43,1 +DA:44,7 +DA:45,7 +DA:46,0 +DA:50,1 +DA:51,0 +DA:54,1 +DA:55,0 +DA:58,1 +DA:59,0 +DA:62,1 +DA:63,0 +DA:65,0 +DA:66,0 +DA:67,0 +DA:71,0 +DA:74,1 +DA:79,1 +DA:83,0 +DA:84,0 +DA:87,0 +DA:90,0 +DA:91,0 +DA:93,0 +DA:98,0 +DA:103,0 +DA:110,0 +DA:111,0 +DA:114,0 +DA:115,0 +DA:117,0 +DA:125,0 +DA:126,0 +DA:132,0 +DA:137,0 +DA:142,0 +DA:143,0 +DA:144,0 +DA:148,0 +DA:158,1 +DA:163,0 +DA:167,0 +DA:169,0 +DA:170,0 +DA:172,0 +DA:178,0 +DA:180,0 +DA:181,0 +DA:184,0 +LF:62 +LH:19 +BRDA:38,0,0,0 +BRDA:45,1,0,0 +BRDA:55,2,0,0 +BRDA:55,2,1,0 +BRDA:55,3,0,0 +BRDA:55,3,1,0 +BRDA:55,4,0,0 +BRDA:55,4,1,0 +BRDA:55,5,0,0 +BRDA:55,5,1,0 +BRDA:63,6,0,0 +BRDA:66,7,0,0 +BRDA:83,8,0,0 +BRDA:90,9,0,0 +BRDA:90,10,0,0 +BRDA:90,10,1,0 +BRDA:111,11,0,0 +BRDA:111,11,1,0 +BRDA:114,12,0,0 +BRDA:114,12,1,0 +BRDA:125,13,0,0 +BRDA:125,13,1,0 +BRDA:143,14,0,0 +BRDA:163,15,0,0 +BRDA:164,16,0,0 +BRDA:164,16,1,0 +BRDA:169,17,0,0 +BRDA:169,18,0,0 +BRDA:169,18,1,0 +BRDA:172,19,0,0 +BRDA:173,20,0,0 +BRDA:173,20,1,0 +BRDA:173,20,2,0 +BRDA:173,20,3,0 +BRDA:180,21,0,0 +BRDA:180,22,0,0 +BRDA:180,22,1,0 +BRF:37 +BRH:0 +end_of_record +TN: +SF:src/utilities/index.ts +FNF:0 +FNH:0 +DA:1,1 +DA:2,1 +DA:3,1 +DA:4,1 +LF:4 +LH:4 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/utilities/legacySafelistingTransform.ts +FN:14,addTypeNameFieldForLegacySafelisting +FN:16,(anonymous_1) +FN:25,(anonymous_2) +FN:34,(anonymous_3) +FNF:4 +FNH:0 +FNDA:0,addTypeNameFieldForLegacySafelisting +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +DA:1,1 +DA:9,1 +DA:14,1 +DA:15,0 +DA:17,0 +DA:20,0 +DA:22,0 +DA:26,0 +DA:35,0 +DA:42,0 +DA:44,0 +DA:46,0 +LF:12 +LH:3 +BRDA:17,0,0,0 +BRDA:17,0,1,0 +BRDA:27,1,0,0 +BRDA:27,1,1,0 +BRDA:35,2,0,0 +BRDA:37,3,0,0 +BRDA:37,3,1,0 +BRDA:37,3,2,0 +BRDA:44,4,0,0 +BRF:9 +BRH:0 +end_of_record +TN: +SF:src/utilities/nodeHelpers.ts +FN:3,nameNode +FN:10,stringNode +FN:17,inputValueDefinitionNode +FN:26,definitionNode +FN:32,(anonymous_4) +FN:33,(anonymous_5) +FN:37,typeNode +FN:44,nonNullNode +FNF:8 +FNH:8 +FNDA:108,nameNode +FNDA:44,stringNode +FNDA:24,inputValueDefinitionNode +FNDA:12,definitionNode +FNDA:24,(anonymous_4) +FNDA:24,(anonymous_5) +FNDA:28,typeNode +FNDA:4,nonNullNode +DA:1,1 +DA:3,1 +DA:4,108 +DA:10,1 +DA:11,44 +DA:17,1 +DA:18,24 +DA:26,1 +DA:27,12 +DA:32,24 +DA:33,24 +DA:37,1 +DA:38,28 +DA:44,1 +DA:45,4 +LF:15 +LH:15 +BRDA:29,0,0,12 +BRDA:29,0,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:src/utilities/predicates.ts +FN:1,isNotNullOrUndefined +FN:7,isObject +FNF:2 +FNH:0 +FNDA:0,isNotNullOrUndefined +FNDA:0,isObject +DA:1,1 +DA:4,0 +DA:7,1 +DA:8,0 +LF:4 +LH:2 +BRDA:4,0,0,0 +BRDA:4,0,1,0 +BRDA:9,1,0,0 +BRDA:9,1,1,0 +BRDA:9,1,2,0 +BRDA:9,1,3,0 +BRF:6 +BRH:0 +end_of_record +TN: +SF:src/utilities/typePolicyDirective.ts +FN:24,matchDirectiveArguments +FN:30,(anonymous_1) +FN:36,(anonymous_2) +FN:44,typePolicyDirectiveFor +FN:53,(anonymous_4) +FN:94,validateKeyFields +FN:147,keyFieldsFor +FN:154,(anonymous_7) +FN:167,addTypePolicyDirectivesToSchema +FNF:9 +FNH:4 +FNDA:0,matchDirectiveArguments +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:101,typePolicyDirectiveFor +FNDA:12,(anonymous_4) +FNDA:0,validateKeyFields +FNDA:97,keyFieldsFor +FNDA:0,(anonymous_7) +FNDA:12,addTypePolicyDirectivesToSchema +DA:1,1 +DA:15,1 +DA:17,1 +DA:28,0 +DA:31,0 +DA:37,0 +DA:47,101 +DA:48,0 +DA:51,101 +DA:52,12 +DA:53,12 +DA:55,12 +DA:56,0 +DA:61,101 +DA:62,5 +DA:63,0 +DA:64,0 +DA:68,101 +DA:69,101 +DA:70,4 +DA:71,4 +DA:73,0 +DA:74,0 +DA:75,0 +DA:76,0 +DA:77,0 +DA:82,0 +DA:91,101 +DA:98,0 +DA:100,0 +DA:101,0 +DA:104,0 +DA:106,0 +DA:107,0 +DA:108,0 +DA:109,0 +DA:115,0 +DA:116,0 +DA:117,0 +DA:123,0 +DA:124,0 +DA:134,0 +DA:135,0 +DA:147,1 +DA:148,97 +DA:149,97 +DA:150,97 +DA:153,0 +DA:154,0 +DA:156,0 +DA:157,0 +DA:160,0 +DA:162,0 +DA:164,0 +DA:167,1 +DA:168,12 +DA:170,12 +DA:171,158 +DA:173,158 +DA:174,97 +LF:60 +LH:25 +BRDA:29,0,0,0 +BRDA:29,0,1,0 +BRDA:29,1,0,0 +BRDA:29,1,1,0 +BRDA:35,2,0,0 +BRDA:35,2,1,0 +BRDA:35,3,0,0 +BRDA:35,3,1,0 +BRDA:47,4,0,0 +BRDA:51,5,0,101 +BRDA:51,5,1,0 +BRDA:51,6,0,101 +BRDA:51,6,1,101 +BRDA:52,7,0,0 +BRDA:52,7,1,12 +BRDA:52,8,0,12 +BRDA:52,8,1,12 +BRDA:55,9,0,0 +BRDA:61,10,0,5 +BRDA:61,10,1,96 +BRDA:61,11,0,101 +BRDA:61,11,1,101 +BRDA:61,12,0,72 +BRDA:61,12,1,29 +BRDA:61,13,0,101 +BRDA:61,13,1,101 +BRDA:62,14,0,0 +BRDA:68,15,0,101 +BRDA:71,16,0,4 +BRDA:73,17,0,0 +BRDA:73,17,1,0 +BRDA:75,18,0,0 +BRDA:76,19,0,0 +BRDA:76,19,1,0 +BRDA:100,20,0,0 +BRDA:104,21,0,0 +BRDA:104,21,1,0 +BRDA:108,22,0,0 +BRDA:116,23,0,0 +BRDA:119,24,0,0 +BRDA:119,24,1,0 +BRDA:123,25,0,0 +BRDA:127,26,0,0 +BRDA:127,26,1,0 +BRDA:134,27,0,0 +BRDA:138,28,0,0 +BRDA:138,28,1,0 +BRDA:149,29,0,97 +BRDA:153,30,0,0 +BRDA:153,30,1,0 +BRDA:153,31,0,0 +BRDA:153,31,1,0 +BRDA:153,32,0,0 +BRDA:153,32,1,0 +BRDA:153,33,0,0 +BRDA:153,33,1,0 +BRDA:153,34,0,0 +BRDA:153,34,1,0 +BRDA:153,35,0,0 +BRDA:153,35,1,0 +BRDA:156,36,0,0 +BRDA:156,37,0,0 +BRDA:156,37,1,0 +BRDA:173,38,0,97 +BRDA:173,39,0,158 +BRDA:173,39,1,66 +BRF:66 +BRH:20 +end_of_record diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts index 52a3e85e7..a3cc951eb 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts @@ -1,13 +1,14 @@ import { GraphQLError, - type GraphQLNamedType, + GraphQLField, type GraphQLSchema, Source, } from "graphql"; import { loadSchemaFromSources } from ".."; +// import { Field } from "../compiler/ir"; -type ObjectWithMeta = GraphQLNamedType & { - _apolloFieldPolicies: Record; +type FieldWithMeta = GraphQLField & { + _apolloFieldPolicies: string[]; }; describe("given SDL without fieldPolicy", () => { @@ -31,18 +32,30 @@ describe("given SDL without fieldPolicy", () => { new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), ]); - const rect = schema.getTypeMap()["Rectangle"] as ObjectWithMeta; - expect(Object.keys(rect._apolloFieldPolicies)).toHaveLength(0); + const rectType = schema.getTypeMap()["Rectangle"]; + if (!rectType || !("getFields" in rectType)) throw new Error("Missing Rectangle type."); - const shape = schema.getTypeMap()["Shape"] as ObjectWithMeta; - expect(Object.keys(shape._apolloFieldPolicies)).toHaveLength(0); + const rectFields = rectType.getFields(); + for (const fieldName in rectFields) { + const field = rectFields[fieldName] as FieldWithMeta; + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + + const shape = schema.getTypeMap()["Shape"]; + if (!shape || !("getFields" in shape)) throw new Error("Missing Shape type."); + + const shapeFields = shape.getFields(); + for (const fieldName in shapeFields) { + const field = shapeFields[fieldName] as FieldWithMeta; + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } }); }); describe("given SDL with valid fieldPolicy", () => { const schemaSDL: string = ` type Query { - allRectangles(withWidth: Int!): [Rectangle!] + rectangle(withWidth: Int!): Rectangle! } type Rectangle { @@ -50,7 +63,7 @@ describe("given SDL with valid fieldPolicy", () => { height: Int! } - extend type Query @fieldPolicy(forField: "allRectangles", keyArgs: "withWidth") + extend type Query @fieldPolicy(forField: "rectangle", keyArgs: "withWidth") `; it("should set _apolloFieldPolicies property", () => { @@ -58,32 +71,37 @@ describe("given SDL with valid fieldPolicy", () => { new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), ]); - const queryType = schema.getTypeMap()["Query"] as ObjectWithMeta; - expect(queryType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(queryType._apolloFieldPolicies!)).toHaveLength(1); - expect(queryType._apolloFieldPolicies).toHaveProperty("allRectangles"); - expect(queryType._apolloFieldPolicies?.allRectangles).toEqual(["withWidth"]); + const queryType = schema.getTypeMap()["Query"]; + if (!queryType || !("getFields" in queryType)) throw new Error("Missing Query type."); + + const queryFields = queryType.getFields(); + for (const fieldName in queryFields) { + const field = queryFields[fieldName] as FieldWithMeta; + expect(fieldName).toEqual("rectangle"); + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withWidth"); + } }); }); describe("given fieldPolicy on interface extension", () => { const schemaSDL: string = ` interface Animal { - allAnimals(ofSpecies: String): [Animal!] + animal(withName: String): Animal! id: ID! species: String! } type Dog implements Animal { - allAnimals(ofSpecies: String): [Animal!] + animal(withName: String): Animal! id: ID! species: String! owner: String } - extend interface Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") + extend interface Animal @fieldPolicy(forField: "animal", keyArgs: "withName") `; it("should set _apolloFieldPolicies property", () => { @@ -91,35 +109,55 @@ describe("given fieldPolicy on interface extension", () => { new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), ]); - const animalType = schema.getTypeMap()["Animal"] as ObjectWithMeta; - expect(animalType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(animalType._apolloFieldPolicies!)).toHaveLength(1); - - const dogType = schema.getTypeMap()["Dog"] as ObjectWithMeta; - expect(dogType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(dogType._apolloFieldPolicies!)).toHaveLength(1); + const animalType = schema.getTypeMap()["Animal"]; + if (!animalType || !("getFields" in animalType)) throw new Error("Missing Animal type."); + + const animalFields = animalType.getFields(); + for (const fieldName in animalFields) { + const field = animalFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + + const dogType = schema.getTypeMap()["Dog"]; + if (!dogType || !("getFields" in dogType)) throw new Error("Missing Dog type."); + + const dogFields = dogType.getFields(); + for (const fieldName in dogFields) { + const field = dogFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } }); }); describe("given fieldPolicy on interface and object extensions", () => { const schemaSDL: string = ` interface Animal { - allAnimals(ofSpecies: String): [Animal!] + animal(withName: String): Animal! id: ID! species: String! } type Dog implements Animal { - allAnimals(ofSpecies: String): [Animal!] + animal(withName: String): Animal! id: ID! species: String! owner: String } - extend interface Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") - extend type Dog @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") + extend interface Animal @fieldPolicy(forField: "animal", keyArgs: "withName") + extend type Dog @fieldPolicy(forField: "animal", keyArgs: "withName") `; it("should set _apolloFieldPolicies property without duplicates.", () => { @@ -127,27 +165,47 @@ describe("given fieldPolicy on interface and object extensions", () => { new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), ]); - const animalType = schema.getTypeMap()["Animal"] as ObjectWithMeta; - expect(animalType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(animalType._apolloFieldPolicies!)).toHaveLength(1); - - const dogType = schema.getTypeMap()["Dog"] as ObjectWithMeta; - expect(dogType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(dogType._apolloFieldPolicies!)).toHaveLength(1); + const animalType = schema.getTypeMap()["Animal"]; + if (!animalType || !("getFields" in animalType)) throw new Error("Missing Animal type."); + + const animalFields = animalType.getFields(); + for (const fieldName in animalFields) { + const field = animalFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + + const dogType = schema.getTypeMap()["Dog"]; + if (!dogType || !("getFields" in dogType)) throw new Error("Missing Dog type."); + + const dogFields = dogType.getFields(); + for (const fieldName in dogFields) { + const field = dogFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } }); }); describe("given fieldPolicy on interface", () => { const schemaSDL: string = ` - interface Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") { - allAnimals(ofSpecies: String): [Animal!] + interface Animal @fieldPolicy(forField: "animal", keyArgs: "withName") { + animal(withName: String): Animal! id: ID! species: String! } type Dog implements Animal { - allAnimals(ofSpecies: String): [Animal!] + animal(withName: String): Animal! id: ID! species: String! @@ -160,27 +218,47 @@ describe("given fieldPolicy on interface", () => { new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), ]); - const animalType = schema.getTypeMap()["Animal"] as ObjectWithMeta; - expect(animalType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(animalType._apolloFieldPolicies!)).toHaveLength(1); - - const dogType = schema.getTypeMap()["Dog"] as ObjectWithMeta; - expect(dogType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(dogType._apolloFieldPolicies!)).toHaveLength(1); + const animalType = schema.getTypeMap()["Animal"]; + if (!animalType || !("getFields" in animalType)) throw new Error("Missing Animal type."); + + const animalFields = animalType.getFields(); + for (const fieldName in animalFields) { + const field = animalFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + + const dogType = schema.getTypeMap()["Dog"]; + if (!dogType || !("getFields" in dogType)) throw new Error("Missing Dog type."); + + const dogFields = dogType.getFields(); + for (const fieldName in dogFields) { + const field = dogFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } }); }); describe("given fieldPolicy on interface and object", () => { const schemaSDL: string = ` - interface Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") { - allAnimals(ofSpecies: String): [Animal!] + interface Animal @fieldPolicy(forField: "animal", keyArgs: "withName") { + animal(withName: String): Animal! id: ID! species: String! } - type Dog implements Animal @fieldPolicy(forField: "allAnimals", keyArgs: "ofSpecies") { - allAnimals(ofSpecies: String): [Animal!] + type Dog implements Animal @fieldPolicy(forField: "animal", keyArgs: "withName") { + animal(withName: String): Animal! id: ID! species: String! @@ -193,20 +271,40 @@ describe("given fieldPolicy on interface and object", () => { new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), ]); - const animalType = schema.getTypeMap()["Animal"] as ObjectWithMeta; - expect(animalType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(animalType._apolloFieldPolicies!)).toHaveLength(1); - - const dogType = schema.getTypeMap()["Dog"] as ObjectWithMeta; - expect(dogType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(dogType._apolloFieldPolicies!)).toHaveLength(1); + const animalType = schema.getTypeMap()["Animal"]; + if (!animalType || !("getFields" in animalType)) throw new Error("Missing Animal type."); + + const animalFields = animalType.getFields(); + for (const fieldName in animalFields) { + const field = animalFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } + + const dogType = schema.getTypeMap()["Dog"]; + if (!dogType || !("getFields" in dogType)) throw new Error("Missing Dog type."); + + const dogFields = dogType.getFields(); + for (const fieldName in dogFields) { + const field = dogFields[fieldName] as FieldWithMeta; + if (fieldName == "animal") { + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withName") + } else { + expect(field._apolloFieldPolicies ?? []).toEqual([]); + } + } }); }); -describe("given field with list inputs and non-list return type", () => { +describe("given field with list input and non-list return type", () => { const schemaSDL: string = ` type Query { - allAnimals(withIds: [ID]!): Animal! + allAnimals(withIds: [ID!]): Animal! } type Animal { @@ -214,7 +312,7 @@ describe("given field with list inputs and non-list return type", () => { name: String! } - extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIDs") + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds") `; it("should throw error requiring List return type", () => { @@ -226,10 +324,56 @@ describe("given field with list inputs and non-list return type", () => { }); }); +describe("given field with list return type and non-list input type", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withId: ID!): [Animal!] + } + + type Animal { + id: ID! + name: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withId") + `; + + it("should throw error requiring List input type", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + +describe("given field with list return type and multiple list input types", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [ID!], andNames: [String!]): [Animal!] + } + + type Animal { + id: ID! + name: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds andNames") + `; + + it("should throw error requiring only 1 List input type", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + describe("given field with list inputs and list return type", () => { const schemaSDL: string = ` type Query { - allAnimals(withIds: [ID]!): [Animal!] + allAnimals(withIds: [ID!]): [Animal!] } type Animal { @@ -238,25 +382,30 @@ describe("given field with list inputs and list return type", () => { } extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds") - `; + `; - it("should throw error requiring List return type", () => { + it("should set _apolloFieldPolicies on field ", () => { const schema: GraphQLSchema = loadSchemaFromSources([ new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), ]); - const queryType = schema.getTypeMap()["Query"] as ObjectWithMeta; - expect(queryType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(queryType._apolloFieldPolicies!)).toHaveLength(1); - expect(queryType._apolloFieldPolicies).toHaveProperty("allAnimals"); - expect(queryType._apolloFieldPolicies?.allAnimals).toEqual(["withIds"]); + const queryType = schema.getTypeMap()["Query"]; + if (!queryType || !("getFields" in queryType)) throw new Error("Missing Query type."); + + const queryFields = queryType.getFields(); + for (const fieldName in queryFields) { + const field = queryFields[fieldName] as FieldWithMeta; + expect(fieldName).toEqual("allAnimals"); + expect(field._apolloFieldPolicies).toHaveLength(1); + expect(field._apolloFieldPolicies).toContain("withIds"); + } }); }); describe("given field policy with multiple valid keyArgs", () => { const schemaSDL: string = ` type Query { - allAnimals(withIds: [ID]!, andSpecies: String!): [Animal!] + allAnimals(withIds: [ID!], andSpecies: String!): [Animal!] } type Animal { @@ -273,11 +422,16 @@ describe("given field policy with multiple valid keyArgs", () => { new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), ]); - const queryType = schema.getTypeMap()["Query"] as ObjectWithMeta; - expect(queryType._apolloFieldPolicies).toBeDefined(); - expect(Object.keys(queryType._apolloFieldPolicies!)).toHaveLength(1); - expect(queryType._apolloFieldPolicies).toHaveProperty("allAnimals"); - expect(queryType._apolloFieldPolicies?.allAnimals).toEqual(["withIds", "andSpecies"]); + const queryType = schema.getTypeMap()["Query"]; + if (!queryType || !("getFields" in queryType)) throw new Error("Missing Query type."); + + const queryFields = queryType.getFields(); + for (const fieldName in queryFields) { + const field = queryFields[fieldName] as FieldWithMeta; + expect(fieldName).toEqual("allAnimals"); + expect(field._apolloFieldPolicies).toHaveLength(2); + expect(field._apolloFieldPolicies).toEqual(["withIds", "andSpecies"]); + } }); }); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts index f1716aa43..d56f3bfc5 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/sourceDefinitionTransformTests.ts @@ -17,11 +17,10 @@ import { emptyValidationOptions } from "../__testUtils__/validationHelpers"; describe("given schema", () => { const schemaSDL: string = `type Query { - allAnimals(id: String!): [Animal!] + allAnimals: [Animal!] } -interface Animal @typePolicy(keyFields: "id") { - id: String! +interface Animal { species: String! friend: Animal! } @@ -29,8 +28,6 @@ interface Animal @typePolicy(keyFields: "id") { interface Pet { name: String! } - -extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "id") `; const schema: GraphQLSchema = loadSchemaFromSources([new Source(schemaSDL, "Test Schema", { line: 1, column: 1 })]); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts index ffc686e7a..bd4a2a6d2 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts @@ -30,20 +30,20 @@ export function addFieldPolicyDirectivesToSchema( const type = types[t]; if (type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) { - (type as any)._apolloFieldPolicies = fieldPoliciesFor(type); + // (type as any)._apolloFieldPolicies = applyFieldPoliciesFor(type); + applyFieldPoliciesFor(type); } } } -export function fieldPoliciesFor( +export function applyFieldPoliciesFor( type: GraphQLCompositeType -): Record { +) { const directives = fieldPolicyDirectivesFor(type) if (!directives || isUnionType(type)) { - return {}; + return; } - const fieldPolicies: Record = {}; const typeFields = type.getFields() for (const directive of directives) { @@ -101,28 +101,41 @@ export function fieldPoliciesFor( } } - // validate that if we have a list input parameter we have a list return type + // List input and return type validation if (inputs) { + var numListInputs = 0; + const hasListReturnType = isListType(actualField.type); + for (const inputArg of inputs) { - if (isListType(inputArg.type)) { - if (!isListType(actualField.type)) { - throw new GraphQLError( - `@fieldPolicy requires fields with List input type to have a List return type.`, - { nodes: actualField.astNode } - ); - } else { - break; - } + if (inputArg.type.kind == "ListType") { + numListInputs += 1; } } + + // validate we have at most 1 list input parameter + if (numListInputs > 1) { + throw new GraphQLError( + `@fieldPolicy can only have at most 1 List type input parameter.`, + { nodes: actualField.astNode } + ); + } + + // validate that a list input parameter and return type exist either together + // or not at all + if ((hasListReturnType && numListInputs != 1) || (numListInputs == 1 && !hasListReturnType)) { + throw new GraphQLError( + `@fieldPolicy requires either both a List return type and 1 List input parameter, or neither.`, + { nodes: actualField.astNode } + ); + } } - if (!fieldPolicies[forField]) { - fieldPolicies[forField] = keyArgs + if (!(actualField as any)._apolloFieldPolicies) { + (actualField as any)._apolloFieldPolicies = keyArgs + } else { + (actualField as any)._apolloFieldPolicies = [] } } - - return fieldPolicies; } function fieldPolicyDirectivesFor( diff --git a/apollo-ios-codegen/Sources/IR/IR+Fields.swift b/apollo-ios-codegen/Sources/IR/IR+Fields.swift index 720b3bccc..24665798b 100644 --- a/apollo-ios-codegen/Sources/IR/IR+Fields.swift +++ b/apollo-ios-codegen/Sources/IR/IR+Fields.swift @@ -12,6 +12,7 @@ public class Field: Equatable, CustomDebugStringConvertible { public var responseKey: String { underlyingField.responseKey } public var type: GraphQLType { underlyingField.type } public var arguments: [CompilationResult.Argument]? { underlyingField.arguments } + public var fieldPolicyKeys: [String] { underlyingField.fieldPolicyKeys } fileprivate init( _ field: CompilationResult.Field, diff --git a/apollo-ios/Sources/ApolloAPI/Selection.swift b/apollo-ios/Sources/ApolloAPI/Selection.swift index f8cc3390c..50345053e 100644 --- a/apollo-ios/Sources/ApolloAPI/Selection.swift +++ b/apollo-ios/Sources/ApolloAPI/Selection.swift @@ -15,6 +15,7 @@ public enum Selection { public let alias: String? public let arguments: [String: InputValue]? public let type: OutputType + public let fieldPolicy: FieldPolicy? public var responseKey: String { return alias ?? name @@ -24,12 +25,14 @@ public enum Selection { _ name: String, alias: String? = nil, type: OutputType, - arguments: [String: InputValue]? = nil + arguments: [String: InputValue]? = nil, + fieldPolicy: FieldPolicy? = nil ) { self.name = name self.alias = alias self.arguments = arguments self.type = type + self.fieldPolicy = nil } public indirect enum OutputType { @@ -54,6 +57,16 @@ public enum Selection { } } } + + public struct FieldPolicy: Hashable { + public let keys: [String] + + public init( + keys: [String] + ) { + self.keys = keys + } + } // MARK: - Convenience Initializers @@ -61,9 +74,10 @@ public enum Selection { _ name: String, alias: String? = nil, _ type: any OutputTypeConvertible.Type, - arguments: [String: InputValue]? = nil + arguments: [String: InputValue]? = nil, + fieldPolicy: FieldPolicy? = nil ) -> Selection { - .field(.init(name, alias: alias, type: type._asOutputType, arguments: arguments)) + .field(.init(name, alias: alias, type: type._asOutputType, arguments: arguments, fieldPolicy: fieldPolicy)) } @inlinable static public func include( From 2dec82398176324b850d8987dff6dc36d590891e Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Thu, 21 Aug 2025 13:57:37 -0400 Subject: [PATCH 03/35] Checking in fieldPolicy updates Checking in complete field policy functionality, need to do some code clean up and abstract some things into their own files, and add new SchemaConfiguration function --- .../TestMocks/Bird+Mock.graphql.swift | 18 +- .../TestMocks/Cat+Mock.graphql.swift | 18 +- .../TestMocks/Crocodile+Mock.graphql.swift | 12 +- .../TestMocks/Dog+Mock.graphql.swift | 16 +- .../TestMocks/Fish+Mock.graphql.swift | 12 +- .../TestMocks/Height+Mock.graphql.swift | 10 +- .../TestMocks/Human+Mock.graphql.swift | 16 +- .../MockObject+Interfaces.graphql.swift | 2 +- .../TestMocks/MockObject+Unions.graphql.swift | 2 +- .../TestMocks/Mutation+Mock.graphql.swift | 4 +- .../TestMocks/PetRock+Mock.graphql.swift | 6 +- .../TestMocks/Query+Mock.graphql.swift | 8 +- .../TestMocks/Rat+Mock.graphql.swift | 12 +- .../AllAnimalsQuery.graphql | 4 +- .../ApolloTests/Cache/FieldPolicyTests.swift | 1137 +++++++++++++++++ ..._ResultNormalizer_FromResponse_Tests.swift | 40 - .../Templates/SelectionSetTemplate.swift | 2 +- .../ApolloCodegenFrontendBundle.swift | 2 +- .../GraphQLCompiler/CompilationResult.swift | 11 +- .../GraphQLCompiler/GraphQLSchema.swift | 9 +- .../JavaScript/package-lock.json | 9 +- .../__tests__/fieldPolicyDirectiveTests.ts | 65 + .../JavaScript/src/compiler/index.ts | 1 + .../JavaScript/src/compiler/ir.ts | 1 + .../src/utilities/fieldPolicyDirective.ts | 171 ++- apollo-ios-codegen/Sources/IR/IR+Fields.swift | 2 +- .../CacheDataExecutionSource.swift | 221 +++- apollo-ios/Sources/ApolloAPI/Selection.swift | 3 +- 28 files changed, 1627 insertions(+), 187 deletions(-) create mode 100644 Tests/ApolloTests/Cache/FieldPolicyTests.swift diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Bird+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Bird+Mock.graphql.swift index 77dd55596..054dbcc92 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Bird+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Bird+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Bird: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Bird @@ -26,17 +26,17 @@ public class Bird: MockObject { public extension Mock where O == Bird { convenience init( - bodyTemperature: Int? = nil, - favoriteToy: String? = nil, - height: Mock? = nil, + bodyTemperature: Int = 0, + favoriteToy: String = "", + height: Mock = Mock(), humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, - laysEggs: Bool? = nil, + id: AnimalKingdomAPI.ID = "", + laysEggs: Bool = false, owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil, - wingspan: Double? = nil + species: String = "", + wingspan: Double = 0.0 ) { self.init() _setScalar(bodyTemperature, for: \.bodyTemperature) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Cat+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Cat+Mock.graphql.swift index 4505fa489..16211a8ca 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Cat+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Cat+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Cat: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Cat @@ -26,17 +26,17 @@ public class Cat: MockObject { public extension Mock where O == Cat { convenience init( - bodyTemperature: Int? = nil, - favoriteToy: String? = nil, - height: Mock? = nil, + bodyTemperature: Int = 0, + favoriteToy: String = "", + height: Mock = Mock(), humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, - isJellicle: Bool? = nil, - laysEggs: Bool? = nil, + id: AnimalKingdomAPI.ID = "", + isJellicle: Bool = false, + laysEggs: Bool = false, owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(bodyTemperature, for: \.bodyTemperature) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Crocodile+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Crocodile+Mock.graphql.swift index 216665346..6d7fe377b 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Crocodile+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Crocodile+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Crocodile: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Crocodile @@ -22,12 +22,12 @@ public class Crocodile: MockObject { public extension Mock where O == Crocodile { convenience init( - age: Int? = nil, - height: Mock? = nil, - id: AnimalKingdomAPI.ID? = nil, - predators: [(any AnyMock)]? = nil, + age: Int = 0, + height: Mock = Mock(), + id: AnimalKingdomAPI.ID = "", + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil, + species: String = "", tag: String? = nil ) { self.init() diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Dog+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Dog+Mock.graphql.swift index d01b7cbc2..1fdb4a3da 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Dog+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Dog+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Dog: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Dog @@ -28,17 +28,17 @@ public class Dog: MockObject { public extension Mock where O == Dog { convenience init( birthdate: AnimalKingdomAPI.CustomDate? = nil, - bodyTemperature: Int? = nil, - favoriteToy: String? = nil, - height: Mock? = nil, + bodyTemperature: Int = 0, + favoriteToy: String = "", + height: Mock = Mock(), houseDetails: AnimalKingdomAPI.Object? = nil, humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, - laysEggs: Bool? = nil, + id: AnimalKingdomAPI.ID = "", + laysEggs: Bool = false, owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(birthdate, for: \.birthdate) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Fish+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Fish+Mock.graphql.swift index 0228c48ad..5ca817c42 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Fish+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Fish+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Fish: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Fish @@ -23,14 +23,14 @@ public class Fish: MockObject { public extension Mock where O == Fish { convenience init( - favoriteToy: String? = nil, - height: Mock? = nil, + favoriteToy: String = "", + height: Mock = Mock(), humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, + id: AnimalKingdomAPI.ID = "", owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(favoriteToy, for: \.favoriteToy) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Height+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Height+Mock.graphql.swift index 27f919e55..d20d00ea4 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Height+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Height+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Height: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Height @@ -20,11 +20,11 @@ public class Height: MockObject { public extension Mock where O == Height { convenience init( - centimeters: Double? = nil, - feet: Int? = nil, + centimeters: Double = 0.0, + feet: Int = 0, inches: Int? = nil, - meters: Int? = nil, - relativeSize: GraphQLEnum? = nil + meters: Int = 0, + relativeSize: GraphQLEnum = .case(.large) ) { self.init() _setScalar(centimeters, for: \.centimeters) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Human+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Human+Mock.graphql.swift index 301408b6a..394996841 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Human+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Human+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Human: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Human @@ -23,14 +23,14 @@ public class Human: MockObject { public extension Mock where O == Human { convenience init( - bodyTemperature: Int? = nil, - firstName: String? = nil, - height: Mock? = nil, - id: AnimalKingdomAPI.ID? = nil, - laysEggs: Bool? = nil, - predators: [(any AnyMock)]? = nil, + bodyTemperature: Int = 0, + firstName: String = "", + height: Mock = Mock(), + id: AnimalKingdomAPI.ID = "", + laysEggs: Bool = false, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(bodyTemperature, for: \.bodyTemperature) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Interfaces.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Interfaces.graphql.swift index 0fcfc230e..166cb8787 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Interfaces.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Interfaces.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public extension MockObject { typealias Animal = Interface diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Unions.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Unions.graphql.swift index d0935b93f..d69e15691 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Unions.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/MockObject+Unions.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public extension MockObject { typealias ClassroomPet = Union diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Mutation+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Mutation+Mock.graphql.swift index 572ea857c..c60765ff2 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Mutation+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Mutation+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Mutation: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Mutation @@ -16,7 +16,7 @@ public class Mutation: MockObject { public extension Mock where O == Mutation { convenience init( - adoptPet: (any AnyMock)? = nil + adoptPet: (any AnyMock) = Mock() ) { self.init() _setEntity(adoptPet, for: \.adoptPet) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/PetRock+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/PetRock+Mock.graphql.swift index d1405035f..78974ff95 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/PetRock+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/PetRock+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class PetRock: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.PetRock @@ -19,9 +19,9 @@ public class PetRock: MockObject { public extension Mock where O == PetRock { convenience init( - favoriteToy: String? = nil, + favoriteToy: String = "", humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, + id: AnimalKingdomAPI.ID = "", owner: Mock? = nil ) { self.init() diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Query+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Query+Mock.graphql.swift index 8405fbed7..f93555408 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Query+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Query+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Query: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Query @@ -19,10 +19,10 @@ public class Query: MockObject { public extension Mock where O == Query { convenience init( - allAnimals: [(any AnyMock)]? = nil, + allAnimals: [(any AnyMock)] = [], classroomPets: [(any AnyMock)?]? = nil, - findPet: [(any AnyMock)]? = nil, - pets: [(any AnyMock)]? = nil + findPet: [(any AnyMock)] = [], + pets: [(any AnyMock)] = [] ) { self.init() _setList(allAnimals, for: \.allAnimals) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Rat+Mock.graphql.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Rat+Mock.graphql.swift index 351b82b29..da1cb1145 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Rat+Mock.graphql.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/TestMocks/Rat+Mock.graphql.swift @@ -2,7 +2,7 @@ // This file was automatically generated and should not be edited. import ApolloTestSupport -import AnimalKingdomAPI +@testable import AnimalKingdomAPI public class Rat: MockObject { public static let objectType: ApolloAPI.Object = AnimalKingdomAPI.Objects.Rat @@ -23,14 +23,14 @@ public class Rat: MockObject { public extension Mock where O == Rat { convenience init( - favoriteToy: String? = nil, - height: Mock? = nil, + favoriteToy: String = "", + height: Mock = Mock(), humanName: String? = nil, - id: AnimalKingdomAPI.ID? = nil, + id: AnimalKingdomAPI.ID = "", owner: Mock? = nil, - predators: [(any AnyMock)]? = nil, + predators: [(any AnyMock)] = [], skinCovering: GraphQLEnum? = nil, - species: String? = nil + species: String = "" ) { self.init() _setScalar(favoriteToy, for: \.favoriteToy) diff --git a/Sources/AnimalKingdomAPI/animalkingdom-graphql/AllAnimalsQuery.graphql b/Sources/AnimalKingdomAPI/animalkingdom-graphql/AllAnimalsQuery.graphql index d8b16ff3f..d5ef17e95 100644 --- a/Sources/AnimalKingdomAPI/animalkingdom-graphql/AllAnimalsQuery.graphql +++ b/Sources/AnimalKingdomAPI/animalkingdom-graphql/AllAnimalsQuery.graphql @@ -1,5 +1,5 @@ -query AllAnimalsQuery(species: String) { - allAnimals(species: $species) { +query AllAnimalsQuery { + allAnimals { __typename id height { diff --git a/Tests/ApolloTests/Cache/FieldPolicyTests.swift b/Tests/ApolloTests/Cache/FieldPolicyTests.swift new file mode 100644 index 000000000..3ce325f47 --- /dev/null +++ b/Tests/ApolloTests/Cache/FieldPolicyTests.swift @@ -0,0 +1,1137 @@ +import XCTest +@testable import Apollo +import ApolloAPI +import ApolloInternalTestHelpers + +final class FieldPolicyTests: XCTestCase, CacheDependentTesting { + + var cacheType: any TestCacheProvider.Type { + InMemoryTestCacheProvider.self + } + + static let defaultWaitTimeout: TimeInterval = 1.0 + + var cache: (any NormalizedCache)! + var server: MockGraphQLServer! + var client: ApolloClient! + + override func setUp() async throws { + try await super.setUp() + + cache = try await makeNormalizedCache() + let store = ApolloStore(cache: cache) + + server = MockGraphQLServer() + let networkTransport = MockNetworkTransport(server: server, store: store) + + client = ApolloClient(networkTransport: networkTransport, store: store) + } + + override func tearDownWithError() throws { + cache = nil + server = nil + client = nil + + try super.tearDownWithError() + } + + // MARK: - Single Key Argument Tests + + func test_fieldPolicy_withStringKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name")], fieldPolicy: .init(keys: ["name"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke"] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withIntKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["age": .variable("age")], fieldPolicy: .init(keys: ["age"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:19": CacheReference("Hero:19")], + "Hero:19": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withDoubleKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["weight": .variable("weight")], fieldPolicy: .init(keys: ["weight"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["weight": 175.2] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:175.2": CacheReference("Hero:175.2")], + "Hero:175.2": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withBoolKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["isJedi": .variable("isJedi")], fieldPolicy: .init(keys: ["isJedi"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["isJedi": true] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:true": CacheReference("Hero:true")], + "Hero:true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withListKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names")], fieldPolicy: .init(keys: ["names"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withObjectKeyArgument_resolvesCorrectCacheKey() { + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(name: String) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.name"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(name: "Luke")] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withNestedObjectKeyArgument_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (name: String) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(nameInput: NameInput) { + __data = InputDict([ + "nameInput": nameInput + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + } + + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.nameInput.name"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"))] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withNestedObjectListKeyArgument_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (names: [String]) { + __data = InputDict([ + "names": names + ]) + } + + public var names: [String] { + get { __data["names"] } + set { __data["names"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(nameInput: NameInput) { + __data = InputDict([ + "nameInput": nameInput + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + } + + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.nameInput.names"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]))] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + // MARK: - Multiple Key Argument Tests + + func test_fieldPolicy_withMultipleKeyArguments_resolvesCorrectCacheKey() { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keys: ["name", "age"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke", "age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+19": CacheReference("Hero:Luke+19")], + "Hero:Luke+19": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_withDifferentOrder_resolvesCorrectCacheKey() { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keys: ["age", "name"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke", "age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:19+Luke": CacheReference("Hero:19+Luke")], + "Hero:19+Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingList_resolvesCorrectCacheKey() { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names"), "isJedi": .variable("isJedi")], fieldPolicy: .init(keys: ["names", "isJedi"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"], "isJedi": true] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), + "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), + "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") + ], + "Hero:Anakin+true": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan+true": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka+true": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingObject_resolvesCorrectCacheKey() { + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + name: String, + isJedi: Bool + ) { + __data = InputDict([ + "name": name, + "isJedi": true + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.name", "input.isJedi"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(name: "Luke", isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], + "Hero:Luke+true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingNestedObject_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + name: String + ) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + nameInput: NameInput, + isJedi: Bool + ) { + __data = InputDict([ + "nameInput": nameInput, + "isJedi": isJedi + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.nameInput.name", "input.isJedi"])) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"), isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], + "Hero:Luke+true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingNestedObjectList_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (names: [String]) { + __data = InputDict([ + "names": names + ]) + } + + public var names: [String] { + get { __data["names"] } + set { __data["names"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + nameInput: NameInput, + isJedi: Bool + ) { + __data = InputDict([ + "nameInput": nameInput, + "isJedi": isJedi + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.nameInput.names", "input.isJedi"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]), isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), + "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), + "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") + ], + "Hero:Anakin+true": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan+true": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka+true": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + +} diff --git a/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift b/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift index f884521ad..89d82b715 100644 --- a/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift +++ b/Tests/ApolloTests/GraphQLExecutor_ResultNormalizer_FromResponse_Tests.swift @@ -87,46 +87,6 @@ class GraphQLExecutor_ResultNormalizer_FromResponse_Tests: XCTestCase { let hero = try XCTUnwrap(records["QUERY_ROOT.hero(episode:JEDI)"]) XCTAssertEqual(hero["name"] as? String, "R2-D2") } - - - - -// func test__fieldPolicy() throws { -// // given -// class GivenSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] {[ -// .field("hero", Hero.self, arguments: [""]) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __selections: [Selection] {[ -// .field("id", String.self), -// .field("name", String.self) -// ]} -// } -// } -// .field(.init(name, alias: alias, type: type._asOutputType, arguments: arguments, fieldPolicy: fieldPolicy)) -// let variables = ["episode": "JEDI"] -// -// let object: JSONObject = [ -// "hero": ["__typename": "Droid", "name": "R2-D2"] -// ] - - // when - let records = try normalizeRecords(GivenSelectionSet.self, with: variables, from: object) - - // then - XCTAssertEqual(records["QUERY_ROOT"]?["hero(episode:JEDI)"] as? CacheReference, - CacheReference("QUERY_ROOT.hero(episode:JEDI)")) - - let hero = try XCTUnwrap(records["QUERY_ROOT.hero(episode:JEDI)"]) - XCTAssertEqual(hero["name"] as? String, "R2-D2") - } - - - - - func test__execute__givenObjectWithNoCacheKey_forFieldWithEnumArgument_normalizesRecordToPathFromQueryRootIncludingArgument() throws { // given diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift index 4e8106860..1ddf0d46a 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SelectionSetTemplate.swift @@ -348,7 +348,7 @@ struct SelectionSetTemplate { })\ \(ifLet: field.fieldPolicyKeys, where: { !$0.isEmpty }, { keys in - ", fieldPolicy: .init(keys: [\(keys.joined(separator: ", "))])" + ", fieldPolicy: .init(keys: [\"\(keys.joined(separator: "\", \""))\"])" })\ ) """ diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift index d8337bafd..d6a05b13f 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift @@ -1 +1 @@ -let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){throw new Error(t??"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}const d={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},f={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION"},h="Name",m="Document",v="OperationDefinition",y="VariableDefinition",g="SelectionSet",T="Field",E="Argument",b="FragmentArgument",N="FragmentSpread",S="InlineFragment",L="FragmentDefinition",w="Variable",I="IntValue",O="FloatValue",k="StringValue",_="BooleanValue",A="NullValue",D="EnumValue",x="ListValue",$="ObjectValue",F="ObjectField",G="Directive",Q="NamedType",C="ListType",R="NonNullType",V="SchemaDefinition",j="OperationTypeDefinition",M="ScalarTypeDefinition",U="ObjectTypeDefinition",P="FieldDefinition",B="InputValueDefinition",J="InterfaceTypeDefinition",q="UnionTypeDefinition",K="EnumTypeDefinition",z="EnumValueDefinition",Y="InputObjectTypeDefinition",H="DirectiveDefinition",W="SchemaExtension",X="ScalarTypeExtension",Z="ObjectTypeExtension",ee="InterfaceTypeExtension",te="UnionTypeExtension",ne="EnumTypeExtension",re="InputObjectTypeExtension";var ie=Object.freeze({__proto__:null,ARGUMENT:E,BOOLEAN:_,DIRECTIVE:G,DIRECTIVE_DEFINITION:H,DOCUMENT:m,ENUM:D,ENUM_TYPE_DEFINITION:K,ENUM_TYPE_EXTENSION:ne,ENUM_VALUE_DEFINITION:z,FIELD:T,FIELD_DEFINITION:P,FLOAT:O,FRAGMENT_ARGUMENT:b,FRAGMENT_DEFINITION:L,FRAGMENT_SPREAD:N,INLINE_FRAGMENT:S,INPUT_OBJECT_TYPE_DEFINITION:Y,INPUT_OBJECT_TYPE_EXTENSION:re,INPUT_VALUE_DEFINITION:B,INT:I,INTERFACE_TYPE_DEFINITION:J,INTERFACE_TYPE_EXTENSION:ee,LIST:x,LIST_TYPE:C,NAME:h,NAMED_TYPE:Q,NON_NULL_TYPE:R,NULL:A,OBJECT:$,OBJECT_FIELD:F,OBJECT_TYPE_DEFINITION:U,OBJECT_TYPE_EXTENSION:Z,OPERATION_DEFINITION:v,OPERATION_TYPE_DEFINITION:j,SCALAR_TYPE_DEFINITION:M,SCALAR_TYPE_EXTENSION:X,SCHEMA_DEFINITION:V,SCHEMA_EXTENSION:W,SELECTION_SET:g,STRING:k,UNION_TYPE_DEFINITION:q,UNION_TYPE_EXTENSION:te,VARIABLE:w,VARIABLE_DEFINITION:y});function oe(e){return 9===e||32===e}function se(e){return e>=48&&e<=57}function ae(e){return e>=97&&e<=122||e>=65&&e<=90}function ce(e){return ae(e)||95===e}function ue(e){return ae(e)||se(e)||95===e}function le(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function pe(e){let t=0;for(;t",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};class Lexer{constructor(e){const t=new Token(fe.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==fe.EOF)do{if(e.next)e=e.next;else{const t=Ee(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===fe.COMMENT);return e}}function he(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function me(e,t){return ve(e.charCodeAt(t))&&ye(e.charCodeAt(t+1))}function ve(e){return e>=55296&&e<=56319}function ye(e){return e>=56320&&e<=57343}function ge(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return fe.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Te(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function Ee(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _e(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ae(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oFe)return"[Array]";const n=Math.min($e,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>Fe)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+Qe(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ce=null!=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Ge(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||xe(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||xe(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Re(e,t){const n=new Parser(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function Ve(e,t){const n=new Parser(e,t);n.expectToken(fe.SOF);const r=n.parseConstValueLiteral();return n.expectToken(fe.EOF),r}class Parser{constructor(e,t={}){const n=function(e){return Ce(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(fe.NAME);return this.node(e,{kind:h,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:m,definitions:this.many(fe.SOF,this.parseDefinition,fe.EOF)})}parseDefinition(){if(this.peek(fe.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===fe.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(fe.BRACE_L))return this.node(e,{kind:v,operation:d.QUERY,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(fe.NAME)&&(n=this.parseName()),this.node(e,{kind:v,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(fe.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(fe.PAREN_L,this.parseVariableDefinition,fe.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:y,variable:this.parseVariable(),type:(this.expectToken(fe.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(fe.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(fe.DOLLAR),this.node(e,{kind:w,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:g,selections:this.many(fe.BRACE_L,this.parseSelection,fe.BRACE_R)})}parseSelection(){return this.peek(fe.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(fe.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:T,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(fe.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(fe.PAREN_L,t,fe.PAREN_R)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(fe.PAREN_L,e,fe.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:E,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(fe.COLON),this.node(e,{kind:b,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(fe.SPREAD);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(fe.NAME)){const t=this.parseFragmentName();return this.peek(fe.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(e,{kind:N,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:N,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:S,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:L,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:L,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case fe.BRACKET_L:return this.parseList(e);case fe.BRACE_L:return this.parseObject(e);case fe.INT:return this.advanceLexer(),this.node(t,{kind:I,value:t.value});case fe.FLOAT:return this.advanceLexer(),this.node(t,{kind:O,value:t.value});case fe.STRING:case fe.BLOCK_STRING:return this.parseStringLiteral();case fe.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_,value:!0});case"false":return this.node(t,{kind:_,value:!1});case"null":return this.node(t,{kind:A});default:return this.node(t,{kind:D,value:t.value})}case fe.DOLLAR:if(e){if(this.expectToken(fe.DOLLAR),this._lexer.token.kind===fe.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k,value:e.value,block:e.kind===fe.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:x,values:this.any(fe.BRACKET_L,(()=>this.parseValueLiteral(e)),fe.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:$,fields:this.any(fe.BRACE_L,(()=>this.parseObjectField(e)),fe.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:F,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(fe.AT);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(fe.AT),this.node(t,{kind:G,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(fe.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(fe.BRACKET_R),t=this.node(e,{kind:C,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(fe.BANG)?this.node(e,{kind:R,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Q,name:this.parseName()})}peekDescription(){return this.peek(fe.STRING)||this.peek(fe.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);return this.node(e,{kind:V,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(fe.COLON);const n=this.parseNamedType();return this.node(e,{kind:j,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:M,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:U,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(fe.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseFieldDefinition,fe.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(fe.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:P,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(fe.PAREN_L,this.parseInputValueDef,fe.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(fe.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(fe.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:B,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:J,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:q,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(fe.EQUALS)?this.delimitedMany(fe.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:K,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(fe.BRACE_L,this.parseEnumValueDefinition,fe.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:z,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${je(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Y,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseInputValueDef,fe.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===fe.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:W,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:X,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Z,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ee,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:te,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ne,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:re,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(fe.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:H,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(fe.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${Me(e)}, found ${je(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==fe.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${je(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===fe.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${je(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==fe.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function je(e){const t=e.value;return Me(e.kind)+(null!=t?` "${t}"`:"")}function Me(e){return function(e){return e===fe.BANG||e===fe.DOLLAR||e===fe.AMP||e===fe.PAREN_L||e===fe.PAREN_R||e===fe.SPREAD||e===fe.COLON||e===fe.EQUALS||e===fe.AT||e===fe.BRACKET_L||e===fe.BRACKET_R||e===fe.BRACE_L||e===fe.PIPE||e===fe.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function Ue(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Pe(e){return Be("and",e)}function Be(e,t){switch(0!==t.length||n(),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}function Je(e){return"object"==typeof e&&"function"==typeof e?.[Symbol.iterator]}function qe(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function Ke(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function ze(e){return 0===e.length?"":` at ${e.map((e=>"number"==typeof e?`[${e}]`:`.${e}`)).join("")}`}const Ye=5;function He(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+Be("or",r.slice(0,Ye).map((e=>`"${e}"`)))+"?"}function We(e){return e}function Xe(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function Ze(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-et,o=t.charCodeAt(r)}while(nt(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const et=48,tt=57;function nt(e){return!isNaN(e)&&et<=e&&e<=tt}function rt(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:Ze(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=it(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=it(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function it(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>mt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=yt("(",mt(e.variableDefinitions,", "),")"),n=mt([e.operation,mt([e.name,t]),mt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+yt(" = ",n)+yt(" ",mt(r," "))},SelectionSet:{leave:({selections:e})=>vt(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=mt([yt("",e,": "),t],"");return mt([Et(o,n),yt(" ",mt(r," ")),yt(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Et("..."+e,t)+yt(" ",mt(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>mt(["...",yt("on ",e),mt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${yt("(",mt(n,", "),")")} on ${t} ${yt("",mt(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||oe(e.charCodeAt(0)))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const p=r&&oe(e.charCodeAt(0));return(u&&!p||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(st,at)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+mt(e,", ")+"]";return t.length>80?"[\n"+gt(mt(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+mt(e,", ")+" }";return t.length>80?vt(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+yt("(",mt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>yt("",e,"\n")+mt(["schema",mt(t," "),vt(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt(["scalar",t,mt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["type",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>yt("",e,"\n")+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+": "+r+yt(" ",mt(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>yt("",e,"\n")+mt([t+": "+n,yt("= ",r),mt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["interface",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>yt("",e,"\n")+mt(["union",t,mt(n," "),yt("= ",mt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>yt("",e,"\n")+mt(["enum",t,mt(n," "),vt(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt([t,mt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>yt("",e,"\n")+mt(["input",t,mt(n," "),vt(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>yt("",e,"\n")+"directive @"+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+(r?" repeatable":"")+" on "+mt(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>mt(["extend schema",mt(e," "),vt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>mt(["extend scalar",e,mt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend type",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend interface",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>mt(["extend union",e,mt(t," "),yt("= ",mt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>mt(["extend enum",e,mt(t," "),vt(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>mt(["extend input",e,mt(t," "),vt(n)]," ")}};function mt(e,t=""){return e?.filter((e=>e)).join(t)??""}function vt(e){return yt("{\n",gt(mt(e,"\n")),"\n}")}function yt(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function gt(e){return yt(" ",e.replaceAll("\n","\n "))}function Tt(e){return e?.some((e=>e.includes("\n")))??!1}function Et(e,t){let n=e+yt("(",mt(t,", "),")");return n.length>80&&(n=e+yt("(\n",gt(mt(t,"\n")),"\n)")),n}function bt(e,t){switch(e.kind){case A:return null;case I:return parseInt(e.value,10);case O:return parseFloat(e.value);case k:case D:case _:return e.value;case x:return e.values.map((e=>bt(e,t)));case $:return Xe(e.fields,(e=>e.name.value),(e=>bt(e.value,t)));case w:return t?.[e.name.value]}}function Nt(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(bt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||xe(0,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&("function"==typeof e.coerceInputValue&&"function"==typeof e.coerceInputLiteral||xe(0,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Jt(e){return Pt(e??[])}function qt(e,t){return Ke(Bt(t),((t,n)=>new GraphQLField(e,n,t)))}class GraphQLField{constructor(e,t,n){this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type;const r=n.args;this.args=r?Object.entries(r).map((([e,t])=>new GraphQLArgument(this,e,t))):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}}class GraphQLArgument{constructor(e,t,n){this.parent=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function Kt(e){return xt(e.type)&&void 0===e.default&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=zt.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function zt(e){return Pt(e)}class GraphQLEnumType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values="function"==typeof e.values?e.values:Object.entries(e.values).map((([e,t])=>new GraphQLEnumValue(this,e,t))),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Object.entries(this._values()).map((([e,t])=>new GraphQLEnumValue(this,e,t)))),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=qe(this.getValues(),(e=>e.name))),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map((e=>[e.value,e]))));const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Ge(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if("string"!=typeof e){const n=Ge(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?"":Yt(this,n)))}const n=this.getValue(e);if(null==n)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==D){const n=ft(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?"":Yt(this,n)),{nodes:e})}const n=this.getValue(e.value);if(null==n){const n=ft(e);throw new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if("string"==typeof e&&this.getValue(e))return{kind:D,value:e}}toConfig(){return{name:this.name,description:this.description,values:Xe(this.getValues(),(e=>e.name),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Yt(e,t){return He("the enum value",rt(t,e.getValues().map((e=>e.name))))}class GraphQLEnumValue{constructor(e,t,n){this.parentEnum=e,this.name=function(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError(`Enum values cannot be named: ${e}`);return Nt(e)}(t),this.description=n.description,this.value=void 0!==n.value?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class GraphQLInputObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=Ht.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:Ke(this.getFields(),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Ht(e,t){return Ke(Bt(t),((t,n)=>new GraphQLInputField(e,n,t)))}class GraphQLInputField{constructor(e,t,n){!("resolve"in n)||xe(0,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function Wt(e){return xt(e.type)&&void 0===e.defaultValue&&void 0===e.default}function Xt(e,t){return e===t||(xt(e)&&xt(t)||!(!Dt(e)||!Dt(t)))&&Xt(e.ofType,t.ofType)}function Zt(e,t,n){return t===n||(xt(n)?!!xt(t)&&Zt(e,t.ofType,n.ofType):xt(t)?Zt(e,t.ofType,n):Dt(n)?!!Dt(t)&&Zt(e,t.ofType,n.ofType):!Dt(t)&&(Rt(n)&&(Ot(t)||wt(t))&&e.isSubType(n,t)))}function en(e,t,n){return t===n||(Rt(t)?Rt(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!Rt(n)&&e.isSubType(n,t))}function tn(e,t,n){return{prev:e,key:t,typename:n}}function nn(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function rn(e,n){if(xt(n)){if(null==e)return;return rn(e,n.ofType)}if(null==e)return{kind:A};if(Dt(n)){if(!Je(e))return rn(e,n.ofType);const t=[];for(const r of e){const e=rn(r,n.ofType);if(!e)return;t.push(e)}return{kind:x,values:t}}if(At(n)){if(!t(e))return;const r=[],i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(n.getFields())){if(void 0===e[t.name]){if(Wt(t))return}else{const n=rn(e[t.name],t.type);if(!n)return;r.push({kind:F,name:{kind:h,value:t.name},value:n})}}return{kind:$,fields:r}}const r=Qt(n);if(r.valueToLiteral)try{return r.valueToLiteral(e)}catch(e){return}return on(e)}function on(e){if(null==e)return{kind:A};switch(typeof e){case"boolean":return{kind:_,value:e};case"string":return{kind:k,value:e,block:!1};case"number":{if(!Number.isFinite(e))return{kind:A};const t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:O,value:t}}case"object":{if(Je(e))return{kind:x,values:Array.from(e,on)};const t=e,n=[];for(const e of Object.keys(t)){const r=t[e];void 0!==r&&n.push({kind:F,name:{kind:h,value:e},value:on(r)})}return{kind:$,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${Ge(e)}.`)}function sn(e,t,n){switch(e.kind){case w:{const r=e.name.value,i=n?.sources[r];if(i){const e=i.value;if(void 0===e){const e=i.signature.default;return void 0!==e?e.literal:{kind:A}}return sn(e,t,i.fragmentVariableValues)}const o=t?.sources[r];if(null==o)return{kind:A};if(void 0===o.value){const e=o.signature.default;if(void 0!==e)return e.literal}return rn(o.value,o.signature.type)}case $:{const r=[];for(const i of e.fields){if(i.value.kind===w){const e=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(void 0===e?.value&&void 0===e?.signature.default)continue}const e=sn(i.value,t,n);r.push({...i,value:e})}return{...e,fields:r}}case x:{const r=[];for(const i of e.values){const e=sn(i,t,n);r.push(e)}return{...e,values:r}}default:return e}}function an(e,t,n,r){return cn(e,t,n,r,void 0)}function cn(e,n,r,i,o){if(xt(n))return void 0===e?void un(r,`Expected a value of non-null type "${n}" to be provided.`,o):null===e?void un(r,`Expected value of non-null type "${n}" not to be null.`,o):cn(e,n.ofType,r,i,o);if(null!=e)if(Dt(n))if(Je(e)){let t=0;for(const s of e)cn(s,n.ofType,r,i,tn(o,t++,void 0))}else cn(e,n.ofType,r,i,o);else if(At(n)){if(!t(e)||Array.isArray(e))return void un(r,`Expected value of type "${n}" to be an object, found: ${Ge(e)}.`,o);const s=n.getFields();for(const t of Object.values(s)){const s=e[t.name];void 0===s?Wt(t)&&un(r,`Expected value of type "${n}" to include required field "${t.name}", found: ${Ge(e)}.`,o):cn(s,t.type,r,i,tn(o,t.name,n.name))}const a=Object.keys(e);for(const t of a)if(!Object.hasOwn(s,t)){const i=He(rt(t,Object.keys(s)));un(r,`Expected value of type "${n}" not to include unknown field "${t}"${i?`.${i} Found`:", found"}: ${Ge(e)}.`,o)}if(n.isOneOf){1!==a.length&&un(r,`Exactly one key must be specified for OneOf type "${n}".`,o);const t=a[0];null===e[t]&&un(r,`Field "${t}" for OneOf type "${n}" must be non-null.`,o)}}else{let t,s;Qt(n);try{t=n.coerceInputValue(e,i)}catch(e){if(e instanceof GraphQLError)return void r(e,nn(o));s=e}void 0===t&&un(r,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${Ge(e)}.`,o,s)}}function un(e,t,n,r){e(new GraphQLError(t,{originalError:r}),nn(n))}function ln(e,t,n,r,i,o){return pn({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function pn(e,t,n,r,i){if(t.kind!==w){if(xt(n))return t.kind===A?void fn(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i):pn(e,t,n.ofType,r,i);if(t.kind!==A)if(Dt(n))if(t.kind!==x)pn(e,t,n.ofType,r,i);else{let o=0;for(const s of t.values)pn(e,s,n.ofType,r,tn(i,o++,void 0))}else if(At(n)){if(t.kind!==$)return void fn(e.onError,`Expected value of type "${n}" to be an object, found: ${ft(t)}.`,t,i);const o=n.getFields(),s=qe(t.fields,(e=>e.name.value));for(const a of Object.values(o)){const o=s[a.name];if(void 0===o)Wt(a)&&fn(e.onError,`Expected value of type "${n}" to include required field "${a.name}", found: ${ft(t)}.`,t,i);else{const s=o.value;if(s.kind===w&&!e.static){const r=dn(e,s),o=s.name.value,c=r?.coerced[o];if(n.isOneOf)void 0===c?fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):null===c&&fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(void 0===c&&!Wt(a))continue}pn(e,s,a.type,r,tn(i,a.name,n.name))}}const a=t.fields;for(const s of a){const a=s.name.value;if(!Object.hasOwn(o,a)){const c=r?"":He(rt(a,Object.keys(o)));fn(e.onError,`Expected value of type "${n}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ft(t)}.`,s,i)}}if(n.isOneOf){if(1!==a.length)return void fn(e.onError,`OneOf Input Object "${n}" must specify exactly one key.`,t,i);if(a[0].value.kind===A){const r=a[0].name.value;fn(e.onError,`Field "${n}.${r}" used for OneOf Input Object must be non-null.`,t,tn(i,r,void 0))}}}else{let o,s;Qt(n);try{o=n.coerceInputLiteral?n.coerceInputLiteral(sn(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(t){if(t instanceof GraphQLError)return void e.onError(t,nn(i));s=t}void 0===o&&fn(e.onError,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${ft(t)}.`,t,i,s)}}else{if(e.static)return;const r=dn(e,t),o=r?.coerced[t.name.value];xt(n)&&(void 0===o?fn(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):null===o&&fn(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i))}}function dn(e,t){const n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function fn(e,t,n,r,i){e(new GraphQLError(t,{nodes:n,originalError:i}),nn(r))}const hn=2147483647,mn=-2147483648,vn=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Ge(t)}`);if(n>hn||nhn||ehn||t=mn)return{kind:I,value:String(e)}}}),yn=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(t)}`);return n},coerceInputValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==O&&e.kind!==I)throw new GraphQLError(`Float cannot represent non numeric value: ${ft(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){const t=on(e);if(t.kind===O||t.kind===I)return t}}),gn=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError(`String cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"!=typeof e)throw new GraphQLError(`String cannot represent a non string value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==k)throw new GraphQLError(`String cannot represent a non string value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===k)return t}}),Tn=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(t)}`)},coerceInputValue(e){if("boolean"!=typeof e)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===_)return t}}),En=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputLiteral(e){if(e.kind!==k&&e.kind!==I)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+ft(e),{nodes:e});return e.value},valueToLiteral(e){const t=Number.isInteger(e)?String(e):e;if("string"==typeof t)return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:k,value:t,block:!1}}}),bn=Object.freeze([gn,vn,yn,Tn,En]);function Nn(e){return bn.some((({name:t})=>e.name===t))}function Sn(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Ln(e){return Ce(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Nt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=ot(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||xe(0,`@${this.name} locations must be an Array.`);const n=e.args??{};t(n)&&!Array.isArray(n)||xe(0,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(n).map((([e,t])=>new GraphQLArgument(this,e,t)))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const wn=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Included when true."}}}),In=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Skipped when true."}}}),On=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),kn=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{initialCount:{default:{value:0},type:new GraphQLNonNull(vn),description:"Number of items to return immediately"},if:{type:new GraphQLNonNull(Tn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),_n="No longer supported",An=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:new GraphQLNonNull(gn),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:_n}}}}),Dn=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(gn),description:"The URL that specifies the behavior of this scalar."}}}),xn=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[f.INPUT_OBJECT],args:{}});new GraphQLDirective({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[f.QUERY,f.MUTATION,f.SUBSCRIPTION]});const $n=Object.freeze([wn,In,An,Dn,xn]);function Fn(e){return $n.some((({name:t})=>t===e.name))}function Gn(e,r){if(xt(r)){const t=Gn(e,r.ofType);return t?.kind===A?null:t}if(null===e)return{kind:A};if(void 0===e)return null;if(Dt(r)){const t=r.ofType;if(Je(e)){const n=[];for(const r of e){const e=Gn(r,t);null!=e&&n.push(e)}return{kind:x,values:n}}return Gn(e,t)}if(At(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=Gn(e[t.name],t.type);r&&n.push({kind:F,name:{kind:h,value:t.name},value:r})}return{kind:$,fields:n}}if(Gt(r)){const t=r.coerceOutputValue(e);if(null==t)return null;if("boolean"==typeof t)return{kind:_,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return Qn.test(e)?{kind:I,value:e}:{kind:O,value:e}}if("string"==typeof t)return _t(r)?{kind:D,value:t}:r===En&&Qn.test(t)?{kind:I,value:t}:{kind:k,value:t};throw new TypeError(`Cannot convert value to AST: ${Ge(t)}.`)}n(0,"Unexpected input type: "+Ge(r))}const Qn=/^-?(?:0|[1-9][0-9]*)$/;function Cn(e){const t=e.type,r=e.default;if(r){const e=r.literal??rn(r.value,t);return null!=e||n(0,"Invalid default value"),e}const i=e.defaultValue;if(void 0!==i){const e=Gn(i,t);return null!=e||n(0,"Invalid default value"),e}}const Rn=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:gn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Mn))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Mn),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Mn,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Mn,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Vn))),resolve:e=>e.getDirectives()}})}),Vn=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(Tn),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(jn))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),jn=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:f.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Mn=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(qn),resolve:e=>Lt(e)?Jn.SCALAR:wt(e)?Jn.OBJECT:Ot(e)?Jn.INTERFACE:kt(e)?Jn.UNION:_t(e)?Jn.ENUM:At(e)?Jn.INPUT_OBJECT:Dt(e)?Jn.LIST:xt(e)?Jn.NON_NULL:void n(0,`Unexpected type: "${Ge(e)}".`)},name:{type:gn,resolve:e=>"name"in e?e.name:void 0},description:{type:gn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:gn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Un)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(wt(e)||Ot(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e){if(wt(e)||Ot(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e,t,n,{schema:r}){if(Rt(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Bn)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(_t(e)){const n=e.getValues();return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(Pn)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(At(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Mn,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:Tn,resolve:e=>{if(At(e))return e.isOneOf}}})}),Un=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Pn=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},defaultValue:{type:gn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const t=Cn(e);return t?ft(t):null}},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Bn=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Jn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},qn=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Jn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Jn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Jn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Jn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Jn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Jn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Jn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Jn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Kn=new GraphQLField(void 0,"__schema",{type:new GraphQLNonNull(Rn),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),zn=new GraphQLField(void 0,"__type",{type:Mn,description:"Request the type information of a single type.",args:{name:{type:new GraphQLNonNull(gn)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),Yn=new GraphQLField(void 0,"__typename",{type:new GraphQLNonNull(gn),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Hn=Object.freeze([Rn,Vn,jn,Mn,Un,Pn,Bn,qn]);function Wn(e){return Hn.some((({name:t})=>e.name===t))}function Xn(e){if(!function(e){return Ce(e,GraphQLSchema)}(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.assumeValid=e.assumeValid??!1,this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??$n;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Zn(n,t);null!=this._queryType&&Zn(this._queryType,t),null!=this._mutationType&&Zn(this._mutationType,t),null!=this._subscriptionType&&Zn(this._subscriptionType,t);for(const e of this._directives)if(Ln(e))for(const n of e.args)Zn(n.type,t);Zn(Rn,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Ot(e)){for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(wt(e))for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return kt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(kt(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Kn.name:return this.getQueryType()===e?Kn:void 0;case zn.name:return this.getQueryType()===e?zn:void 0;case Yn.name:return Yn}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Zn(e,t){const n=Ut(e);if(!t.has(n))if(t.add(n),kt(n))for(const e of n.getTypes())Zn(e,t);else if(wt(n)||Ot(n)){for(const e of n.getInterfaces())Zn(e,t);for(const e of Object.values(n.getFields())){Zn(e.type,t);for(const n of e.args)Zn(n.type,t)}}else if(At(n))for(const e of Object.values(n.getFields()))Zn(e.type,t);return t}function er(e){if(Xn(e),e.__validationErrors)return e.__validationErrors;const n=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(wt(i))n.add(i,r);else{const n=Ue(r),o=Ge(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,tr(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=Pe(i);e.reportError(`All root types must be different, "${r}" type is used as ${n} root types.`,i.map((e=>tr(t,e))))}}(n),function(e){for(const t of e.schema.getDirectives())if(Ln(t)){ir(e,t),0===t.locations.length&&e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}else e.reportError(`Expected directive but got: ${Ge(t)}.`,t?.astNode)}(n),function(e){const n=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(xt(t.type)&&At(t.type.ofType)){const s=t.type.ofType,a=r[s.name];if(n.push({fieldStr:`${o}.${t.name}`,astNode:t.astNode}),void 0===a)i(s);else{const t=n.slice(a),r=t.map((e=>e.fieldStr)).join(", ");e.reportError(`Invalid circular reference. The Input Object ${s} references itself ${t.length>1?"via the non-null fields:":"in the non-null field"} ${r}.`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),r=function(e){const n=Object.create(null),r=[],i=Object.create(null);return function(e){return o(e,Object.create(null))};function o(e,n){if(Je(n))for(const t of n)o(e,t);else if(t(n))for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?o(r,n[t.name]):a(t,r,`${e}.${t.name}`))}}function s(e,t){if(t.kind===x){for(const n of t.values)s(e,n);return}if(t.kind!==$)return;const n=qe(t.fields,(e=>e.name.value));for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?s(r,n[t.name].value):a(t,r,`${e}.${t.name}`))}}function a(t,a,c){const u=t.default;if(void 0===u)return;const l=i[c];void 0===l?void 0===n[c]&&(n[c]=!0,i[c]=r.push([c,t.astNode?.defaultValue]),u.literal?s(a,u.literal):o(a,u.value),r.pop(),i[c]=void 0):e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${le)).join(", ")}`:""}.`,r.slice(l-1).map((([,e])=>e)))}}(e),i=e.schema.getTypeMap();for(const t of Object.values(i))Mt(t)?(Wn(t)||ir(e,t),wt(t)||Ot(t)?(or(e,t),sr(e,t)):kt(t)?ur(e,t):_t(t)?lr(e,t):At(t)&&(pr(e,t),n(t),r(t))):e.reportError(`Expected GraphQL named type but got: ${Ge(t)}.`,t.astNode)}(n);const r=n.getErrors();return e.__validationErrors=r,r}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function tr(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function nr(e,t){const n=t.default;if(n)if(n.literal)ln(n.literal,t.type,((n,r)=>{e.reportError(`${t} has invalid default value${ze(r)}: ${n.message}`,n.nodes)}));else{const r=[];if(an(n.value,t.type,((e,t)=>{r.push([e,t])})),r.length>0)try{const r=rr(n.value,t.type),i=[];if(an(r,t.type,((e,t)=>{i.push([e,t])})),0===i.length)return void e.reportError(`${t} has invalid default value: ${Ge(n.value)}. Did you mean: ${Ge(r)}?`,t.astNode?.defaultValue)}catch(e){}for(const[n,i]of r)e.reportError(`${t} has invalid default value${ze(i)}: ${n.message}`,t.astNode?.defaultValue)}}function rr(e,r){if(xt(r))return rr(e,r.ofType);if(null===e)return null;if(Dt(r))return Je(e)?Array.from(e,(e=>rr(e,r.ofType))):[rr(e,r.ofType)];if(At(r)){t(e)||n();const i=r.getFields();return Ke(e,((e,t)=>(t in i||n(),rr(e,i[t].type))))}return Qt(r),r.coerceOutputValue(e)}function ir(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function or(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const t of n){ir(e,t),Ft(t.type)||e.reportError(`The type of ${t} must be Output Type but got: ${Ge(t.type)}.`,t.astNode?.type);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode?.type),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}}function sr(e,t){const n=new Set;for(const r of t.getInterfaces())Ot(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t} can only implement ${r} once.`,fr(t,r)):(n.add(r.name),cr(e,t,r),ar(e,t,r)):e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,fr(t,r)):e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${Ge(r)}.`,fr(t,r))}function ar(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=r[i.name];if(null!=o){Zt(e.schema,o.type,i.type)||e.reportError(`Interface field ${i} expects type ${i.type} but ${o} is type ${o.type}.`,[i.astNode?.type,o.astNode?.type]);for(const t of i.args){const n=o.args.find((e=>e.name===t.name));n?Xt(t.type,n.type)||e.reportError(`Interface field argument ${t} expects type ${t.type} but ${n} is type ${n.type}.`,[t.astNode?.type,n.astNode?.type]):e.reportError(`Interface field argument ${t} expected but ${o} does not provide it.`,[t.astNode,o.astNode])}for(const t of o.args)if(Kt(t)){i.args.find((e=>e.name===t.name))||e.reportError(`Argument "${t}" must not be required type "${t.type}" if not provided by the Interface field "${i}".`,[t.astNode,i.astNode])}null!=o.deprecationReason&&null==i.deprecationReason&&e.reportError(`Interface field ${n.name}.${i.name} is not deprecated, so implementation field ${t.name}.${o.name} must not be deprecated.`,[mr(o.astNode),o.astNode?.type])}else e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function cr(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...fr(n,i),...fr(t,n)])}function ur(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t} can only include type ${i} once.`,hr(t,i.name)):(r.add(i.name),wt(i)||e.reportError(`Union type ${t} can only include Object types, it cannot include ${Ge(i)}.`,hr(t,String(i))))}function lr(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)ir(e,t)}function pr(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)ir(e,r),$t(r.type)||e.reportError(`The type of ${r} must be Input Type but got: ${Ge(r.type)}.`,r.astNode?.type),Wt(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${r} cannot be deprecated.`,[mr(r.astNode),r.astNode?.type]),nr(e,r),t.isOneOf&&dr(t,r,e)}function dr(e,t,n){xt(t.type)&&n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type),void 0===t.default&&void 0===t.defaultValue||n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function fr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function hr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function mr(e){return e?.directives?.find((e=>e.name.value===An.name))}function vr(e,t){switch(t.kind){case C:{const n=vr(e,t.type);return n&&new GraphQLList(n)}case R:{const n=vr(e,t.type);return n&&new GraphQLNonNull(n)}case Q:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t&&($t(t)&&this._inputTypeStack.push(t),Ct(t)&&this._parentTypeStack.push(t),Ft(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case m:{const t=function(e){const t=new Map;for(const n of e.definitions)if(n.kind===L){const e=new Map;if(n.variableDefinitions)for(const t of n.variableDefinitions)e.set(t.variable.name.value,t);const r={definition:n,variableDefinitions:e};t.set(n.name.value,r)}return t}(e);this._fragmentSignaturesByName=e=>t.get(e);break}case g:{const e=Ut(this.getType());this._parentTypeStack.push(Ct(e)?e:void 0);break}case T:{const n=this.getParentType();let r,i;n&&(r=t.getField(n,e.name.value),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Ft(i)?i:void 0);break}case G:this._directive=t.getDirective(e.name.value);break;case v:{const n=t.getRootType(e.operation);this._typeStack.push(wt(n)?n:void 0);break}case N:this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break;case S:case L:{const n=e.typeCondition,r=n?vr(t,n):Ut(this.getType());this._typeStack.push(Ft(r)?r:void 0);break}case y:{const n=vr(t,e.type);this._inputTypeStack.push($t(n)?n:void 0);break}case E:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?.default??t?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case b:{const t=this.getFragmentSignature(),n=t?.variableDefinitions.get(e.name.value);let r;this._fragmentArgument=n,n&&(r=vr(this._schema,n.type)),this._inputTypeStack.push($t(r)?r:void 0);break}case x:{const e=function(e){if(e)return xt(e)?e.ofType:e}(this.getInputType()),t=Dt(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push($t(t)?t:void 0);break}case F:{const t=Ut(this.getInputType());let n,r;At(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?.default??r?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case D:{const t=Ut(this.getInputType());let n;_t(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case m:this._fragmentSignaturesByName=()=>null;break;case g:this._parentTypeStack.pop();break;case T:this._fieldDefStack.pop(),this._typeStack.pop();break;case G:this._directive=null;break;case N:this._fragmentSignature=null;break;case v:case S:case L:this._typeStack.pop();break;case y:this._inputTypeStack.pop();break;case E:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case b:this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case x:case F:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case D:this._enumValue=null}}}function yr(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=dt(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=dt(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function gr(e){const t=e.arguments?.find((e=>"if"===e.name.value));if(!t)return!1;if(t.value.kind===_){if(t.value.value)return!1}else if(t.value.kind!==w)return!1;return!0}function Tr(e){return e.kind===v||e.kind===L}function Er(e){return e.kind===M||e.kind===U||e.kind===J||e.kind===q||e.kind===K||e.kind===Y}function br(e){return e.kind===X||e.kind===Z||e.kind===ee||e.kind===te||e.kind===ne||e.kind===re}function Nr(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,e.args.map((e=>e.name)));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,n.map((e=>e.name.value)))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=rt(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+(e.hideSuggestions?"":He(o)),{nodes:t}))}}return!1}}}function Sr(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():$n;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===H&&t.set(e.name.value,e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(),t.kind){case v:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case T:return f.FIELD;case N:return f.FRAGMENT_SPREAD;case S:return f.INLINE_FRAGMENT;case L:return f.FRAGMENT_DEFINITION;case y:{const t=e[e.length-3];return"kind"in t||n(),t.kind===v?f.VARIABLE_DEFINITION:f.FRAGMENT_VARIABLE_DEFINITION}case V:case W:return f.SCHEMA;case M:case X:return f.SCALAR;case U:case Z:return f.OBJECT;case P:return f.FIELD_DEFINITION;case J:case ee:return f.INTERFACE;case q:case te:return f.UNION;case K:case ne:return f.ENUM;case z:return f.ENUM_VALUE;case Y:case re:return f.INPUT_OBJECT;case B:{const t=e.at(-3);return null!=t&&"kind"in t||n(),t.kind===Y?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(0,"Unexpected kind: "+Ge(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function Lr(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Er).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===V||Er(e)||e.kind===H}(c)||function(e){return e.kind===W||br(e)}(c)));if(o&&wr.has(a))return;const u=e.hideSuggestions?[]:rt(a,o?[...wr,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+He(u),{nodes:t}))}var c}}}const wr=new Set([...bn,...Hn].map((e=>e.name)));function Ir(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Or(e){switch(e.kind){case $:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:Or(e.value)}))).sort(((e,t)=>Ze(e.name.value,t.name.value))))};case x:return{...e,values:e.values.map(Or)};case I:case O:case k:case _:case A:case D:case w:return e}var t}function kr(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+kr(t))).join(" and "):e}function _r(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);const c=e.getFragment(a.node.name.value);if(!c)return;const[u,l]=Vr(e,n,c,a.varMap);if(s!==u){Dr(e,t,n,r,i,o,s,void 0,u,a.varMap);for(const a of l)_r(e,t,n,r,i,o,s,a)}}function Ar(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value&&!$r(s.node.arguments,s.varMap,a.node.arguments,a.varMap))return void e.reportError(new GraphQLError(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);const c=e.getFragment(s.node.name.value),u=e.getFragment(a.node.name.value);if(!c||!u)return;const[l,p]=Vr(e,n,c,s.varMap),[d,f]=Vr(e,n,u,a.varMap);Dr(e,t,n,r,i,o,l,s.varMap,d,a.varMap);for(const a of f)Ar(e,t,n,r,i,o,s,a);for(const s of p)Ar(e,t,n,r,i,o,s,a)}function Dr(e,t,n,r,i,o,s,a,c,u){for(const[l,p]of s.entries()){const s=c.get(l);if(null!=s)for(const c of p)for(const p of s){const s=xr(e,n,r,i,o,l,c,a,p,u);s&&t.push(s)}}}function xr(e,t,n,r,i,o,s,a,c,u){const[l,p,d]=s,[f,h,m]=c,v=i||l!==f&&wt(l)&&wt(f);if(!v){const e=p.name.value,t=h.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[p],[h]];if(!$r(p.arguments,a,h.arguments,u))return[[o,"they have differing arguments"],[p],[h]]}const y=function(e,t,n,r){const i=Qr(e),o=Qr(n);if(!i&&!o)return;if(i&&o)return $r(i.arguments,t,o.arguments,r)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives";return"they have overlapping stream directives"}(p.directives??[],a,h.directives??[],u);if(void 0!==y)return[[o,y],[p],[h]];const g=d?.type,T=m?.type;if(g&&T&&Cr(g,T))return[[o,`they return conflicting types "${Ge(g)}" and "${Ge(T)}"`],[p],[h]];const E=p.selectionSet,b=h.selectionSet;if(E&&b){const i=function(e,t,n,r,i,o,s,a,c,u,l){const p=[],[d,f]=Rr(e,t,o,s,a),[h,m]=Rr(e,t,c,u,l);Dr(e,p,t,n,r,i,d,a,h,l);for(const o of m)_r(e,p,t,n,r,i,d,o);for(const o of f)_r(e,p,t,n,r,i,h,o);for(const o of f)for(const s of m)Ar(e,p,t,n,r,i,o,s);return p}(e,t,n,r,v,Ut(g),E,a,Ut(T),b,u);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(i,o,p,h)}}function $r(e,t,n,r){if(void 0===e||0===e.length)return void 0===n||0===n.length;if(void 0===n||0===n.length)return!1;if(e.length!==n.length)return!1;const i=new Map(n.map((({name:e,value:t})=>[e.value,void 0===r?t:Fr(t,r)])));return e.every((e=>{let n=e.value;t&&(n=Fr(n,t));const r=i.get(e.name.value);return void 0!==r&&Gr(n)===Gr(r)}))}function Fr(e,t){switch(e.kind){case w:return t.get(e.name.value)??e;case x:return{...e,values:e.values.map((e=>Fr(e,t)))};case $:return{...e,fields:e.fields.map((e=>({...e,value:Fr(e.value,t)})))};default:return e}}function Gr(e){return ft(Or(e))}function Qr(e){return e.find((e=>"stream"===e.name.value))}function Cr(e,t){return Dt(e)?!Dt(t)||Cr(e.ofType,t.ofType):!!Dt(t)||(xt(e)?!xt(t)||Cr(e.ofType,t.ofType):!!xt(t)||!(!Gt(e)&&!Gt(t))&&e!==t)}function Rr(e,t,n,r,i){const o=t.get(r);if(o)return o;const s=new Map,a=new Map;jr(e,n,r,s,a,i);const c=[s,Array.from(a.values())];return t.set(r,c),c}function Vr(e,t,n,r){const i=t.get(n.selectionSet);if(i)return i;const o=vr(e.getSchema(),n.typeCondition);return Rr(e,t,o,n.selectionSet,r)}function jr(e,t,n,r,i,o){for(const s of n.selections)switch(s.kind){case T:{const e=s.name.value;let n;(wt(t)||Ot(t))&&(n=t.getFields()[e]);const i=s.alias?s.alias.value:e;let o=r.get(i);null==o&&(o=[],r.set(i,o)),o.push([t,s,n]);break}case N:{const t=Mr(e,s,o);i.set(t.key,t);break}case S:{const n=s.typeCondition,a=n?vr(e.getSchema(),n):t;jr(e,a,s.selectionSet,r,i,o);break}}}function Mr(e,t,n){let r="";const i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(const e of t.arguments)s.set(e.name.value,e.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(const[e,t]of o.variableDefinitions){const o=s.get(e);o&&(r+=e+": "+ft(Or(o)));const a=s.get(e);void 0!==a?i.set(e,void 0!==n?Fr(a,n):a):t.defaultValue&&i.set(e,t.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){const r=this._data.get(e)?.get(t);return void 0!==r&&(!!n||n===r)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e[e.name,e]))));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(Br).map((e=>[e.name.value,e]))))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of i.entries())if(!o.has(t)){const i=St(s.type)?Ge(s.type):ft(s.type);e.reportError(new GraphQLError(`Argument "@${r}(${t}:)" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Br(e){return e.type.kind===R&&null==e.defaultValue}function Jr(e,n){if(xt(n)){if(null==e)return;return Jr(e,n.ofType)}if(null==e)return null;if(Dt(n)){if(!Je(e)){const t=Jr(e,n.ofType);if(void 0===t)return;return[t]}const t=[];for(const r of e){const e=Jr(r,n.ofType);if(void 0===e)return;t.push(e)}return t}if(At(n)){if(!t(e)||Array.isArray(e))return;const r={},i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(i)){const n=e[t.name];if(void 0===n){if(Wt(t))return;const e=zr(t);void 0!==e&&(r[t.name]=e)}else{const e=Jr(n,t.type);if(void 0===e)return;r[t.name]=e}}if(n.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}const r=Qt(n);try{return r.coerceInputValue(e)}catch(e){}}function qr(e,t,n,r){if(e.kind===w){const i=Kr(e,n,r);if(null==i&&xt(t))return;return i}if(xt(t)){if(e.kind===A)return;return qr(e,t.ofType,n,r)}if(e.kind===A)return null;if(Dt(t)){if(e.kind!==x){const i=qr(e,t.ofType,n,r);if(void 0===i)return;return[i]}const i=[];for(const o of e.values){let e=qr(o,t.ofType,n,r);if(void 0===e){if(o.kind!==w||null!=Kr(o,n,r)||xt(t.ofType))return;e=null}i.push(e)}return i}if(At(t)){if(e.kind!==$)return;const i={},o=t.getFields();if(e.fields.some((e=>!Object.hasOwn(o,e.name.value))))return;const s=new Map(e.fields.map((e=>[e.name.value,e])));for(const e of Object.values(o)){const t=s.get(e.name);if(!t||t.value.kind===w&&null==Kr(t.value,n,r)){if(Wt(e))return;const t=zr(e);void 0!==t&&(i[e.name]=t)}else{const o=qr(t.value,e.type,n,r);if(void 0===o)return;i[e.name]=o}}if(t.isOneOf){const e=Object.keys(i);if(1!==e.length)return;if(null===i[e[0]])return}return i}const i=Qt(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(sn(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(e){}}function Kr(e,t,n){const r=e.name.value;return void 0!==n?.sources[r]?n.coerced[r]:t?.coerced[r]}function zr(e){let t=e._memoizedCoercedDefaultValue;if(void 0!==t)return t;const r=e.default;if(void 0!==r)return t=r.literal?qr(r.literal,e.type):Jr(r.value,e.type),void 0!==t||n(),e._memoizedCoercedDefaultValue=t,t;const i=e.defaultValue;return void 0!==i&&(e._memoizedCoercedDefaultValue=i),i}function Yr(e,t,n,r,i){const o=e.arguments??[],s=new Map(o.map((e=>[e.name.value,e]))),a=Object.create(null),c=Object.create(null);for(const[o,u]of Object.entries(t)){a[o]={signature:u};const t=s.get(o);if(void 0!==t){const e=a[o];e.value=t.value,e.fragmentVariableValues=r}Wr(c,e,o,u,t,n,r,i)}return{sources:a,coerced:c}}function Hr(e,t,n,r,i){const o={},s=t.arguments??[],a=new Map(s.map((e=>[e.name.value,e])));for(const s of e.args){Wr(o,t,s.name,s,a.get(s.name),n,r,i)}return o}function Wr(e,t,r,i,o,s,a,c){const u=i.type;if(!o){if(Kt(i))throw new GraphQLError(`Argument "${It(i)?i:r}" of required type "${u}" was not provided.`,{nodes:t});const n=zr(i);return void(void 0!==n&&(e[r]=n))}const l=o.value;if(l.kind===w){const t=l.name.value,n=a?.sources[t]?a:s;if(!(null!=n&&Object.hasOwn(n.coerced,t)||Kt(i))){const t=zr(i);return void(void 0!==t&&(e[r]=t))}}const p=qr(l,u,s,a);void 0===p&&(ln(l,u,((e,t)=>{throw e.message=`Argument "${It(i)?i:i.name}" has invalid value${ze(t)}: ${e.message}`,e}),s,a,c),n(0,"Invalid argument")),e[r]=p}function Xr(e,t,n,r,i){const o=t.directives?.find((t=>t.name.value===e.name));if(o)return Hr(e,o,n,r,i)}function Zr(e,t,n,r,i,o,s=!1){const a=new AccumulatorMap,c=[],u={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Set,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return ei(u,i,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:u.forbiddenDirectiveInstances}}function ei(e,t,n,r,i,o){const{schema:s,fragments:a,variableValues:c,runtimeType:u,visitedFragmentNames:l,hideSuggestions:p}=e;for(const f of t.selections)switch(f.kind){case T:if(!ni(e,f,c,o))continue;n.add((d=f).alias?d.alias.value:d.name.value,{node:f,deferUsage:i,fragmentVariableValues:o});break;case S:{if(!ni(e,f,c,o)||!ri(s,f,u))continue;const t=ti(c,o,f,i);t?(r.push(t),ei(e,f.selectionSet,n,r,t,o)):ei(e,f.selectionSet,n,r,i,o);break}case N:{const t=f.name.value;if(l.has(t)||!ni(e,f,c,o))continue;const d=a[t];if(null==d||!ri(s,d.definition,u))continue;const h=ti(c,o,f,i),m=d.variableSignatures;let v;m&&(v=Yr(f,m,c,o,p)),h?(r.push(h),ei(e,d.definition.selectionSet,n,r,h,v)):(l.add(t),ei(e,d.definition.selectionSet,n,r,i,v));break}}var d}function ti(e,t,n,r){const i=Xr(On,n,e,t);if(i&&!1!==i.if)return{label:"string"==typeof i.label?i.label:void 0,parentDeferUsage:r}}function ni(e,t,n,r){const i=t.directives?.find((e=>e.name.value===In.name));if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;const o=i?Hr(In,i,n,r,e.hideSuggestions):void 0;if(!0===o?.if)return!1;const s=t.directives?.find((e=>e.name.value===wn.name));if(s&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(s),!1;const a=s?Hr(wn,s,n,r,e.hideSuggestions):void 0;return!1!==a?.if}function ri(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=vr(e,r);return i===n||!!Rt(i)&&e.isSubType(i,n)}function ii(e){return e.map((e=>e.node))}function oi(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function si(e){return{Field:t,Directive:t};function t(t){const n=oi(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function ai(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===H&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===V||n.kind===W)r=o;else if(Er(n)||br(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function ci(e,t){return!!(wt(e)||Ot(e)||At(e))&&null!=e.getFields()[t]}function ui(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function li(e,t,n){return n&&ln(t,n,(t=>{e.reportError(t)}),void 0,void 0,e.hideSuggestions),!1}function pi(e,t,n,r,i){if(xt(r)&&!xt(t)){if(!(null!=n&&n.kind!==A)&&!(void 0!==i))return!1;return Zt(e,t,r.ofType)}return Zt(e,t,r)}const di=Object.freeze([function(e){function t(n,r=Object.create(null),i=0){if(n.kind===N){const o=n.name.value;if(!0===r[o])return!1;const s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===T&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}]),fi=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!Tr(n)){const t=n.kind===V||n.kind===W?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=e.getSchema();return{OperationDefinition(n){const r=n.operation;t.getRootType(r)||e.reportError(new GraphQLError(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===v)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===L&&(a[e.name.value]={definition:e});const{groupedFieldSet:c,forbiddenDirectiveInstances:u}=Zr(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(u.length>0)return void e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:u}));if(c.size>1){const t=[...c.values()].slice(1).flatMap((e=>ii(e)));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){ii(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ii(t)}))}}}}}},Lr,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=vr(e.getSchema(),n);if(t&&!Ct(t)){const t=ft(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=vr(e.getSchema(),t.typeCondition);if(n&&!Ct(n)){const n=ft(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=vr(e.getSchema(),t.type);if(void 0!==n&&!$t(n)){const n=t.variable.name.value,r=ft(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Gt(Ut(n))){if(r){const i=t.name.value,o=Ge(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=He("to use an inline fragment on",e.hideSuggestions?[]:function(e,t,n){if(!Rt(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Ot(t)&&e.isSubType(t,n)?-1:Ot(n)&&e.isSubType(n,t)?1:Ze(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=He(e.hideSuggestions?[]:function(e,t){if(wt(e)||Ot(e)){return rt(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},Ir,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Ct(n)&&Ct(r)&&!en(e.getSchema(),n,r)){const i=Ge(r),o=Ge(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=vr(e.getSchema(),n.typeCondition);if(Ct(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!en(e.getSchema(),r,i)){const o=Ge(i),s=Ge(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=oi(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i,fragmentVariableDefinition:o}of r){if(o)continue;const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{FragmentDefinition(t){const n=e.getVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(`Variable "$${i}" is never used in fragment "${t.name.value}".`,{nodes:n}))}},OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set;for(const{node:e,fragmentVariableDefinition:t}of n){const n=e.name.value;t||r.add(n)}const i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Sr,ai,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===On.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i}".`,{nodes:t}))),i&&t.name.value===kn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===d.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===L&&t.has(a.name.value)||a.kind===v&&a.operation===d.SUBSCRIPTION)&&(n.name.value===On.name?gr(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===kn.name&&(gr(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===On.name||n.name.value===kn.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;if(i.kind!==k)return void e.reportError(new GraphQLError(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===kn.name&&!(Dt(n.type)||Vt(n.type)&&Dt(n.type.ofType))&&e.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}},function(e){return{...Nr(e),FragmentArgument(t){const n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){const r=t.name.value,i=e.hideSuggestions?[]:rt(r,Array.from(n.variableDefinitions.values()).map((e=>e.variable.name.value)));e.reportError(new GraphQLError(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+He(i),{nodes:t}))}}},Argument(t){const n=e.getArgument(),r=e.getFieldDef();if(!n&&r){const n=t.name.value,i=e.hideSuggestions?[]:rt(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${r}".`+He(i),{nodes:t}))}}}},si,function(e){return{NullValue:t=>li(e,t,e.getInputType()),ListValue:t=>li(e,t,e.getParentInputType()),ObjectValue:t=>li(e,t,e.getInputType()),EnumValue:t=>li(e,t,e.getInputType()),IntValue:t=>li(e,t,e.getInputType()),FloatValue:t=>li(e,t,e.getInputType()),StringValue:t=>li(e,t,e.getInputType()),BooleanValue:t=>li(e,t,e.getInputType())}},function(e){return{...Pr(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)!r.has(i.name)&&Kt(i)&&e.reportError(new GraphQLError(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){const n=e.getFragmentSignature();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const[i,o]of n.variableDefinitions)if(!r.has(i)&&Br(o)){const n=Ge(vr(e.getSchema(),o.type));e.reportError(new GraphQLError(`Fragment "${t.name.value}" argument "${i}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,parentType:o,defaultValue:s,fragmentVariableDefinition:a}of r){const r=n.name.value;let c=a;if(c||(c=t.get(r)),c&&i){const t=e.getSchema(),a=vr(t,c.type);a&&!pi(t,a,c.defaultValue,i,s)&&e.reportError(new GraphQLError(`Variable "$${r}" of type "${a}" used in position expecting type "${i}".`,{nodes:[c,n]})),At(o)&&o.isOneOf&&jt(a)&&e.reportError(new GraphQLError(`Variable "$${r}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[c,n]}))}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new OrderedPairSet,n=new PairSet,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const s=[],[a,c]=Rr(e,t,i,o,void 0);if(function(e,t,n,r,i,o){for(const[s,a]of o.entries())if(a.length>1)for(let o=0;o0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(_t(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(ci(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=oi(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},Lr,Sr,ai,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)Er(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=Ur[s.kind]:a&&(c=function(e){if(Lt(e))return X;if(wt(e))return Z;if(Ot(e))return ee;if(kt(e))return te;if(_t(e))return ne;if(At(e))return re;n(0,"Unexpected type: "+Ge(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case X:return"scalar";case Z:return"object";case ee:return"interface";case te:return"union";case ne:return"enum";case re:return"input object";default:n(0,"Unexpected kind: "+Ge(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=[...r.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+He(rt(o,n)),{nodes:i.name}))}}},Nr,si,ui,Pr]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===L&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===N?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r,i){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===L?e:void 0;lt(e,yr(r,{VariableDefinition:()=>!1,Variable(e){let t;if(i){const o=r.getFragmentSignatureByName()(i.name.value);t=o?.variableDefinitions.get(e.name.value),n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:t})}else n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}function mi(e,t,n=fi,r){!function(e){const t=er(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const i=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),o=[],s=new TypeInfo(e),a=new ValidationContext(e,t,s,(e=>{if(o.length>=100)throw i;o.push(e)}),!1),c=pt(n.map((e=>e(a))));try{lt(t,yr(s,c))}catch(e){if(e!==i)throw e;o.push(i)}return o}function vi(e,n){t(e)&&t(e.__schema)||xe(0,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Ge(e)}.`);const r=e.__schema,i=new Map(r.types.map((e=>[e.name,f(e)])));for(const e of[...bn,...Hn])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map((function(e){if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=Ge(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Jn.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Jn.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(function(e){if(!jt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL nullable type.`);return e}(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Ge(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!wt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Ot(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){switch(e.kind){case Jn.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Jn.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>m(n)});case Jn.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>m(t)});case Jn.UNION:return function(e){if(null==e.possibleTypes){const t=Ge(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Jn.ENUM:return function(e){if(null==e.enumValues){const t=Ge(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:Xe(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Jn.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=Ge(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t,n,r;throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${Ge(e)}.`)}function h(e){if(null===e.interfaces&&e.kind===Jn.INTERFACE)return[];if(null==e.interfaces){const t=Ge(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function m(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${Ge(e)}.`);return Xe(e.fields,(e=>e.name),v)}function v(e){const t=u(e.type);if(!Ft(t)){const e=Ge(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return Xe(e,(e=>e.name),g)}function g(e){const t=u(e.type);if(!$t(t)){const e=Ge(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}return{description:e.description,type:t,default:null!=e.defaultValue?{literal:Ve(e.defaultValue)}:void 0,deprecationReason:e.deprecationReason}}}const yi={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function gi(e,t){const r=t({getNamedType:u,setNamedType:function(e){i.set(e.name,e)},getNamedTypes:function(){return Array.from(i.values())}}),i=new Map;for(const t of e.types){const e=t.name,n=l(t);n&&i.set(e,n)}const o=[];for(const t of e.directives){if(Fn(t)){o.push(t);continue}const e=m(t.toConfig());e&&o.push(new GraphQLDirective(e))}const s={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(i.values()),directives:o},a=r[yi.SCHEMA];return null==a?s:a(s);function c(e){return Dt(e)?new GraphQLList(c(e.ofType)):xt(e)?new GraphQLNonNull(c(e.ofType)):u(e.name)}function u(e){const t=Ti.get(e)??i.get(e);return void 0!==t||n(0,`Unknown type: "${e}".`),t}function l(e){return Wn(e)||Nn(e)?e:Lt(e)?function(e){let t=e.toConfig();const n=r[yi.SCALAR];return t=null==n?t:n(t),new GraphQLScalarType(t)}(e):wt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[yi.OBJECT];return n=null==i?n:i(n),new GraphQLObjectType(n)}(e):Ot(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[yi.INTERFACE];return n=null==i?n:i(n),new GraphQLInterfaceType(n)}(e):kt(e)?function(e){const t=e.toConfig();let n={...t,types:()=>t.types.map((e=>u(e.name)))};const i=r[yi.UNION];return n=null==i?n:i(n),new GraphQLUnionType(n)}(e):_t(e)?function(e){const t=e.toConfig();let n={...t,values:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.values)){const t=f(i,r,e.name);n[r]=t}return n}};const i=r[yi.ENUM];return n=null==i?n:i(n),new GraphQLEnumType(n)}(e):At(e)?function(e){const t=e.toConfig();let n={...t,fields:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.fields)){const t=h(i,r,e.name);n[r]=t}return n}};const i=r[yi.INPUT_OBJECT];return n=null==i?n:i(n),new GraphQLInputObjectType(n)}(e):void n(0,"Unexpected type: "+Ge(e))}function p(e,t){const n=Object.create(null);for(const[i,o]of Object.entries(e)){let e={...o,type:c(o.type),args:d(o.args,t,i)};const s=r[yi.FIELD];s&&(e=s(e,t)),n[i]=e}return n}function d(e,t,n){const i=Object.create(null);for(const[o,s]of Object.entries(e)){let e={...s,type:c(s.type)};const a=r[yi.ARGUMENT];a&&(e=a(e,t,n)),i[o]=e}return i}function f(e,t,n){const i={...e},o=r[yi.ENUM_VALUE];return null==o?i:o(i,t,n)}function h(e,t,n){const i={...e,type:c(e.type)},o=r[yi.INPUT_FIELD];return null==o?i:o(i,t,n)}function m(e){const t={...e,args:d(e.args,e.name,void 0)},n=r[yi.DIRECTIVE];return null==n?t:n(t)}}const Ti=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ei(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let h=!1;for(const e of t.definitions){switch(e.kind){case V:d=e;break;case W:f.push(e);break;case H:p.push(e);break;case M:case U:case J:case q:case K:case Y:i.push(e);break;case X:o.add(e.name.value,e);break;case Z:s.add(e.name.value,e);break;case ee:a.add(e.name.value,e);break;case te:c.add(e.name.value,e);break;case ne:u.add(e.name.value,e);break;case re:l.add(e.name.value,e);break;default:continue}h=!0}return h?gi(e,(e=>{const{getNamedType:t,setNamedType:h,getNamedTypes:m}=e;return{[yi.SCHEMA]:e=>{for(const e of i){const t=bi.get(e.name.value)??I(e);h(t)}const n={query:e.query&&t(e.query.name),mutation:e.mutation&&t(e.mutation.name),subscription:e.subscription&&t(e.subscription.name),...d&&v([d]),...v(f)};return{description:d?.description?.value??e.description,...n,types:m(),directives:[...e.directives,...p.map(T)],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1}},[yi.INPUT_OBJECT]:e=>{const t=l.get(e.name)??[];return{...e,fields:()=>({...e.fields(),...N(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.ENUM]:e=>{const t=u.get(e.name)??[];return{...e,values:()=>({...e.values(),...S(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.SCALAR]:e=>{const t=o.get(e.name)??[];let n=e.specifiedByURL;for(const e of t)n=Si(e)??n;return{...e,specifiedByURL:n,extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.OBJECT]:e=>{const t=s.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...L(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.INTERFACE]:e=>{const t=a.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...L(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.UNION]:e=>{const t=c.get(e.name)??[];return{...e,types:()=>[...e.types(),...w(t)],extensionASTNodes:e.extensionASTNodes.concat(t)}}};function v(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=y(n.type)}return t}function y(e){const r=e.name.value,i=t(r);return void 0!==i||n(0,`Unknown type: "${r}".`),i}function g(e){return e.kind===C?new GraphQLList(g(e.type)):e.kind===R?new GraphQLNonNull(g(e.type)):y(e)}function T(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:b(e.arguments),astNode:e})}function E(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:g(n.type),description:n.description?.value,args:b(n.arguments),deprecationReason:Ni(n),astNode:n}}return t}function b(e){const t=e??[],n=Object.create(null);for(const e of t){const t=g(e.type);n[e.name.value]={type:t,description:e.description?.value,default:e.defaultValue&&{literal:e.defaultValue},deprecationReason:Ni(e),astNode:e}}return n}function N(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=g(n.type);t[n.name.value]={type:e,description:n.description?.value,default:n.defaultValue&&{literal:n.defaultValue},deprecationReason:Ni(n),astNode:n}}}return t}function S(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:Ni(n),astNode:n}}return t}function L(e){return e.flatMap((e=>e.interfaces?.map(y)??[]))}function w(e){return e.flatMap((e=>e.types?.map(y)??[]))}function I(e){const t=e.name.value;switch(e.kind){case U:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>L(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case J:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>L(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case K:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:()=>S(r),astNode:e,extensionASTNodes:n})}case q:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>w(r),astNode:e,extensionASTNodes:n})}case M:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:Si(e),astNode:e,extensionASTNodes:n})}case Y:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>N(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(Xr(xn,n)))})}}var n}})):e}const bi=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ni(e){const t=Xr(An,e);return t?.reason}function Si(e){const t=Xr(Dn,e);return t?.url}function Li(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[Ii(e),...i.map((e=>function(e){return $i(e)+`directive ${e}`+Ai(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(Lt(e))return function(e){return $i(e)+`scalar ${e}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${ft({kind:k,value:e.specifiedByURL})})`}(e)}(e);if(wt(e))return function(e){return $i(e)+`type ${e}`+Oi(e)+ki(e)}(e);if(Ot(e))return function(e){return $i(e)+`interface ${e}`+Oi(e)+ki(e)}(e);if(kt(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return $i(e)+`union ${e.name}`+n}(e);if(_t(e))return function(e){const t=e.getValues().map(((e,t)=>$i(e," ",!t)+" "+e.name+xi(e.deprecationReason)));return $i(e)+`enum ${e}`+_i(t)}(e);if(At(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>$i(e," ",!t)+" "+Di(e)));return $i(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+_i(t)}(e);n(0,"Unexpected type: "+Ge(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!Fn(e)),wi)}function wi(e){return!Nn(e)&&!Wn(e)}function Ii(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:$i(e)+"schema {\n"+(t?` query: ${t}\n`:"")+(n?` mutation: ${n}\n`:"")+(r?` subscription: ${r}\n`:"")+"}"}function Oi(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function ki(e){return _i(Object.values(e.getFields()).map(((e,t)=>$i(e," ",!t)+" "+e.name+Ai(e.args," ")+": "+String(e.type)+xi(e.deprecationReason))))}function _i(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function Ai(e,t=""){return 0===e.length?"":e.every((e=>null==e.description))?"("+e.map(Di).join(", ")+")":"(\n"+e.map(((e,n)=>$i(e," "+t,!n)+" "+t+Di(e))).join("\n")+"\n"+t+")"}function Di(e){let t=e.name+": "+String(e.type);const n=Cn(e);return n&&(t+=` = ${ft(n)}`),t+xi(e.deprecationReason)}function xi(e){if(null==e)return"";if(e!==_n){return` @deprecated(reason: ${ft({kind:k,value:e})})`}return" @deprecated"}function $i(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+ft({kind:k,value:r,block:de(r)}).replaceAll("\n","\n"+t)+"\n"}function Fi(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:m,definitions:t}}const Gi=[Ir];function Qi(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Ci,Ri,Vi,ji,...n?[n]:[],...r?[r]:[],...fi.filter((e=>!Gi.includes(e)))]}function Ci(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function Ri(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Vi(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==On.name&&null==t.typeCondition&&e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",{nodes:t}))}}}function ji(e){return{InlineFragment(t){var n;if(t.directives)for(const r of t.directives)r.name.value!=On.name||(null===(n=r.arguments)||void 0===n?void 0:n.find((e=>"label"==e.name.value)))||e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",{nodes:t}))}}}function Mi(e){return{kind:h,value:e}}function Ui(e){return{kind:k,value:e}}function Pi(e){return{kind:H,description:e.description?Ui(e.description):void 0,name:Mi(e.name),repeatable:!1,locations:e.locations.map((e=>Mi(e))),arguments:e.args.map((e=>function(e){return{kind:B,description:Ui(e.description),name:Mi(e.name),type:Bi(Ut(e.type))}}(e)))}}function Bi(e){return{kind:Q,name:Mi(e.name)}}function Ji(e){return{kind:R,type:e}}const qi={kind:H,description:Ui("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:Mi("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[Mi("QUERY"),Mi("MUTATION"),Mi("SUBSCRIPTION"),Mi("FRAGMENT_DEFINITION")]},Ki={kind:H,description:Ui("Attach extra information to a given type."),name:Mi("typePolicy"),arguments:[{kind:B,description:Ui("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),name:Mi("keyFields"),type:Ji(Bi(gn))}],repeatable:!1,locations:[Mi("OBJECT"),Mi("INTERFACE")]},zi={kind:H,description:Ui("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),name:Mi("import"),arguments:[{kind:B,description:Ui("The name of the module to import."),name:Mi("module"),type:Ji(Bi(gn))}],repeatable:!0,locations:[Mi("QUERY"),Mi("MUTATION"),Mi("SUBSCRIPTION"),Mi("FRAGMENT_DEFINITION")]},Yi=[qi,zi,Ki];const Hi={kind:T,name:{kind:h,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Wi(e){const t=function(e,t,n=hi){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return lt(e,pt(n.map((e=>e(i))))),r}(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Xi(e){const t=er(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Zi(e){return e.startsWith("__")}function eo(e){if(!e)return!1;for(const t of e)if(t.name.value==qi.name.value)return!0;return!1}const to={kind:T,name:{kind:h,value:"__typename"}};function no(e,t){return t&&(e=function(e){return lt(e,{enter:e=>e.kind!==g?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===T||e.kind===L||e.kind===S)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Hi,...e.selectionSet.selections]}}}})}(e)),lt(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![T,L].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==to.kind&&e.name.value==to.name.value));return t?e:{...e,selections:[to,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==to.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){const t=[qi,zi];for(const n of t)if(e.name.value==n.name.value)return null;return e}(e)}})}function ro(e){return null!=e}function io(e){switch(e.kind){case w:return{kind:e.kind,value:e.name.value};case x:return{kind:e.kind,value:e.values.map(io)};case $:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=io(t.value),e)),{})};default:return e}}function oo(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function so(e,t,n,r,i){var o,s,a;const c=new Map;for(const e of t.definitions)e.kind===L&&c.set(e.name.value,e);const u=[],l=new Map,p=new Set,d=r,f=e.getQueryType();if(void 0===f)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const h={queryType:f,mutationType:null!==(o=e.getMutationType())&&void 0!==o?o:void 0,subscriptionType:null!==(s=e.getSubscriptionType())&&void 0!==s?s:void 0};for(const e of t.definitions)e.kind===v&&u.push(g(e));for(const[e,t]of c.entries())l.set(e,E(t));return{rootTypes:h,operations:u,fragments:Array.from(l.values()),referencedTypes:Array.from(p.values()),schemaDocumentation:null!==(a=e.description)&&void 0!==a?a:void 0};function m(t){if(!p.has(t)){if(p.add(t),Ot(t)){const n=e.getPossibleTypes(t);t._implementingObjects=n;for(const e of n)d&&!y(e)||m(Ut(e))}if(kt(t)){const e=t.getTypes();for(t of e)m(Ut(t))}if(At(t)&&function(e){const t=e.getFields();for(const e in t){m(Ut(t[e].type))}}(t),wt(t))for(const e of t.getInterfaces())m(Ut(e))}}function y(e){var t,n;const r=Ki.name.value;for(const i of null!==(n=null===(t=e.astNode)||void 0===t?void 0:t.directives)&&void 0!==n?n:[])if(i.name.value===r)return!0;return!1}function g(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=oo(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?io(t.defaultValue):void 0,i=vr(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return m(Ut(i)),{name:n,type:i,defaultValue:r}})),u=ft(no(t,n)),l=e.getRootType(s),[p]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(l);const d=I(t.selectionSet,l,a),f=Array.from(a.values());return eo(t.directives)&&b(f),{name:o,operationType:s,variables:c,rootType:l,selectionSet:d,directives:p,referencedFragments:f,source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=oo(t),s=ft(no(t,n)),a=new Set,c=vr(e,t.typeCondition),[u]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(Ut(c));const l=I(t.selectionSet,c,a),p=Array.from(a.values());return eo(t.directives)&&b(p),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:l,directives:u,referencedFragments:p,overrideAsLocalCacheMutation:!1}}function b(e){e.forEach((e=>{e.overrideAsLocalCacheMutation=!0,b(e.referencedFragments)}))}function I(t,n,r){return{parentType:n,selections:t.selections.map((t=>function(t,n,r){var o,s,a,u;const[p,d]=null!==(o=k(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case T:{const f=t.name.value;if("__typename"==f)return;const h=null===(s=t.alias)||void 0===s?void 0:s.value,v=function(e,t,n){return n===Kn.name&&e.getQueryType()===t?Kn:n===zn.name&&e.getQueryType()===t?zn:n===Yn.name&&(wt(t)||Ot(t)||kt(t))?Yn:wt(t)||Ot(t)?t.getFields()[n]:void 0}(e,n,f);if(!v)throw new GraphQLError(`Cannot query field "${f}" on type "${String(n)}"`,{nodes:t});const y=v.type,g=Ut(v.type);m(Ut(g));const{description:b,deprecationReason:L}=v;let w={kind:"Field",name:f,alias:h,type:y,arguments:O(v,t.arguments),inclusionConditions:d,description:!Zi(f)&&b?b:void 0,deprecationReason:L||void 0,directives:p};function _(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Dt(y)||xt(y)&&Dt(y.ofType)?_(t,null===(a=i.disallowedFieldNames)||void 0===a?void 0:a.entityList,i.schemaNamespace):Ct(g)&&_(t,null===(u=i.disallowedFieldNames)||void 0===u?void 0:u.entity,i.schemaNamespace),Ct(g)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${f}" on type "${String(n)}" requires selection set`,{nodes:t});w.selectionSet=I(A,g,r)}return w}case S:{const D=t.typeCondition,x=D?vr(e,D):n;return m(x),{kind:"InlineFragment",selectionSet:I(t.selectionSet,x,r),inclusionConditions:d,directives:p}}case N:{const $=t.name.value,F=function(e){let t=l.get(e);if(t)return t;const n=c.get(e);return n?(c.delete(e),t=E(n),l.set(e,t),t):void 0}($);if(!F)throw new GraphQLError(`Unknown fragment "${$}".`,{nodes:t.name});r.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,r))).filter(ro)}}function O(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:io(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function k(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:O(o,i.arguments)});const s=A(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function A(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case _:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case w:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function ao(e){return e.kind===H&&e.name.value===On.name}function co(){return{kind:m,definitions:[Pi(On)]}}const uo=Ki.name.value;function lo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()}function po(e){var t,n,r,i;if(kt(e))return;for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const t=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===uo));if(t)return{directive:t,source:e}}let o;for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])if(t.name.value===uo){o={directive:t,source:e};break}if("getInterfaces"in e)for(const t of e.getInterfaces()){const n=po(t);if(n)if(o){if(!lo(o.directive,n.directive))throw o.source===e?new GraphQLError(`Type "${e.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${n.source.name}".`,{nodes:e.astNode}):new GraphQLError(`Type "${e.name}" inherits conflicting @typePolicy directives from interfaces "${o.source.name}" and "${n.source.name}".`,{nodes:e.astNode})}else o=n}return o}function fo(e){var t,n,r;const i=po(e);if(!i)return[];const o=null===(r=null===(n=null===(t=i.directive)||void 0===t?void 0:t.arguments)||void 0===n?void 0:n.find((e=>"keyFields"===e.name.value)))||void 0===r?void 0:r.value;if(!o||o.kind!==k)return[];const s=o.value.split(" ");return function(e,t){const{directive:n,source:r}=e;if(kt(r))return;const i=Ot(r)?"interface":"object";var o=r.getFields();for(const e of t){if(!e)throw new GraphQLError("Key fields must be a space-separated list of identifiers.",{nodes:n});const t=o[e];if(!t)throw new GraphQLError(`Key field "${e}" does not exist on ${i} "${r.name}".`,{nodes:r.astNode?[r.astNode,n]:n});if(!xt(t.type))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be non-nullable.`,{nodes:t.astNode?[t.astNode,n]:n});if(!Lt(t.type.ofType))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be a scalar type, got ${t.type}.`,{nodes:t.astNode?[t.astNode,n]:n})}}(i,s),s}function ho(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&(n._apolloKeyFields=fo(n))}}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r,i){return so(e,t,n,r,i)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(Re(r));var r=function(e){const t=Yi.filter((t=>!e.definitions.some((e=>e.kind==H&&e.name.value==t.name.value))));return Fi([e,{kind:m,definitions:t}])}(Fi(n));if(t){var i=function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=vi(t);return n}(t.body);return r=function(e,t){const n=e.getDirective(On.name);return n?function(e,t){return e.isRepeatable===t.isRepeatable&&e.locations.slice(0).sort().toString()===t.locations.slice(0).sort().toString()&&e.args.map((e=>e.name)).sort().toString()===t.args.map((e=>e.name)).sort().toString()}(n,On)?t:(console.warn(`Unsupported ${n.name} directive found. It will be replaced with a supported definition instead.`),Fi([t,co()])):Fi([t,co()])}(i,r),ho(i=function(e,t,n){Xn(e);const r=e.toConfig(),i=Ei(r,t,n);return r===i?e:new GraphQLSchema(i)}(i,r,{assumeValid:!0})),Xi(i),i}{Wi(r=function(e){const t=e.definitions.find(ao);if(!t)return Fi([e,co()]);const n=t;if(!function(e,t){var n;return e.repeatable===t.isRepeatable&&e.locations.map((e=>e.value)).sort().toString()===t.locations.slice(0).sort().toString()&&(null===(n=e.arguments)||void 0===n?void 0:n.map((e=>e.name.value)).sort().toString())===t.args.map((e=>e.name)).sort().toString()}(n,On))return console.warn(`Unsupported ${n.name.value} directive found. It will be replaced with a supported definition instead.`),{kind:m,definitions:e.definitions.filter((e=>ao(e)?void 0:e)).concat(Pi(On))};return e}(r));const e=function(e,t){const n=Ei({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...$n.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}(r,{assumeValid:!0});return ho(e),Xi(e),e}},e.mergeDocuments=function(e){return Fi(e)},e.parseOperationDocument=function(e){return Re(e)},e.printSchemaToSDL=function(e){return Li(e)},e.validateDocument=function(e,t,n){return mi(e,t,Qi(n))},e}({});"# +let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){throw new Error(t??"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}const d={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},f={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION"},h="Name",m="Document",v="OperationDefinition",y="VariableDefinition",g="SelectionSet",T="Field",E="Argument",b="FragmentArgument",N="FragmentSpread",S="InlineFragment",w="FragmentDefinition",L="Variable",I="IntValue",O="FloatValue",k="StringValue",_="BooleanValue",A="NullValue",D="EnumValue",x="ListValue",$="ObjectValue",F="ObjectField",G="Directive",Q="NamedType",C="ListType",R="NonNullType",V="SchemaDefinition",j="OperationTypeDefinition",M="ScalarTypeDefinition",U="ObjectTypeDefinition",P="FieldDefinition",B="InputValueDefinition",J="InterfaceTypeDefinition",q="UnionTypeDefinition",K="EnumTypeDefinition",z="EnumValueDefinition",Y="InputObjectTypeDefinition",H="DirectiveDefinition",W="SchemaExtension",X="ScalarTypeExtension",Z="ObjectTypeExtension",ee="InterfaceTypeExtension",te="UnionTypeExtension",ne="EnumTypeExtension",re="InputObjectTypeExtension";var ie=Object.freeze({__proto__:null,ARGUMENT:E,BOOLEAN:_,DIRECTIVE:G,DIRECTIVE_DEFINITION:H,DOCUMENT:m,ENUM:D,ENUM_TYPE_DEFINITION:K,ENUM_TYPE_EXTENSION:ne,ENUM_VALUE_DEFINITION:z,FIELD:T,FIELD_DEFINITION:P,FLOAT:O,FRAGMENT_ARGUMENT:b,FRAGMENT_DEFINITION:w,FRAGMENT_SPREAD:N,INLINE_FRAGMENT:S,INPUT_OBJECT_TYPE_DEFINITION:Y,INPUT_OBJECT_TYPE_EXTENSION:re,INPUT_VALUE_DEFINITION:B,INT:I,INTERFACE_TYPE_DEFINITION:J,INTERFACE_TYPE_EXTENSION:ee,LIST:x,LIST_TYPE:C,NAME:h,NAMED_TYPE:Q,NON_NULL_TYPE:R,NULL:A,OBJECT:$,OBJECT_FIELD:F,OBJECT_TYPE_DEFINITION:U,OBJECT_TYPE_EXTENSION:Z,OPERATION_DEFINITION:v,OPERATION_TYPE_DEFINITION:j,SCALAR_TYPE_DEFINITION:M,SCALAR_TYPE_EXTENSION:X,SCHEMA_DEFINITION:V,SCHEMA_EXTENSION:W,SELECTION_SET:g,STRING:k,UNION_TYPE_DEFINITION:q,UNION_TYPE_EXTENSION:te,VARIABLE:L,VARIABLE_DEFINITION:y});function oe(e){return 9===e||32===e}function se(e){return e>=48&&e<=57}function ae(e){return e>=97&&e<=122||e>=65&&e<=90}function ce(e){return ae(e)||95===e}function ue(e){return ae(e)||se(e)||95===e}function le(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function pe(e){let t=0;for(;t",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};class Lexer{constructor(e){const t=new Token(fe.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==fe.EOF)do{if(e.next)e=e.next;else{const t=Ee(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===fe.COMMENT);return e}}function he(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function me(e,t){return ve(e.charCodeAt(t))&&ye(e.charCodeAt(t+1))}function ve(e){return e>=55296&&e<=56319}function ye(e){return e>=56320&&e<=57343}function ge(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return fe.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Te(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function Ee(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _e(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ae(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oFe)return"[Array]";const n=Math.min($e,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>Fe)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+Qe(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ce=null!=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Ge(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||xe(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||xe(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Re(e,t){const n=new Parser(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function Ve(e,t){const n=new Parser(e,t);n.expectToken(fe.SOF);const r=n.parseConstValueLiteral();return n.expectToken(fe.EOF),r}class Parser{constructor(e,t={}){const n=function(e){return Ce(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(fe.NAME);return this.node(e,{kind:h,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:m,definitions:this.many(fe.SOF,this.parseDefinition,fe.EOF)})}parseDefinition(){if(this.peek(fe.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===fe.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(fe.BRACE_L))return this.node(e,{kind:v,operation:d.QUERY,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(fe.NAME)&&(n=this.parseName()),this.node(e,{kind:v,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(fe.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(fe.PAREN_L,this.parseVariableDefinition,fe.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:y,variable:this.parseVariable(),type:(this.expectToken(fe.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(fe.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(fe.DOLLAR),this.node(e,{kind:L,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:g,selections:this.many(fe.BRACE_L,this.parseSelection,fe.BRACE_R)})}parseSelection(){return this.peek(fe.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(fe.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:T,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(fe.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(fe.PAREN_L,t,fe.PAREN_R)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(fe.PAREN_L,e,fe.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:E,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(fe.COLON),this.node(e,{kind:b,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(fe.SPREAD);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(fe.NAME)){const t=this.parseFragmentName();return this.peek(fe.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(e,{kind:N,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:N,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:S,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:w,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:w,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case fe.BRACKET_L:return this.parseList(e);case fe.BRACE_L:return this.parseObject(e);case fe.INT:return this.advanceLexer(),this.node(t,{kind:I,value:t.value});case fe.FLOAT:return this.advanceLexer(),this.node(t,{kind:O,value:t.value});case fe.STRING:case fe.BLOCK_STRING:return this.parseStringLiteral();case fe.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_,value:!0});case"false":return this.node(t,{kind:_,value:!1});case"null":return this.node(t,{kind:A});default:return this.node(t,{kind:D,value:t.value})}case fe.DOLLAR:if(e){if(this.expectToken(fe.DOLLAR),this._lexer.token.kind===fe.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k,value:e.value,block:e.kind===fe.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:x,values:this.any(fe.BRACKET_L,(()=>this.parseValueLiteral(e)),fe.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:$,fields:this.any(fe.BRACE_L,(()=>this.parseObjectField(e)),fe.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:F,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(fe.AT);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(fe.AT),this.node(t,{kind:G,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(fe.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(fe.BRACKET_R),t=this.node(e,{kind:C,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(fe.BANG)?this.node(e,{kind:R,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Q,name:this.parseName()})}peekDescription(){return this.peek(fe.STRING)||this.peek(fe.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);return this.node(e,{kind:V,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(fe.COLON);const n=this.parseNamedType();return this.node(e,{kind:j,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:M,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:U,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(fe.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseFieldDefinition,fe.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(fe.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:P,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(fe.PAREN_L,this.parseInputValueDef,fe.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(fe.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(fe.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:B,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:J,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:q,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(fe.EQUALS)?this.delimitedMany(fe.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:K,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(fe.BRACE_L,this.parseEnumValueDefinition,fe.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:z,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${je(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Y,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseInputValueDef,fe.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===fe.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:W,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:X,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Z,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ee,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:te,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ne,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:re,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(fe.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:H,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(fe.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${Me(e)}, found ${je(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==fe.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${je(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===fe.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${je(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==fe.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function je(e){const t=e.value;return Me(e.kind)+(null!=t?` "${t}"`:"")}function Me(e){return function(e){return e===fe.BANG||e===fe.DOLLAR||e===fe.AMP||e===fe.PAREN_L||e===fe.PAREN_R||e===fe.SPREAD||e===fe.COLON||e===fe.EQUALS||e===fe.AT||e===fe.BRACKET_L||e===fe.BRACKET_R||e===fe.BRACE_L||e===fe.PIPE||e===fe.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function Ue(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Pe(e){return Be("and",e)}function Be(e,t){switch(0!==t.length||n(),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}function Je(e){return"object"==typeof e&&"function"==typeof e?.[Symbol.iterator]}function qe(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function Ke(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function ze(e){return 0===e.length?"":` at ${e.map((e=>"number"==typeof e?`[${e}]`:`.${e}`)).join("")}`}const Ye=5;function He(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+Be("or",r.slice(0,Ye).map((e=>`"${e}"`)))+"?"}function We(e){return e}function Xe(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function Ze(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-et,o=t.charCodeAt(r)}while(nt(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const et=48,tt=57;function nt(e){return!isNaN(e)&&et<=e&&e<=tt}function rt(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:Ze(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=it(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=it(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function it(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>mt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=yt("(",mt(e.variableDefinitions,", "),")"),n=mt([e.operation,mt([e.name,t]),mt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+yt(" = ",n)+yt(" ",mt(r," "))},SelectionSet:{leave:({selections:e})=>vt(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=mt([yt("",e,": "),t],"");return mt([Et(o,n),yt(" ",mt(r," ")),yt(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Et("..."+e,t)+yt(" ",mt(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>mt(["...",yt("on ",e),mt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${yt("(",mt(n,", "),")")} on ${t} ${yt("",mt(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||oe(e.charCodeAt(0)))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const p=r&&oe(e.charCodeAt(0));return(u&&!p||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(st,at)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+mt(e,", ")+"]";return t.length>80?"[\n"+gt(mt(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+mt(e,", ")+" }";return t.length>80?vt(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+yt("(",mt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>yt("",e,"\n")+mt(["schema",mt(t," "),vt(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt(["scalar",t,mt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["type",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>yt("",e,"\n")+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+": "+r+yt(" ",mt(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>yt("",e,"\n")+mt([t+": "+n,yt("= ",r),mt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["interface",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>yt("",e,"\n")+mt(["union",t,mt(n," "),yt("= ",mt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>yt("",e,"\n")+mt(["enum",t,mt(n," "),vt(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt([t,mt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>yt("",e,"\n")+mt(["input",t,mt(n," "),vt(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>yt("",e,"\n")+"directive @"+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+(r?" repeatable":"")+" on "+mt(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>mt(["extend schema",mt(e," "),vt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>mt(["extend scalar",e,mt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend type",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend interface",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>mt(["extend union",e,mt(t," "),yt("= ",mt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>mt(["extend enum",e,mt(t," "),vt(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>mt(["extend input",e,mt(t," "),vt(n)]," ")}};function mt(e,t=""){return e?.filter((e=>e)).join(t)??""}function vt(e){return yt("{\n",gt(mt(e,"\n")),"\n}")}function yt(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function gt(e){return yt(" ",e.replaceAll("\n","\n "))}function Tt(e){return e?.some((e=>e.includes("\n")))??!1}function Et(e,t){let n=e+yt("(",mt(t,", "),")");return n.length>80&&(n=e+yt("(\n",gt(mt(t,"\n")),"\n)")),n}function bt(e,t){switch(e.kind){case A:return null;case I:return parseInt(e.value,10);case O:return parseFloat(e.value);case k:case D:case _:return e.value;case x:return e.values.map((e=>bt(e,t)));case $:return Xe(e.fields,(e=>e.name.value),(e=>bt(e.value,t)));case L:return t?.[e.name.value]}}function Nt(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(bt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||xe(0,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&("function"==typeof e.coerceInputValue&&"function"==typeof e.coerceInputLiteral||xe(0,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Jt(e){return Pt(e??[])}function qt(e,t){return Ke(Bt(t),((t,n)=>new GraphQLField(e,n,t)))}class GraphQLField{constructor(e,t,n){this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type;const r=n.args;this.args=r?Object.entries(r).map((([e,t])=>new GraphQLArgument(this,e,t))):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}}class GraphQLArgument{constructor(e,t,n){this.parent=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function Kt(e){return xt(e.type)&&void 0===e.default&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=zt.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function zt(e){return Pt(e)}class GraphQLEnumType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values="function"==typeof e.values?e.values:Object.entries(e.values).map((([e,t])=>new GraphQLEnumValue(this,e,t))),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Object.entries(this._values()).map((([e,t])=>new GraphQLEnumValue(this,e,t)))),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=qe(this.getValues(),(e=>e.name))),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map((e=>[e.value,e]))));const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Ge(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if("string"!=typeof e){const n=Ge(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?"":Yt(this,n)))}const n=this.getValue(e);if(null==n)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==D){const n=ft(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?"":Yt(this,n)),{nodes:e})}const n=this.getValue(e.value);if(null==n){const n=ft(e);throw new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if("string"==typeof e&&this.getValue(e))return{kind:D,value:e}}toConfig(){return{name:this.name,description:this.description,values:Xe(this.getValues(),(e=>e.name),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Yt(e,t){return He("the enum value",rt(t,e.getValues().map((e=>e.name))))}class GraphQLEnumValue{constructor(e,t,n){this.parentEnum=e,this.name=function(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError(`Enum values cannot be named: ${e}`);return Nt(e)}(t),this.description=n.description,this.value=void 0!==n.value?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class GraphQLInputObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=Ht.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:Ke(this.getFields(),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Ht(e,t){return Ke(Bt(t),((t,n)=>new GraphQLInputField(e,n,t)))}class GraphQLInputField{constructor(e,t,n){!("resolve"in n)||xe(0,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function Wt(e){return xt(e.type)&&void 0===e.defaultValue&&void 0===e.default}function Xt(e,t){return e===t||(xt(e)&&xt(t)||!(!Dt(e)||!Dt(t)))&&Xt(e.ofType,t.ofType)}function Zt(e,t,n){return t===n||(xt(n)?!!xt(t)&&Zt(e,t.ofType,n.ofType):xt(t)?Zt(e,t.ofType,n):Dt(n)?!!Dt(t)&&Zt(e,t.ofType,n.ofType):!Dt(t)&&(Rt(n)&&(Ot(t)||Lt(t))&&e.isSubType(n,t)))}function en(e,t,n){return t===n||(Rt(t)?Rt(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!Rt(n)&&e.isSubType(n,t))}function tn(e,t,n){return{prev:e,key:t,typename:n}}function nn(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function rn(e,n){if(xt(n)){if(null==e)return;return rn(e,n.ofType)}if(null==e)return{kind:A};if(Dt(n)){if(!Je(e))return rn(e,n.ofType);const t=[];for(const r of e){const e=rn(r,n.ofType);if(!e)return;t.push(e)}return{kind:x,values:t}}if(At(n)){if(!t(e))return;const r=[],i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(n.getFields())){if(void 0===e[t.name]){if(Wt(t))return}else{const n=rn(e[t.name],t.type);if(!n)return;r.push({kind:F,name:{kind:h,value:t.name},value:n})}}return{kind:$,fields:r}}const r=Qt(n);if(r.valueToLiteral)try{return r.valueToLiteral(e)}catch(e){return}return on(e)}function on(e){if(null==e)return{kind:A};switch(typeof e){case"boolean":return{kind:_,value:e};case"string":return{kind:k,value:e,block:!1};case"number":{if(!Number.isFinite(e))return{kind:A};const t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:O,value:t}}case"object":{if(Je(e))return{kind:x,values:Array.from(e,on)};const t=e,n=[];for(const e of Object.keys(t)){const r=t[e];void 0!==r&&n.push({kind:F,name:{kind:h,value:e},value:on(r)})}return{kind:$,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${Ge(e)}.`)}function sn(e,t,n){switch(e.kind){case L:{const r=e.name.value,i=n?.sources[r];if(i){const e=i.value;if(void 0===e){const e=i.signature.default;return void 0!==e?e.literal:{kind:A}}return sn(e,t,i.fragmentVariableValues)}const o=t?.sources[r];if(null==o)return{kind:A};if(void 0===o.value){const e=o.signature.default;if(void 0!==e)return e.literal}return rn(o.value,o.signature.type)}case $:{const r=[];for(const i of e.fields){if(i.value.kind===L){const e=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(void 0===e?.value&&void 0===e?.signature.default)continue}const e=sn(i.value,t,n);r.push({...i,value:e})}return{...e,fields:r}}case x:{const r=[];for(const i of e.values){const e=sn(i,t,n);r.push(e)}return{...e,values:r}}default:return e}}function an(e,t,n,r){return cn(e,t,n,r,void 0)}function cn(e,n,r,i,o){if(xt(n))return void 0===e?void un(r,`Expected a value of non-null type "${n}" to be provided.`,o):null===e?void un(r,`Expected value of non-null type "${n}" not to be null.`,o):cn(e,n.ofType,r,i,o);if(null!=e)if(Dt(n))if(Je(e)){let t=0;for(const s of e)cn(s,n.ofType,r,i,tn(o,t++,void 0))}else cn(e,n.ofType,r,i,o);else if(At(n)){if(!t(e)||Array.isArray(e))return void un(r,`Expected value of type "${n}" to be an object, found: ${Ge(e)}.`,o);const s=n.getFields();for(const t of Object.values(s)){const s=e[t.name];void 0===s?Wt(t)&&un(r,`Expected value of type "${n}" to include required field "${t.name}", found: ${Ge(e)}.`,o):cn(s,t.type,r,i,tn(o,t.name,n.name))}const a=Object.keys(e);for(const t of a)if(!Object.hasOwn(s,t)){const i=He(rt(t,Object.keys(s)));un(r,`Expected value of type "${n}" not to include unknown field "${t}"${i?`.${i} Found`:", found"}: ${Ge(e)}.`,o)}if(n.isOneOf){1!==a.length&&un(r,`Exactly one key must be specified for OneOf type "${n}".`,o);const t=a[0];null===e[t]&&un(r,`Field "${t}" for OneOf type "${n}" must be non-null.`,o)}}else{let t,s;Qt(n);try{t=n.coerceInputValue(e,i)}catch(e){if(e instanceof GraphQLError)return void r(e,nn(o));s=e}void 0===t&&un(r,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${Ge(e)}.`,o,s)}}function un(e,t,n,r){e(new GraphQLError(t,{originalError:r}),nn(n))}function ln(e,t,n,r,i,o){return pn({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function pn(e,t,n,r,i){if(t.kind!==L){if(xt(n))return t.kind===A?void fn(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i):pn(e,t,n.ofType,r,i);if(t.kind!==A)if(Dt(n))if(t.kind!==x)pn(e,t,n.ofType,r,i);else{let o=0;for(const s of t.values)pn(e,s,n.ofType,r,tn(i,o++,void 0))}else if(At(n)){if(t.kind!==$)return void fn(e.onError,`Expected value of type "${n}" to be an object, found: ${ft(t)}.`,t,i);const o=n.getFields(),s=qe(t.fields,(e=>e.name.value));for(const a of Object.values(o)){const o=s[a.name];if(void 0===o)Wt(a)&&fn(e.onError,`Expected value of type "${n}" to include required field "${a.name}", found: ${ft(t)}.`,t,i);else{const s=o.value;if(s.kind===L&&!e.static){const r=dn(e,s),o=s.name.value,c=r?.coerced[o];if(n.isOneOf)void 0===c?fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):null===c&&fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(void 0===c&&!Wt(a))continue}pn(e,s,a.type,r,tn(i,a.name,n.name))}}const a=t.fields;for(const s of a){const a=s.name.value;if(!Object.hasOwn(o,a)){const c=r?"":He(rt(a,Object.keys(o)));fn(e.onError,`Expected value of type "${n}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ft(t)}.`,s,i)}}if(n.isOneOf){if(1!==a.length)return void fn(e.onError,`OneOf Input Object "${n}" must specify exactly one key.`,t,i);if(a[0].value.kind===A){const r=a[0].name.value;fn(e.onError,`Field "${n}.${r}" used for OneOf Input Object must be non-null.`,t,tn(i,r,void 0))}}}else{let o,s;Qt(n);try{o=n.coerceInputLiteral?n.coerceInputLiteral(sn(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(t){if(t instanceof GraphQLError)return void e.onError(t,nn(i));s=t}void 0===o&&fn(e.onError,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${ft(t)}.`,t,i,s)}}else{if(e.static)return;const r=dn(e,t),o=r?.coerced[t.name.value];xt(n)&&(void 0===o?fn(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):null===o&&fn(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i))}}function dn(e,t){const n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function fn(e,t,n,r,i){e(new GraphQLError(t,{nodes:n,originalError:i}),nn(r))}const hn=2147483647,mn=-2147483648,vn=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Ge(t)}`);if(n>hn||nhn||ehn||t=mn)return{kind:I,value:String(e)}}}),yn=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(t)}`);return n},coerceInputValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==O&&e.kind!==I)throw new GraphQLError(`Float cannot represent non numeric value: ${ft(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){const t=on(e);if(t.kind===O||t.kind===I)return t}}),gn=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError(`String cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"!=typeof e)throw new GraphQLError(`String cannot represent a non string value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==k)throw new GraphQLError(`String cannot represent a non string value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===k)return t}}),Tn=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(t)}`)},coerceInputValue(e){if("boolean"!=typeof e)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===_)return t}}),En=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputLiteral(e){if(e.kind!==k&&e.kind!==I)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+ft(e),{nodes:e});return e.value},valueToLiteral(e){const t=Number.isInteger(e)?String(e):e;if("string"==typeof t)return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:k,value:t,block:!1}}}),bn=Object.freeze([gn,vn,yn,Tn,En]);function Nn(e){return bn.some((({name:t})=>e.name===t))}function Sn(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function wn(e){return Ce(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Nt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=ot(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||xe(0,`@${this.name} locations must be an Array.`);const n=e.args??{};t(n)&&!Array.isArray(n)||xe(0,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(n).map((([e,t])=>new GraphQLArgument(this,e,t)))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Ln=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Included when true."}}}),In=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Skipped when true."}}}),On=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),kn=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{initialCount:{default:{value:0},type:new GraphQLNonNull(vn),description:"Number of items to return immediately"},if:{type:new GraphQLNonNull(Tn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),_n="No longer supported",An=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:new GraphQLNonNull(gn),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:_n}}}}),Dn=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(gn),description:"The URL that specifies the behavior of this scalar."}}}),xn=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[f.INPUT_OBJECT],args:{}});new GraphQLDirective({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[f.QUERY,f.MUTATION,f.SUBSCRIPTION]});const $n=Object.freeze([Ln,In,An,Dn,xn]);function Fn(e){return $n.some((({name:t})=>t===e.name))}function Gn(e,r){if(xt(r)){const t=Gn(e,r.ofType);return t?.kind===A?null:t}if(null===e)return{kind:A};if(void 0===e)return null;if(Dt(r)){const t=r.ofType;if(Je(e)){const n=[];for(const r of e){const e=Gn(r,t);null!=e&&n.push(e)}return{kind:x,values:n}}return Gn(e,t)}if(At(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=Gn(e[t.name],t.type);r&&n.push({kind:F,name:{kind:h,value:t.name},value:r})}return{kind:$,fields:n}}if(Gt(r)){const t=r.coerceOutputValue(e);if(null==t)return null;if("boolean"==typeof t)return{kind:_,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return Qn.test(e)?{kind:I,value:e}:{kind:O,value:e}}if("string"==typeof t)return _t(r)?{kind:D,value:t}:r===En&&Qn.test(t)?{kind:I,value:t}:{kind:k,value:t};throw new TypeError(`Cannot convert value to AST: ${Ge(t)}.`)}n(0,"Unexpected input type: "+Ge(r))}const Qn=/^-?(?:0|[1-9][0-9]*)$/;function Cn(e){const t=e.type,r=e.default;if(r){const e=r.literal??rn(r.value,t);return null!=e||n(0,"Invalid default value"),e}const i=e.defaultValue;if(void 0!==i){const e=Gn(i,t);return null!=e||n(0,"Invalid default value"),e}}const Rn=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:gn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Mn))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Mn),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Mn,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Mn,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Vn))),resolve:e=>e.getDirectives()}})}),Vn=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(Tn),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(jn))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),jn=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:f.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Mn=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(qn),resolve:e=>wt(e)?Jn.SCALAR:Lt(e)?Jn.OBJECT:Ot(e)?Jn.INTERFACE:kt(e)?Jn.UNION:_t(e)?Jn.ENUM:At(e)?Jn.INPUT_OBJECT:Dt(e)?Jn.LIST:xt(e)?Jn.NON_NULL:void n(0,`Unexpected type: "${Ge(e)}".`)},name:{type:gn,resolve:e=>"name"in e?e.name:void 0},description:{type:gn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:gn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Un)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Lt(e)||Ot(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e){if(Lt(e)||Ot(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e,t,n,{schema:r}){if(Rt(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Bn)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(_t(e)){const n=e.getValues();return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(Pn)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(At(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Mn,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:Tn,resolve:e=>{if(At(e))return e.isOneOf}}})}),Un=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Pn=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},defaultValue:{type:gn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const t=Cn(e);return t?ft(t):null}},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Bn=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Jn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},qn=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Jn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Jn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Jn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Jn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Jn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Jn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Jn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Jn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Kn=new GraphQLField(void 0,"__schema",{type:new GraphQLNonNull(Rn),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),zn=new GraphQLField(void 0,"__type",{type:Mn,description:"Request the type information of a single type.",args:{name:{type:new GraphQLNonNull(gn)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),Yn=new GraphQLField(void 0,"__typename",{type:new GraphQLNonNull(gn),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Hn=Object.freeze([Rn,Vn,jn,Mn,Un,Pn,Bn,qn]);function Wn(e){return Hn.some((({name:t})=>e.name===t))}function Xn(e){if(!function(e){return Ce(e,GraphQLSchema)}(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.assumeValid=e.assumeValid??!1,this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??$n;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Zn(n,t);null!=this._queryType&&Zn(this._queryType,t),null!=this._mutationType&&Zn(this._mutationType,t),null!=this._subscriptionType&&Zn(this._subscriptionType,t);for(const e of this._directives)if(wn(e))for(const n of e.args)Zn(n.type,t);Zn(Rn,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Ot(e)){for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(Lt(e))for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return kt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(kt(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Kn.name:return this.getQueryType()===e?Kn:void 0;case zn.name:return this.getQueryType()===e?zn:void 0;case Yn.name:return Yn}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Zn(e,t){const n=Ut(e);if(!t.has(n))if(t.add(n),kt(n))for(const e of n.getTypes())Zn(e,t);else if(Lt(n)||Ot(n)){for(const e of n.getInterfaces())Zn(e,t);for(const e of Object.values(n.getFields())){Zn(e.type,t);for(const n of e.args)Zn(n.type,t)}}else if(At(n))for(const e of Object.values(n.getFields()))Zn(e.type,t);return t}function er(e){if(Xn(e),e.__validationErrors)return e.__validationErrors;const n=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(Lt(i))n.add(i,r);else{const n=Ue(r),o=Ge(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,tr(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=Pe(i);e.reportError(`All root types must be different, "${r}" type is used as ${n} root types.`,i.map((e=>tr(t,e))))}}(n),function(e){for(const t of e.schema.getDirectives())if(wn(t)){ir(e,t),0===t.locations.length&&e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}else e.reportError(`Expected directive but got: ${Ge(t)}.`,t?.astNode)}(n),function(e){const n=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(xt(t.type)&&At(t.type.ofType)){const s=t.type.ofType,a=r[s.name];if(n.push({fieldStr:`${o}.${t.name}`,astNode:t.astNode}),void 0===a)i(s);else{const t=n.slice(a),r=t.map((e=>e.fieldStr)).join(", ");e.reportError(`Invalid circular reference. The Input Object ${s} references itself ${t.length>1?"via the non-null fields:":"in the non-null field"} ${r}.`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),r=function(e){const n=Object.create(null),r=[],i=Object.create(null);return function(e){return o(e,Object.create(null))};function o(e,n){if(Je(n))for(const t of n)o(e,t);else if(t(n))for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?o(r,n[t.name]):a(t,r,`${e}.${t.name}`))}}function s(e,t){if(t.kind===x){for(const n of t.values)s(e,n);return}if(t.kind!==$)return;const n=qe(t.fields,(e=>e.name.value));for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?s(r,n[t.name].value):a(t,r,`${e}.${t.name}`))}}function a(t,a,c){const u=t.default;if(void 0===u)return;const l=i[c];void 0===l?void 0===n[c]&&(n[c]=!0,i[c]=r.push([c,t.astNode?.defaultValue]),u.literal?s(a,u.literal):o(a,u.value),r.pop(),i[c]=void 0):e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${le)).join(", ")}`:""}.`,r.slice(l-1).map((([,e])=>e)))}}(e),i=e.schema.getTypeMap();for(const t of Object.values(i))Mt(t)?(Wn(t)||ir(e,t),Lt(t)||Ot(t)?(or(e,t),sr(e,t)):kt(t)?ur(e,t):_t(t)?lr(e,t):At(t)&&(pr(e,t),n(t),r(t))):e.reportError(`Expected GraphQL named type but got: ${Ge(t)}.`,t.astNode)}(n);const r=n.getErrors();return e.__validationErrors=r,r}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function tr(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function nr(e,t){const n=t.default;if(n)if(n.literal)ln(n.literal,t.type,((n,r)=>{e.reportError(`${t} has invalid default value${ze(r)}: ${n.message}`,n.nodes)}));else{const r=[];if(an(n.value,t.type,((e,t)=>{r.push([e,t])})),r.length>0)try{const r=rr(n.value,t.type),i=[];if(an(r,t.type,((e,t)=>{i.push([e,t])})),0===i.length)return void e.reportError(`${t} has invalid default value: ${Ge(n.value)}. Did you mean: ${Ge(r)}?`,t.astNode?.defaultValue)}catch(e){}for(const[n,i]of r)e.reportError(`${t} has invalid default value${ze(i)}: ${n.message}`,t.astNode?.defaultValue)}}function rr(e,r){if(xt(r))return rr(e,r.ofType);if(null===e)return null;if(Dt(r))return Je(e)?Array.from(e,(e=>rr(e,r.ofType))):[rr(e,r.ofType)];if(At(r)){t(e)||n();const i=r.getFields();return Ke(e,((e,t)=>(t in i||n(),rr(e,i[t].type))))}return Qt(r),r.coerceOutputValue(e)}function ir(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function or(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const t of n){ir(e,t),Ft(t.type)||e.reportError(`The type of ${t} must be Output Type but got: ${Ge(t.type)}.`,t.astNode?.type);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode?.type),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}}function sr(e,t){const n=new Set;for(const r of t.getInterfaces())Ot(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t} can only implement ${r} once.`,fr(t,r)):(n.add(r.name),cr(e,t,r),ar(e,t,r)):e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,fr(t,r)):e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${Ge(r)}.`,fr(t,r))}function ar(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=r[i.name];if(null!=o){Zt(e.schema,o.type,i.type)||e.reportError(`Interface field ${i} expects type ${i.type} but ${o} is type ${o.type}.`,[i.astNode?.type,o.astNode?.type]);for(const t of i.args){const n=o.args.find((e=>e.name===t.name));n?Xt(t.type,n.type)||e.reportError(`Interface field argument ${t} expects type ${t.type} but ${n} is type ${n.type}.`,[t.astNode?.type,n.astNode?.type]):e.reportError(`Interface field argument ${t} expected but ${o} does not provide it.`,[t.astNode,o.astNode])}for(const t of o.args)if(Kt(t)){i.args.find((e=>e.name===t.name))||e.reportError(`Argument "${t}" must not be required type "${t.type}" if not provided by the Interface field "${i}".`,[t.astNode,i.astNode])}null!=o.deprecationReason&&null==i.deprecationReason&&e.reportError(`Interface field ${n.name}.${i.name} is not deprecated, so implementation field ${t.name}.${o.name} must not be deprecated.`,[mr(o.astNode),o.astNode?.type])}else e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function cr(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...fr(n,i),...fr(t,n)])}function ur(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t} can only include type ${i} once.`,hr(t,i.name)):(r.add(i.name),Lt(i)||e.reportError(`Union type ${t} can only include Object types, it cannot include ${Ge(i)}.`,hr(t,String(i))))}function lr(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)ir(e,t)}function pr(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)ir(e,r),$t(r.type)||e.reportError(`The type of ${r} must be Input Type but got: ${Ge(r.type)}.`,r.astNode?.type),Wt(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${r} cannot be deprecated.`,[mr(r.astNode),r.astNode?.type]),nr(e,r),t.isOneOf&&dr(t,r,e)}function dr(e,t,n){xt(t.type)&&n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type),void 0===t.default&&void 0===t.defaultValue||n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function fr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function hr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function mr(e){return e?.directives?.find((e=>e.name.value===An.name))}function vr(e,t){switch(t.kind){case C:{const n=vr(e,t.type);return n&&new GraphQLList(n)}case R:{const n=vr(e,t.type);return n&&new GraphQLNonNull(n)}case Q:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t&&($t(t)&&this._inputTypeStack.push(t),Ct(t)&&this._parentTypeStack.push(t),Ft(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case m:{const t=function(e){const t=new Map;for(const n of e.definitions)if(n.kind===w){const e=new Map;if(n.variableDefinitions)for(const t of n.variableDefinitions)e.set(t.variable.name.value,t);const r={definition:n,variableDefinitions:e};t.set(n.name.value,r)}return t}(e);this._fragmentSignaturesByName=e=>t.get(e);break}case g:{const e=Ut(this.getType());this._parentTypeStack.push(Ct(e)?e:void 0);break}case T:{const n=this.getParentType();let r,i;n&&(r=t.getField(n,e.name.value),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Ft(i)?i:void 0);break}case G:this._directive=t.getDirective(e.name.value);break;case v:{const n=t.getRootType(e.operation);this._typeStack.push(Lt(n)?n:void 0);break}case N:this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break;case S:case w:{const n=e.typeCondition,r=n?vr(t,n):Ut(this.getType());this._typeStack.push(Ft(r)?r:void 0);break}case y:{const n=vr(t,e.type);this._inputTypeStack.push($t(n)?n:void 0);break}case E:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?.default??t?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case b:{const t=this.getFragmentSignature(),n=t?.variableDefinitions.get(e.name.value);let r;this._fragmentArgument=n,n&&(r=vr(this._schema,n.type)),this._inputTypeStack.push($t(r)?r:void 0);break}case x:{const e=function(e){if(e)return xt(e)?e.ofType:e}(this.getInputType()),t=Dt(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push($t(t)?t:void 0);break}case F:{const t=Ut(this.getInputType());let n,r;At(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?.default??r?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case D:{const t=Ut(this.getInputType());let n;_t(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case m:this._fragmentSignaturesByName=()=>null;break;case g:this._parentTypeStack.pop();break;case T:this._fieldDefStack.pop(),this._typeStack.pop();break;case G:this._directive=null;break;case N:this._fragmentSignature=null;break;case v:case S:case w:this._typeStack.pop();break;case y:this._inputTypeStack.pop();break;case E:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case b:this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case x:case F:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case D:this._enumValue=null}}}function yr(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=dt(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=dt(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function gr(e){const t=e.arguments?.find((e=>"if"===e.name.value));if(!t)return!1;if(t.value.kind===_){if(t.value.value)return!1}else if(t.value.kind!==L)return!1;return!0}function Tr(e){return e.kind===v||e.kind===w}function Er(e){return e.kind===M||e.kind===U||e.kind===J||e.kind===q||e.kind===K||e.kind===Y}function br(e){return e.kind===X||e.kind===Z||e.kind===ee||e.kind===te||e.kind===ne||e.kind===re}function Nr(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,e.args.map((e=>e.name)));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,n.map((e=>e.name.value)))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=rt(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+(e.hideSuggestions?"":He(o)),{nodes:t}))}}return!1}}}function Sr(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():$n;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===H&&t.set(e.name.value,e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(),t.kind){case v:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case T:return f.FIELD;case N:return f.FRAGMENT_SPREAD;case S:return f.INLINE_FRAGMENT;case w:return f.FRAGMENT_DEFINITION;case y:{const t=e[e.length-3];return"kind"in t||n(),t.kind===v?f.VARIABLE_DEFINITION:f.FRAGMENT_VARIABLE_DEFINITION}case V:case W:return f.SCHEMA;case M:case X:return f.SCALAR;case U:case Z:return f.OBJECT;case P:return f.FIELD_DEFINITION;case J:case ee:return f.INTERFACE;case q:case te:return f.UNION;case K:case ne:return f.ENUM;case z:return f.ENUM_VALUE;case Y:case re:return f.INPUT_OBJECT;case B:{const t=e.at(-3);return null!=t&&"kind"in t||n(),t.kind===Y?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(0,"Unexpected kind: "+Ge(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function wr(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Er).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===V||Er(e)||e.kind===H}(c)||function(e){return e.kind===W||br(e)}(c)));if(o&&Lr.has(a))return;const u=e.hideSuggestions?[]:rt(a,o?[...Lr,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+He(u),{nodes:t}))}var c}}}const Lr=new Set([...bn,...Hn].map((e=>e.name)));function Ir(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Or(e){switch(e.kind){case $:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:Or(e.value)}))).sort(((e,t)=>Ze(e.name.value,t.name.value))))};case x:return{...e,values:e.values.map(Or)};case I:case O:case k:case _:case A:case D:case L:return e}var t}function kr(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+kr(t))).join(" and "):e}function _r(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);const c=e.getFragment(a.node.name.value);if(!c)return;const[u,l]=Vr(e,n,c,a.varMap);if(s!==u){Dr(e,t,n,r,i,o,s,void 0,u,a.varMap);for(const a of l)_r(e,t,n,r,i,o,s,a)}}function Ar(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value&&!$r(s.node.arguments,s.varMap,a.node.arguments,a.varMap))return void e.reportError(new GraphQLError(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);const c=e.getFragment(s.node.name.value),u=e.getFragment(a.node.name.value);if(!c||!u)return;const[l,p]=Vr(e,n,c,s.varMap),[d,f]=Vr(e,n,u,a.varMap);Dr(e,t,n,r,i,o,l,s.varMap,d,a.varMap);for(const a of f)Ar(e,t,n,r,i,o,s,a);for(const s of p)Ar(e,t,n,r,i,o,s,a)}function Dr(e,t,n,r,i,o,s,a,c,u){for(const[l,p]of s.entries()){const s=c.get(l);if(null!=s)for(const c of p)for(const p of s){const s=xr(e,n,r,i,o,l,c,a,p,u);s&&t.push(s)}}}function xr(e,t,n,r,i,o,s,a,c,u){const[l,p,d]=s,[f,h,m]=c,v=i||l!==f&&Lt(l)&&Lt(f);if(!v){const e=p.name.value,t=h.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[p],[h]];if(!$r(p.arguments,a,h.arguments,u))return[[o,"they have differing arguments"],[p],[h]]}const y=function(e,t,n,r){const i=Qr(e),o=Qr(n);if(!i&&!o)return;if(i&&o)return $r(i.arguments,t,o.arguments,r)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives";return"they have overlapping stream directives"}(p.directives??[],a,h.directives??[],u);if(void 0!==y)return[[o,y],[p],[h]];const g=d?.type,T=m?.type;if(g&&T&&Cr(g,T))return[[o,`they return conflicting types "${Ge(g)}" and "${Ge(T)}"`],[p],[h]];const E=p.selectionSet,b=h.selectionSet;if(E&&b){const i=function(e,t,n,r,i,o,s,a,c,u,l){const p=[],[d,f]=Rr(e,t,o,s,a),[h,m]=Rr(e,t,c,u,l);Dr(e,p,t,n,r,i,d,a,h,l);for(const o of m)_r(e,p,t,n,r,i,d,o);for(const o of f)_r(e,p,t,n,r,i,h,o);for(const o of f)for(const s of m)Ar(e,p,t,n,r,i,o,s);return p}(e,t,n,r,v,Ut(g),E,a,Ut(T),b,u);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(i,o,p,h)}}function $r(e,t,n,r){if(void 0===e||0===e.length)return void 0===n||0===n.length;if(void 0===n||0===n.length)return!1;if(e.length!==n.length)return!1;const i=new Map(n.map((({name:e,value:t})=>[e.value,void 0===r?t:Fr(t,r)])));return e.every((e=>{let n=e.value;t&&(n=Fr(n,t));const r=i.get(e.name.value);return void 0!==r&&Gr(n)===Gr(r)}))}function Fr(e,t){switch(e.kind){case L:return t.get(e.name.value)??e;case x:return{...e,values:e.values.map((e=>Fr(e,t)))};case $:return{...e,fields:e.fields.map((e=>({...e,value:Fr(e.value,t)})))};default:return e}}function Gr(e){return ft(Or(e))}function Qr(e){return e.find((e=>"stream"===e.name.value))}function Cr(e,t){return Dt(e)?!Dt(t)||Cr(e.ofType,t.ofType):!!Dt(t)||(xt(e)?!xt(t)||Cr(e.ofType,t.ofType):!!xt(t)||!(!Gt(e)&&!Gt(t))&&e!==t)}function Rr(e,t,n,r,i){const o=t.get(r);if(o)return o;const s=new Map,a=new Map;jr(e,n,r,s,a,i);const c=[s,Array.from(a.values())];return t.set(r,c),c}function Vr(e,t,n,r){const i=t.get(n.selectionSet);if(i)return i;const o=vr(e.getSchema(),n.typeCondition);return Rr(e,t,o,n.selectionSet,r)}function jr(e,t,n,r,i,o){for(const s of n.selections)switch(s.kind){case T:{const e=s.name.value;let n;(Lt(t)||Ot(t))&&(n=t.getFields()[e]);const i=s.alias?s.alias.value:e;let o=r.get(i);null==o&&(o=[],r.set(i,o)),o.push([t,s,n]);break}case N:{const t=Mr(e,s,o);i.set(t.key,t);break}case S:{const n=s.typeCondition,a=n?vr(e.getSchema(),n):t;jr(e,a,s.selectionSet,r,i,o);break}}}function Mr(e,t,n){let r="";const i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(const e of t.arguments)s.set(e.name.value,e.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(const[e,t]of o.variableDefinitions){const o=s.get(e);o&&(r+=e+": "+ft(Or(o)));const a=s.get(e);void 0!==a?i.set(e,void 0!==n?Fr(a,n):a):t.defaultValue&&i.set(e,t.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){const r=this._data.get(e)?.get(t);return void 0!==r&&(!!n||n===r)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e[e.name,e]))));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(Br).map((e=>[e.name.value,e]))))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of i.entries())if(!o.has(t)){const i=St(s.type)?Ge(s.type):ft(s.type);e.reportError(new GraphQLError(`Argument "@${r}(${t}:)" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Br(e){return e.type.kind===R&&null==e.defaultValue}function Jr(e,n){if(xt(n)){if(null==e)return;return Jr(e,n.ofType)}if(null==e)return null;if(Dt(n)){if(!Je(e)){const t=Jr(e,n.ofType);if(void 0===t)return;return[t]}const t=[];for(const r of e){const e=Jr(r,n.ofType);if(void 0===e)return;t.push(e)}return t}if(At(n)){if(!t(e)||Array.isArray(e))return;const r={},i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(i)){const n=e[t.name];if(void 0===n){if(Wt(t))return;const e=zr(t);void 0!==e&&(r[t.name]=e)}else{const e=Jr(n,t.type);if(void 0===e)return;r[t.name]=e}}if(n.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}const r=Qt(n);try{return r.coerceInputValue(e)}catch(e){}}function qr(e,t,n,r){if(e.kind===L){const i=Kr(e,n,r);if(null==i&&xt(t))return;return i}if(xt(t)){if(e.kind===A)return;return qr(e,t.ofType,n,r)}if(e.kind===A)return null;if(Dt(t)){if(e.kind!==x){const i=qr(e,t.ofType,n,r);if(void 0===i)return;return[i]}const i=[];for(const o of e.values){let e=qr(o,t.ofType,n,r);if(void 0===e){if(o.kind!==L||null!=Kr(o,n,r)||xt(t.ofType))return;e=null}i.push(e)}return i}if(At(t)){if(e.kind!==$)return;const i={},o=t.getFields();if(e.fields.some((e=>!Object.hasOwn(o,e.name.value))))return;const s=new Map(e.fields.map((e=>[e.name.value,e])));for(const e of Object.values(o)){const t=s.get(e.name);if(!t||t.value.kind===L&&null==Kr(t.value,n,r)){if(Wt(e))return;const t=zr(e);void 0!==t&&(i[e.name]=t)}else{const o=qr(t.value,e.type,n,r);if(void 0===o)return;i[e.name]=o}}if(t.isOneOf){const e=Object.keys(i);if(1!==e.length)return;if(null===i[e[0]])return}return i}const i=Qt(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(sn(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(e){}}function Kr(e,t,n){const r=e.name.value;return void 0!==n?.sources[r]?n.coerced[r]:t?.coerced[r]}function zr(e){let t=e._memoizedCoercedDefaultValue;if(void 0!==t)return t;const r=e.default;if(void 0!==r)return t=r.literal?qr(r.literal,e.type):Jr(r.value,e.type),void 0!==t||n(),e._memoizedCoercedDefaultValue=t,t;const i=e.defaultValue;return void 0!==i&&(e._memoizedCoercedDefaultValue=i),i}function Yr(e,t,n,r,i){const o=e.arguments??[],s=new Map(o.map((e=>[e.name.value,e]))),a=Object.create(null),c=Object.create(null);for(const[o,u]of Object.entries(t)){a[o]={signature:u};const t=s.get(o);if(void 0!==t){const e=a[o];e.value=t.value,e.fragmentVariableValues=r}Wr(c,e,o,u,t,n,r,i)}return{sources:a,coerced:c}}function Hr(e,t,n,r,i){const o={},s=t.arguments??[],a=new Map(s.map((e=>[e.name.value,e])));for(const s of e.args){Wr(o,t,s.name,s,a.get(s.name),n,r,i)}return o}function Wr(e,t,r,i,o,s,a,c){const u=i.type;if(!o){if(Kt(i))throw new GraphQLError(`Argument "${It(i)?i:r}" of required type "${u}" was not provided.`,{nodes:t});const n=zr(i);return void(void 0!==n&&(e[r]=n))}const l=o.value;if(l.kind===L){const t=l.name.value,n=a?.sources[t]?a:s;if(!(null!=n&&Object.hasOwn(n.coerced,t)||Kt(i))){const t=zr(i);return void(void 0!==t&&(e[r]=t))}}const p=qr(l,u,s,a);void 0===p&&(ln(l,u,((e,t)=>{throw e.message=`Argument "${It(i)?i:i.name}" has invalid value${ze(t)}: ${e.message}`,e}),s,a,c),n(0,"Invalid argument")),e[r]=p}function Xr(e,t,n,r,i){const o=t.directives?.find((t=>t.name.value===e.name));if(o)return Hr(e,o,n,r,i)}function Zr(e,t,n,r,i,o,s=!1){const a=new AccumulatorMap,c=[],u={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Set,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return ei(u,i,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:u.forbiddenDirectiveInstances}}function ei(e,t,n,r,i,o){const{schema:s,fragments:a,variableValues:c,runtimeType:u,visitedFragmentNames:l,hideSuggestions:p}=e;for(const f of t.selections)switch(f.kind){case T:if(!ni(e,f,c,o))continue;n.add((d=f).alias?d.alias.value:d.name.value,{node:f,deferUsage:i,fragmentVariableValues:o});break;case S:{if(!ni(e,f,c,o)||!ri(s,f,u))continue;const t=ti(c,o,f,i);t?(r.push(t),ei(e,f.selectionSet,n,r,t,o)):ei(e,f.selectionSet,n,r,i,o);break}case N:{const t=f.name.value;if(l.has(t)||!ni(e,f,c,o))continue;const d=a[t];if(null==d||!ri(s,d.definition,u))continue;const h=ti(c,o,f,i),m=d.variableSignatures;let v;m&&(v=Yr(f,m,c,o,p)),h?(r.push(h),ei(e,d.definition.selectionSet,n,r,h,v)):(l.add(t),ei(e,d.definition.selectionSet,n,r,i,v));break}}var d}function ti(e,t,n,r){const i=Xr(On,n,e,t);if(i&&!1!==i.if)return{label:"string"==typeof i.label?i.label:void 0,parentDeferUsage:r}}function ni(e,t,n,r){const i=t.directives?.find((e=>e.name.value===In.name));if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;const o=i?Hr(In,i,n,r,e.hideSuggestions):void 0;if(!0===o?.if)return!1;const s=t.directives?.find((e=>e.name.value===Ln.name));if(s&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(s),!1;const a=s?Hr(Ln,s,n,r,e.hideSuggestions):void 0;return!1!==a?.if}function ri(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=vr(e,r);return i===n||!!Rt(i)&&e.isSubType(i,n)}function ii(e){return e.map((e=>e.node))}function oi(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function si(e){return{Field:t,Directive:t};function t(t){const n=oi(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function ai(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===H&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===V||n.kind===W)r=o;else if(Er(n)||br(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function ci(e,t){return!!(Lt(e)||Ot(e)||At(e))&&null!=e.getFields()[t]}function ui(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function li(e,t,n){return n&&ln(t,n,(t=>{e.reportError(t)}),void 0,void 0,e.hideSuggestions),!1}function pi(e,t,n,r,i){if(xt(r)&&!xt(t)){if(!(null!=n&&n.kind!==A)&&!(void 0!==i))return!1;return Zt(e,t,r.ofType)}return Zt(e,t,r)}const di=Object.freeze([function(e){function t(n,r=Object.create(null),i=0){if(n.kind===N){const o=n.name.value;if(!0===r[o])return!1;const s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===T&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}]),fi=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!Tr(n)){const t=n.kind===V||n.kind===W?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=e.getSchema();return{OperationDefinition(n){const r=n.operation;t.getRootType(r)||e.reportError(new GraphQLError(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===v)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===w&&(a[e.name.value]={definition:e});const{groupedFieldSet:c,forbiddenDirectiveInstances:u}=Zr(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(u.length>0)return void e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:u}));if(c.size>1){const t=[...c.values()].slice(1).flatMap((e=>ii(e)));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){ii(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ii(t)}))}}}}}},wr,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=vr(e.getSchema(),n);if(t&&!Ct(t)){const t=ft(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=vr(e.getSchema(),t.typeCondition);if(n&&!Ct(n)){const n=ft(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=vr(e.getSchema(),t.type);if(void 0!==n&&!$t(n)){const n=t.variable.name.value,r=ft(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Gt(Ut(n))){if(r){const i=t.name.value,o=Ge(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=He("to use an inline fragment on",e.hideSuggestions?[]:function(e,t,n){if(!Rt(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Ot(t)&&e.isSubType(t,n)?-1:Ot(n)&&e.isSubType(n,t)?1:Ze(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=He(e.hideSuggestions?[]:function(e,t){if(Lt(e)||Ot(e)){return rt(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},Ir,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Ct(n)&&Ct(r)&&!en(e.getSchema(),n,r)){const i=Ge(r),o=Ge(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=vr(e.getSchema(),n.typeCondition);if(Ct(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!en(e.getSchema(),r,i)){const o=Ge(i),s=Ge(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=oi(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i,fragmentVariableDefinition:o}of r){if(o)continue;const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{FragmentDefinition(t){const n=e.getVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(`Variable "$${i}" is never used in fragment "${t.name.value}".`,{nodes:n}))}},OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set;for(const{node:e,fragmentVariableDefinition:t}of n){const n=e.name.value;t||r.add(n)}const i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Sr,ai,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===On.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i}".`,{nodes:t}))),i&&t.name.value===kn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===d.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===w&&t.has(a.name.value)||a.kind===v&&a.operation===d.SUBSCRIPTION)&&(n.name.value===On.name?gr(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===kn.name&&(gr(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===On.name||n.name.value===kn.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;if(i.kind!==k)return void e.reportError(new GraphQLError(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===kn.name&&!(Dt(n.type)||Vt(n.type)&&Dt(n.type.ofType))&&e.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}},function(e){return{...Nr(e),FragmentArgument(t){const n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){const r=t.name.value,i=e.hideSuggestions?[]:rt(r,Array.from(n.variableDefinitions.values()).map((e=>e.variable.name.value)));e.reportError(new GraphQLError(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+He(i),{nodes:t}))}}},Argument(t){const n=e.getArgument(),r=e.getFieldDef();if(!n&&r){const n=t.name.value,i=e.hideSuggestions?[]:rt(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${r}".`+He(i),{nodes:t}))}}}},si,function(e){return{NullValue:t=>li(e,t,e.getInputType()),ListValue:t=>li(e,t,e.getParentInputType()),ObjectValue:t=>li(e,t,e.getInputType()),EnumValue:t=>li(e,t,e.getInputType()),IntValue:t=>li(e,t,e.getInputType()),FloatValue:t=>li(e,t,e.getInputType()),StringValue:t=>li(e,t,e.getInputType()),BooleanValue:t=>li(e,t,e.getInputType())}},function(e){return{...Pr(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)!r.has(i.name)&&Kt(i)&&e.reportError(new GraphQLError(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){const n=e.getFragmentSignature();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const[i,o]of n.variableDefinitions)if(!r.has(i)&&Br(o)){const n=Ge(vr(e.getSchema(),o.type));e.reportError(new GraphQLError(`Fragment "${t.name.value}" argument "${i}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,parentType:o,defaultValue:s,fragmentVariableDefinition:a}of r){const r=n.name.value;let c=a;if(c||(c=t.get(r)),c&&i){const t=e.getSchema(),a=vr(t,c.type);a&&!pi(t,a,c.defaultValue,i,s)&&e.reportError(new GraphQLError(`Variable "$${r}" of type "${a}" used in position expecting type "${i}".`,{nodes:[c,n]})),At(o)&&o.isOneOf&&jt(a)&&e.reportError(new GraphQLError(`Variable "$${r}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[c,n]}))}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new OrderedPairSet,n=new PairSet,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const s=[],[a,c]=Rr(e,t,i,o,void 0);if(function(e,t,n,r,i,o){for(const[s,a]of o.entries())if(a.length>1)for(let o=0;o0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(_t(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(ci(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=oi(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},wr,Sr,ai,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)Er(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=Ur[s.kind]:a&&(c=function(e){if(wt(e))return X;if(Lt(e))return Z;if(Ot(e))return ee;if(kt(e))return te;if(_t(e))return ne;if(At(e))return re;n(0,"Unexpected type: "+Ge(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case X:return"scalar";case Z:return"object";case ee:return"interface";case te:return"union";case ne:return"enum";case re:return"input object";default:n(0,"Unexpected kind: "+Ge(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=[...r.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+He(rt(o,n)),{nodes:i.name}))}}},Nr,si,ui,Pr]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===w&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===N?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r,i){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===w?e:void 0;lt(e,yr(r,{VariableDefinition:()=>!1,Variable(e){let t;if(i){const o=r.getFragmentSignatureByName()(i.name.value);t=o?.variableDefinitions.get(e.name.value),n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:t})}else n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}function mi(e,t,n=fi,r){!function(e){const t=er(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const i=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),o=[],s=new TypeInfo(e),a=new ValidationContext(e,t,s,(e=>{if(o.length>=100)throw i;o.push(e)}),!1),c=pt(n.map((e=>e(a))));try{lt(t,yr(s,c))}catch(e){if(e!==i)throw e;o.push(i)}return o}function vi(e,n){t(e)&&t(e.__schema)||xe(0,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Ge(e)}.`);const r=e.__schema,i=new Map(r.types.map((e=>[e.name,f(e)])));for(const e of[...bn,...Hn])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map((function(e){if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=Ge(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Jn.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Jn.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(function(e){if(!jt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL nullable type.`);return e}(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Ge(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!Lt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Ot(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){switch(e.kind){case Jn.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Jn.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>m(n)});case Jn.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>m(t)});case Jn.UNION:return function(e){if(null==e.possibleTypes){const t=Ge(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Jn.ENUM:return function(e){if(null==e.enumValues){const t=Ge(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:Xe(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Jn.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=Ge(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t,n,r;throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${Ge(e)}.`)}function h(e){if(null===e.interfaces&&e.kind===Jn.INTERFACE)return[];if(null==e.interfaces){const t=Ge(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function m(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${Ge(e)}.`);return Xe(e.fields,(e=>e.name),v)}function v(e){const t=u(e.type);if(!Ft(t)){const e=Ge(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return Xe(e,(e=>e.name),g)}function g(e){const t=u(e.type);if(!$t(t)){const e=Ge(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}return{description:e.description,type:t,default:null!=e.defaultValue?{literal:Ve(e.defaultValue)}:void 0,deprecationReason:e.deprecationReason}}}const yi={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function gi(e,t){const r=t({getNamedType:u,setNamedType:function(e){i.set(e.name,e)},getNamedTypes:function(){return Array.from(i.values())}}),i=new Map;for(const t of e.types){const e=t.name,n=l(t);n&&i.set(e,n)}const o=[];for(const t of e.directives){if(Fn(t)){o.push(t);continue}const e=m(t.toConfig());e&&o.push(new GraphQLDirective(e))}const s={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(i.values()),directives:o},a=r[yi.SCHEMA];return null==a?s:a(s);function c(e){return Dt(e)?new GraphQLList(c(e.ofType)):xt(e)?new GraphQLNonNull(c(e.ofType)):u(e.name)}function u(e){const t=Ti.get(e)??i.get(e);return void 0!==t||n(0,`Unknown type: "${e}".`),t}function l(e){return Wn(e)||Nn(e)?e:wt(e)?function(e){let t=e.toConfig();const n=r[yi.SCALAR];return t=null==n?t:n(t),new GraphQLScalarType(t)}(e):Lt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[yi.OBJECT];return n=null==i?n:i(n),new GraphQLObjectType(n)}(e):Ot(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[yi.INTERFACE];return n=null==i?n:i(n),new GraphQLInterfaceType(n)}(e):kt(e)?function(e){const t=e.toConfig();let n={...t,types:()=>t.types.map((e=>u(e.name)))};const i=r[yi.UNION];return n=null==i?n:i(n),new GraphQLUnionType(n)}(e):_t(e)?function(e){const t=e.toConfig();let n={...t,values:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.values)){const t=f(i,r,e.name);n[r]=t}return n}};const i=r[yi.ENUM];return n=null==i?n:i(n),new GraphQLEnumType(n)}(e):At(e)?function(e){const t=e.toConfig();let n={...t,fields:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.fields)){const t=h(i,r,e.name);n[r]=t}return n}};const i=r[yi.INPUT_OBJECT];return n=null==i?n:i(n),new GraphQLInputObjectType(n)}(e):void n(0,"Unexpected type: "+Ge(e))}function p(e,t){const n=Object.create(null);for(const[i,o]of Object.entries(e)){let e={...o,type:c(o.type),args:d(o.args,t,i)};const s=r[yi.FIELD];s&&(e=s(e,t)),n[i]=e}return n}function d(e,t,n){const i=Object.create(null);for(const[o,s]of Object.entries(e)){let e={...s,type:c(s.type)};const a=r[yi.ARGUMENT];a&&(e=a(e,t,n)),i[o]=e}return i}function f(e,t,n){const i={...e},o=r[yi.ENUM_VALUE];return null==o?i:o(i,t,n)}function h(e,t,n){const i={...e,type:c(e.type)},o=r[yi.INPUT_FIELD];return null==o?i:o(i,t,n)}function m(e){const t={...e,args:d(e.args,e.name,void 0)},n=r[yi.DIRECTIVE];return null==n?t:n(t)}}const Ti=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ei(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let h=!1;for(const e of t.definitions){switch(e.kind){case V:d=e;break;case W:f.push(e);break;case H:p.push(e);break;case M:case U:case J:case q:case K:case Y:i.push(e);break;case X:o.add(e.name.value,e);break;case Z:s.add(e.name.value,e);break;case ee:a.add(e.name.value,e);break;case te:c.add(e.name.value,e);break;case ne:u.add(e.name.value,e);break;case re:l.add(e.name.value,e);break;default:continue}h=!0}return h?gi(e,(e=>{const{getNamedType:t,setNamedType:h,getNamedTypes:m}=e;return{[yi.SCHEMA]:e=>{for(const e of i){const t=bi.get(e.name.value)??I(e);h(t)}const n={query:e.query&&t(e.query.name),mutation:e.mutation&&t(e.mutation.name),subscription:e.subscription&&t(e.subscription.name),...d&&v([d]),...v(f)};return{description:d?.description?.value??e.description,...n,types:m(),directives:[...e.directives,...p.map(T)],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1}},[yi.INPUT_OBJECT]:e=>{const t=l.get(e.name)??[];return{...e,fields:()=>({...e.fields(),...N(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.ENUM]:e=>{const t=u.get(e.name)??[];return{...e,values:()=>({...e.values(),...S(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.SCALAR]:e=>{const t=o.get(e.name)??[];let n=e.specifiedByURL;for(const e of t)n=Si(e)??n;return{...e,specifiedByURL:n,extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.OBJECT]:e=>{const t=s.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...w(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.INTERFACE]:e=>{const t=a.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...w(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.UNION]:e=>{const t=c.get(e.name)??[];return{...e,types:()=>[...e.types(),...L(t)],extensionASTNodes:e.extensionASTNodes.concat(t)}}};function v(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=y(n.type)}return t}function y(e){const r=e.name.value,i=t(r);return void 0!==i||n(0,`Unknown type: "${r}".`),i}function g(e){return e.kind===C?new GraphQLList(g(e.type)):e.kind===R?new GraphQLNonNull(g(e.type)):y(e)}function T(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:b(e.arguments),astNode:e})}function E(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:g(n.type),description:n.description?.value,args:b(n.arguments),deprecationReason:Ni(n),astNode:n}}return t}function b(e){const t=e??[],n=Object.create(null);for(const e of t){const t=g(e.type);n[e.name.value]={type:t,description:e.description?.value,default:e.defaultValue&&{literal:e.defaultValue},deprecationReason:Ni(e),astNode:e}}return n}function N(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=g(n.type);t[n.name.value]={type:e,description:n.description?.value,default:n.defaultValue&&{literal:n.defaultValue},deprecationReason:Ni(n),astNode:n}}}return t}function S(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:Ni(n),astNode:n}}return t}function w(e){return e.flatMap((e=>e.interfaces?.map(y)??[]))}function L(e){return e.flatMap((e=>e.types?.map(y)??[]))}function I(e){const t=e.name.value;switch(e.kind){case U:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>w(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case J:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>w(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case K:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:()=>S(r),astNode:e,extensionASTNodes:n})}case q:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>L(r),astNode:e,extensionASTNodes:n})}case M:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:Si(e),astNode:e,extensionASTNodes:n})}case Y:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>N(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(Xr(xn,n)))})}}var n}})):e}const bi=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ni(e){const t=Xr(An,e);return t?.reason}function Si(e){const t=Xr(Dn,e);return t?.url}function wi(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[Ii(e),...i.map((e=>function(e){return $i(e)+`directive ${e}`+Ai(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(wt(e))return function(e){return $i(e)+`scalar ${e}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${ft({kind:k,value:e.specifiedByURL})})`}(e)}(e);if(Lt(e))return function(e){return $i(e)+`type ${e}`+Oi(e)+ki(e)}(e);if(Ot(e))return function(e){return $i(e)+`interface ${e}`+Oi(e)+ki(e)}(e);if(kt(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return $i(e)+`union ${e.name}`+n}(e);if(_t(e))return function(e){const t=e.getValues().map(((e,t)=>$i(e," ",!t)+" "+e.name+xi(e.deprecationReason)));return $i(e)+`enum ${e}`+_i(t)}(e);if(At(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>$i(e," ",!t)+" "+Di(e)));return $i(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+_i(t)}(e);n(0,"Unexpected type: "+Ge(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!Fn(e)),Li)}function Li(e){return!Nn(e)&&!Wn(e)}function Ii(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:$i(e)+"schema {\n"+(t?` query: ${t}\n`:"")+(n?` mutation: ${n}\n`:"")+(r?` subscription: ${r}\n`:"")+"}"}function Oi(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function ki(e){return _i(Object.values(e.getFields()).map(((e,t)=>$i(e," ",!t)+" "+e.name+Ai(e.args," ")+": "+String(e.type)+xi(e.deprecationReason))))}function _i(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function Ai(e,t=""){return 0===e.length?"":e.every((e=>null==e.description))?"("+e.map(Di).join(", ")+")":"(\n"+e.map(((e,n)=>$i(e," "+t,!n)+" "+t+Di(e))).join("\n")+"\n"+t+")"}function Di(e){let t=e.name+": "+String(e.type);const n=Cn(e);return n&&(t+=` = ${ft(n)}`),t+xi(e.deprecationReason)}function xi(e){if(null==e)return"";if(e!==_n){return` @deprecated(reason: ${ft({kind:k,value:e})})`}return" @deprecated"}function $i(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+ft({kind:k,value:r,block:de(r)}).replaceAll("\n","\n"+t)+"\n"}function Fi(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:m,definitions:t}}const Gi=[Ir];function Qi(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Ci,Ri,Vi,ji,...n?[n]:[],...r?[r]:[],...fi.filter((e=>!Gi.includes(e)))]}function Ci(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function Ri(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Vi(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==On.name&&null==t.typeCondition&&e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",{nodes:t}))}}}function ji(e){return{InlineFragment(t){var n;if(t.directives)for(const r of t.directives)r.name.value!=On.name||(null===(n=r.arguments)||void 0===n?void 0:n.find((e=>"label"==e.name.value)))||e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",{nodes:t}))}}}function Mi(e){return{kind:h,value:e}}function Ui(e){return{kind:k,value:e}}function Pi(e){return{kind:H,description:e.description?Ui(e.description):void 0,name:Mi(e.name),repeatable:!1,locations:e.locations.map((e=>Mi(e))),arguments:e.args.map((e=>function(e){return{kind:B,description:Ui(e.description),name:Mi(e.name),type:Bi(Ut(e.type))}}(e)))}}function Bi(e){return{kind:Q,name:Mi(e.name)}}function Ji(e){return{kind:R,type:e}}const qi={kind:H,description:Ui("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:Mi("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[Mi("QUERY"),Mi("MUTATION"),Mi("SUBSCRIPTION"),Mi("FRAGMENT_DEFINITION")]},Ki={kind:H,description:Ui("Attach extra information to a given type."),name:Mi("typePolicy"),arguments:[{kind:B,description:Ui("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),name:Mi("keyFields"),type:Ji(Bi(gn))}],repeatable:!1,locations:[Mi("OBJECT"),Mi("INTERFACE")]},zi={kind:H,description:Ui("A directive used by Apollo iOS to map query input data to cache keys of objects."),name:Mi("fieldPolicy"),arguments:[{kind:B,description:Ui("The field you are setting the @fieldPolicy for."),name:Mi("forField"),type:Ji(Bi(gn))},{kind:B,description:Ui("Set of fields used to compute the cache key."),name:Mi("keyArgs"),type:Ji(Bi(gn))}],repeatable:!0,locations:[Mi("OBJECT"),Mi("INTERFACE")]},Yi={kind:H,description:Ui("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),name:Mi("import"),arguments:[{kind:B,description:Ui("The name of the module to import."),name:Mi("module"),type:Ji(Bi(gn))}],repeatable:!0,locations:[Mi("QUERY"),Mi("MUTATION"),Mi("SUBSCRIPTION"),Mi("FRAGMENT_DEFINITION")]},Hi=[qi,Yi,Ki,zi];const Wi={kind:T,name:{kind:h,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Xi(e){const t=function(e,t,n=hi){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return lt(e,pt(n.map((e=>e(i))))),r}(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Zi(e){const t=er(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function eo(e){return e.startsWith("__")}function to(e){if(!e)return!1;for(const t of e)if(t.name.value==qi.name.value)return!0;return!1}const no={kind:T,name:{kind:h,value:"__typename"}};function ro(e,t){return t&&(e=function(e){return lt(e,{enter:e=>e.kind!==g?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===T||e.kind===w||e.kind===S)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Wi,...e.selectionSet.selections]}}}})}(e)),lt(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![T,w].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==no.kind&&e.name.value==no.name.value));return t?e:{...e,selections:[no,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==no.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){const t=[qi,Yi];for(const n of t)if(e.name.value==n.name.value)return null;return e}(e)}})}function io(e){return null!=e}function oo(e){switch(e.kind){case L:return{kind:e.kind,value:e.name.value};case x:return{kind:e.kind,value:e.values.map(oo)};case $:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=oo(t.value),e)),{})};default:return e}}function so(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function ao(e,t,n,r,i){var o,s,a;const c=new Map;for(const e of t.definitions)e.kind===w&&c.set(e.name.value,e);const u=[],l=new Map,p=new Set,d=r,f=e.getQueryType();if(void 0===f)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const h={queryType:f,mutationType:null!==(o=e.getMutationType())&&void 0!==o?o:void 0,subscriptionType:null!==(s=e.getSubscriptionType())&&void 0!==s?s:void 0};for(const e of t.definitions)e.kind===v&&u.push(g(e));for(const[e,t]of c.entries())l.set(e,E(t));return{rootTypes:h,operations:u,fragments:Array.from(l.values()),referencedTypes:Array.from(p.values()),schemaDocumentation:null!==(a=e.description)&&void 0!==a?a:void 0};function m(t){if(!p.has(t)){if(p.add(t),Ot(t)){const n=e.getPossibleTypes(t);t._implementingObjects=n;for(const e of n)d&&!y(e)||m(Ut(e))}if(kt(t)){const e=t.getTypes();for(t of e)m(Ut(t))}if(At(t)&&function(e){const t=e.getFields();for(const e in t){m(Ut(t[e].type))}}(t),Lt(t))for(const e of t.getInterfaces())m(Ut(e))}}function y(e){var t,n;const r=Ki.name.value;for(const i of null!==(n=null===(t=e.astNode)||void 0===t?void 0:t.directives)&&void 0!==n?n:[])if(i.name.value===r)return!0;return!1}function g(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=so(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?oo(t.defaultValue):void 0,i=vr(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return m(Ut(i)),{name:n,type:i,defaultValue:r}})),u=ft(ro(t,n)),l=e.getRootType(s),[p]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(l);const d=I(t.selectionSet,l,a),f=Array.from(a.values());return to(t.directives)&&b(f),{name:o,operationType:s,variables:c,rootType:l,selectionSet:d,directives:p,referencedFragments:f,source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=so(t),s=ft(ro(t,n)),a=new Set,c=vr(e,t.typeCondition),[u]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(Ut(c));const l=I(t.selectionSet,c,a),p=Array.from(a.values());return to(t.directives)&&b(p),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:l,directives:u,referencedFragments:p,overrideAsLocalCacheMutation:!1}}function b(e){e.forEach((e=>{e.overrideAsLocalCacheMutation=!0,b(e.referencedFragments)}))}function I(t,n,r){return{parentType:n,selections:t.selections.map((t=>function(t,n,r){var o,s,a,u;const[p,d]=null!==(o=k(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case T:{const f=t.name.value;if("__typename"==f)return;const h=null===(s=t.alias)||void 0===s?void 0:s.value,v=function(e,t,n){return n===Kn.name&&e.getQueryType()===t?Kn:n===zn.name&&e.getQueryType()===t?zn:n===Yn.name&&(Lt(t)||Ot(t)||kt(t))?Yn:Lt(t)||Ot(t)?t.getFields()[n]:void 0}(e,n,f);if(!v)throw new GraphQLError(`Cannot query field "${f}" on type "${String(n)}"`,{nodes:t});const y=v.type,g=Ut(v.type);m(Ut(g));const{description:b,deprecationReason:w}=v;let L={kind:"Field",name:f,alias:h,type:y,arguments:O(v,t.arguments),inclusionConditions:d,description:!eo(f)&&b?b:void 0,deprecationReason:w||void 0,directives:p,fieldPolicyKeys:v._apolloFieldPolicies||void 0};function _(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Dt(y)||xt(y)&&Dt(y.ofType)?_(t,null===(a=i.disallowedFieldNames)||void 0===a?void 0:a.entityList,i.schemaNamespace):Ct(g)&&_(t,null===(u=i.disallowedFieldNames)||void 0===u?void 0:u.entity,i.schemaNamespace),Ct(g)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${f}" on type "${String(n)}" requires selection set`,{nodes:t});L.selectionSet=I(A,g,r)}return L}case S:{const D=t.typeCondition,x=D?vr(e,D):n;return m(x),{kind:"InlineFragment",selectionSet:I(t.selectionSet,x,r),inclusionConditions:d,directives:p}}case N:{const $=t.name.value,F=function(e){let t=l.get(e);if(t)return t;const n=c.get(e);return n?(c.delete(e),t=E(n),l.set(e,t),t):void 0}($);if(!F)throw new GraphQLError(`Unknown fragment "${$}".`,{nodes:t.name});r.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,r))).filter(io)}}function O(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:oo(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function k(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:O(o,i.arguments)});const s=A(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function A(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case _:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case L:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function co(e){return e.kind===H&&e.name.value===On.name}function uo(){return{kind:m,definitions:[Pi(On)]}}const lo=Ki.name.value;function po(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()}function fo(e){var t,n,r,i;if(kt(e))return;for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const t=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===lo));if(t)return{directive:t,source:e}}let o;for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])if(t.name.value===lo){o={directive:t,source:e};break}if("getInterfaces"in e)for(const t of e.getInterfaces()){const n=fo(t);if(n)if(o){if(!po(o.directive,n.directive))throw o.source===e?new GraphQLError(`Type "${e.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${n.source.name}".`,{nodes:e.astNode}):new GraphQLError(`Type "${e.name}" inherits conflicting @typePolicy directives from interfaces "${o.source.name}" and "${n.source.name}".`,{nodes:e.astNode})}else o=n}return o}function ho(e){var t,n,r;const i=fo(e);if(!i)return[];const o=null===(r=null===(n=null===(t=i.directive)||void 0===t?void 0:t.arguments)||void 0===n?void 0:n.find((e=>"keyFields"===e.name.value)))||void 0===r?void 0:r.value;if(!o||o.kind!==k)return[];const s=o.value.split(" ");return function(e,t){const{directive:n,source:r}=e;if(kt(r))return;const i=Ot(r)?"interface":"object";var o=r.getFields();for(const e of t){if(!e)throw new GraphQLError("Key fields must be a space-separated list of identifiers.",{nodes:n});const t=o[e];if(!t)throw new GraphQLError(`Key field "${e}" does not exist on ${i} "${r.name}".`,{nodes:r.astNode?[r.astNode,n]:n});if(!xt(t.type))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be non-nullable.`,{nodes:t.astNode?[t.astNode,n]:n});if(!wt(t.type.ofType))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be a scalar type, got ${t.type}.`,{nodes:t.astNode?[t.astNode,n]:n})}}(i,s),s}function mo(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&(n._apolloKeyFields=ho(n))}}const vo=zi.name.value;function yo(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&go(n)}}function go(e){var t,n,r,i,o,s;const a=To(e);if(!a||kt(e))return;const c=e.getFields();for(const l of a){const a=null===(n=null===(t=l.arguments)||void 0===t?void 0:t.find((e=>"forField"===e.name.value)))||void 0===n?void 0:n.value;let p;if((null==a?void 0:a.kind)===k&&(p=a.value),!p)throw new GraphQLError("@fieldPolicy directive must have a 'forField' value.",{nodes:l});const d=null===(i=null===(r=l.arguments)||void 0===r?void 0:r.find((e=>"keyArgs"===e.name.value)))||void 0===i?void 0:i.value;let f=[];if((null==d?void 0:d.kind)===k){const e=d.value.split(/\s+/);f=[...new Set(e.filter(Boolean))]}if(0===f.length)throw new GraphQLError("'keyArgs' must be a space-separated list of identifiers.",{nodes:l});const h=c[p];if(!h)throw new GraphQLError(`Field "${p}" does not exist on type "${e.name}".`,{nodes:e.astNode?[e.astNode,l]:l});const m=null===(o=h.astNode)||void 0===o?void 0:o.arguments,v=new Set(null!==(s=null==m?void 0:m.map((e=>e.name.value)))&&void 0!==s?s:[]);for(const e of f)if(!v.has(e))throw new GraphQLError(`@fieldPolicy key argument "${e}" does not exist as an input argument of field "${h.name}".`,{nodes:h.astNode});if(m){var u=0;const e=Dt(h.type);for(const e of m)"ListType"==e.type.kind&&(u+=1);if(u>1)throw new GraphQLError("@fieldPolicy can only have at most 1 List type input parameter.",{nodes:h.astNode});if(e&&1!=u||1==u&&!e)throw new GraphQLError("@fieldPolicy requires either both a List return type and 1 List input parameter, or neither.",{nodes:h.astNode})}h._apolloFieldPolicies=f}}function To(e){var t,n,r,i;if(!Lt(e)&&!Ot(e))return;const o=[];for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const e=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===vo));e&&o.push(e)}for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])t.name.value===vo&&o.push(t);if("getInterfaces"in e)for(const t of e.getInterfaces()){const e=To(t);if(e)for(const t of e){var s=!1;for(const e of o)if(Eo(e,t)){s=!0;break}s||o.push(t)}}return o}function Eo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r,i){return ao(e,t,n,r,i)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(Re(r));var r=function(e){const t=Hi.filter((t=>!e.definitions.some((e=>e.kind==H&&e.name.value==t.name.value))));return Fi([e,{kind:m,definitions:t}])}(Fi(n));if(t){var i=function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=vi(t);return n}(t.body);return r=function(e,t){const n=e.getDirective(On.name);return n?function(e,t){return e.isRepeatable===t.isRepeatable&&e.locations.slice(0).sort().toString()===t.locations.slice(0).sort().toString()&&e.args.map((e=>e.name)).sort().toString()===t.args.map((e=>e.name)).sort().toString()}(n,On)?t:(console.warn(`Unsupported ${n.name} directive found. It will be replaced with a supported definition instead.`),Fi([t,uo()])):Fi([t,uo()])}(i,r),mo(i=function(e,t,n){Xn(e);const r=e.toConfig(),i=Ei(r,t,n);return r===i?e:new GraphQLSchema(i)}(i,r,{assumeValid:!0})),yo(i),Zi(i),i}{Xi(r=function(e){const t=e.definitions.find(co);if(!t)return Fi([e,uo()]);const n=t;if(!function(e,t){var n;return e.repeatable===t.isRepeatable&&e.locations.map((e=>e.value)).sort().toString()===t.locations.slice(0).sort().toString()&&(null===(n=e.arguments)||void 0===n?void 0:n.map((e=>e.name.value)).sort().toString())===t.args.map((e=>e.name)).sort().toString()}(n,On))return console.warn(`Unsupported ${n.name.value} directive found. It will be replaced with a supported definition instead.`),{kind:m,definitions:e.definitions.filter((e=>co(e)?void 0:e)).concat(Pi(On))};return e}(r));const e=function(e,t){const n=Ei({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...$n.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}(r,{assumeValid:!0});return mo(e),yo(e),Zi(e),e}},e.mergeDocuments=function(e){return Fi(e)},e.parseOperationDocument=function(e){return Re(e)},e.printSchemaToSDL=function(e){return wi(e)},e.validateDocument=function(e,t,n){return mi(e,t,Qi(n))},e}({});"# \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift index 684d1c6aa..c6fe2150c 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/CompilationResult.swift @@ -493,7 +493,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { public let arguments: [Argument]? - public let fieldPolicyKeys: [String] + public let fieldPolicyKeys: [String]? public let inclusionConditions: [InclusionCondition]? @@ -517,7 +517,7 @@ public final class CompilationResult: JavaScriptObjectDecodable { name: String, alias: String? = nil, arguments: [Argument]? = nil, - fieldPolicyKeys: [String] = [], + fieldPolicyKeys: [String]? = nil, inclusionConditions: [InclusionCondition]? = nil, directives: [Directive]? = nil, type: GraphQLType, @@ -538,11 +538,14 @@ public final class CompilationResult: JavaScriptObjectDecodable { } static func fromJSValue(_ jsValue: JSValue, bridge: isolated JavaScriptBridge) -> Self { - self.init( + let name = jsValue["name"] as String + let fieldPolicy = jsValue["fieldPolicyKeys"] + + return self.init( name: jsValue["name"], alias: jsValue["alias"], arguments: .fromJSValue(jsValue["arguments"], bridge: bridge), - fieldPolicyKeys: jsValue["_apolloFieldPolicies"], + fieldPolicyKeys: jsValue["fieldPolicyKeys"], inclusionConditions: jsValue["inclusionConditions"], directives: .fromJSValue(jsValue["directives"], bridge: bridge), type: .fromJSValue(jsValue["type"], bridge: bridge), diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift index 323aacc7e..d16a0c0bc 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift @@ -347,8 +347,6 @@ public final class GraphQLField: public let type: GraphQLType public let arguments: [GraphQLFieldArgument] - - public let fieldPolicyKeys: [String] public let documentation: String? @@ -358,14 +356,12 @@ public final class GraphQLField: name: String, type: GraphQLType, arguments: [GraphQLFieldArgument], - fieldPolicyKeys: [String] = [], documentation: String?, deprecationReason: String? ) { self.name = name self.type = type self.arguments = arguments - self.fieldPolicyKeys = fieldPolicyKeys self.documentation = documentation self.deprecationReason = deprecationReason } @@ -378,7 +374,6 @@ public final class GraphQLField: name: jsValue["name"], type: .fromJSValue(jsValue["type"], bridge: bridge), arguments: .fromJSValue(jsValue["args"], bridge: bridge), - fieldPolicyKeys: jsValue["_apolloFieldPolicies"], documentation: jsValue["description"], deprecationReason: jsValue["deprecationReason"] ) @@ -388,14 +383,12 @@ public final class GraphQLField: hasher.combine(name) hasher.combine(type) hasher.combine(arguments) - hasher.combine(fieldPolicyKeys) } public static func == (lhs: GraphQLField, rhs: GraphQLField) -> Bool { lhs.name == rhs.name && lhs.type == rhs.type && - lhs.arguments == rhs.arguments && - lhs.fieldPolicyKeys == rhs.fieldPolicyKeys + lhs.arguments == rhs.arguments } public var debugDescription: String { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json index f835762ad..46eaf5169 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json @@ -16,7 +16,7 @@ "@rollup/plugin-node-resolve": "16.0.1", "@rollup/plugin-replace": "6.0.2", "@rollup/plugin-terser": "0.4.4", - "@rollup/plugin-typescript": "12.1.4", + "@rollup/plugin-typescript": "12.1.2", "@types/common-tags": "1.8.4", "@types/jest": "30.0.0", "common-tags": "1.8.2", @@ -1098,11 +1098,10 @@ } }, "node_modules/@rollup/plugin-typescript": { - "version": "12.1.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.4.tgz", - "integrity": "sha512-s5Hx+EtN60LMlDBvl5f04bEiFZmAepk27Q+mr85L/00zPDn1jtzlTV6FWn81MaIwqfWzKxmOJrBWHU6vtQyedQ==", + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", + "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.1.0", "resolve": "^1.22.1" diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts index a3cc951eb..e4f1b68a6 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/__tests__/fieldPolicyDirectiveTests.ts @@ -457,4 +457,69 @@ describe("given field policy with one invalid keyArg", () => { ]) ).toThrow(GraphQLError); }); +}); + +describe("given field policy with nested list parameter", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withIds: [[ID]!]!, andSpecies: String!): [Animal!] + } + + type Animal { + id: ID! + name: String! + species: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withIds andSpecies") + `; + + it("should throw error for nested list", () => { + expect(() => + loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]) + ).toThrow(GraphQLError); + }); +}); + +describe("given field policy with input object", () => { + const schemaSDL: string = ` + type Query { + allAnimals(withName: AnimalInput!, andSpecies: String!): Animal! + } + + input AnimalInput { + dog: DogInput + } + + input DogInput { + name: String! + } + + type Animal { + id: ID! + name: String! + species: String! + } + + extend type Query @fieldPolicy(forField: "allAnimals", keyArgs: "withName.dog.name andSpecies") + `; + + it("should validate dot notation nested values", () => { + const schema: GraphQLSchema = loadSchemaFromSources([ + new Source(schemaSDL, "Test Schema", { line: 1, column: 1 }), + ]); + + const queryType = schema.getTypeMap()["Query"]; + if (!queryType || !("getFields" in queryType)) throw new Error("Missing Query type."); + + const queryFields = queryType.getFields(); + for (const fieldName in queryFields) { + const field = queryFields[fieldName] as FieldWithMeta; + expect(fieldName).toEqual("allAnimals"); + expect(field._apolloFieldPolicies).toHaveLength(2); + expect(field._apolloFieldPolicies).toEqual(["withName.dog.name", "andSpecies"]); + } + }); }); \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts index c6a120497..09674a82e 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts @@ -353,6 +353,7 @@ export function compileToIR( description: !isMetaFieldName(name) && description ? description : undefined, deprecationReason: deprecationReason || undefined, directives: directives, + fieldPolicyKeys: (fieldDef as any)._apolloFieldPolicies || undefined }; function validateFieldName(node: FieldNode, disallowedNames?: Array, schemaNamespace?: string) { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/ir.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/ir.ts index 3b0233def..c6f835074 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/ir.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/ir.ts @@ -63,6 +63,7 @@ export interface Field { deprecationReason?: string; selectionSet?: SelectionSet; directives?: Directive[]; + fieldPolicyKeys?: string[]; } export interface Argument { diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts index bd4a2a6d2..177e7e95e 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts @@ -1,12 +1,18 @@ import { DirectiveNode, + getNamedType, + getNullableType, GraphQLCompositeType, GraphQLError, + GraphQLField, + GraphQLInputType, GraphQLInterfaceType, GraphQLObjectType, GraphQLSchema, + isInputObjectType, isInterfaceType, isListType, + isNonNullType, isObjectType, isUnionType, Kind, @@ -16,11 +22,6 @@ import { directive_fieldPolicy } from "./apolloCodegenSchemaExtension"; const directiveName = directive_fieldPolicy.name.value -// type FieldPolicyDirectiveResult = { -// directive: DirectiveNode; -// source: GraphQLObjectType; -// }; - export function addFieldPolicyDirectivesToSchema( schema: GraphQLSchema ) { @@ -30,7 +31,6 @@ export function addFieldPolicyDirectivesToSchema( const type = types[t]; if (type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) { - // (type as any)._apolloFieldPolicies = applyFieldPoliciesFor(type); applyFieldPoliciesFor(type); } } @@ -65,13 +65,13 @@ export function applyFieldPoliciesFor( const keyArgsValueNode = directive.arguments?.find( (b) => b.name.value === "keyArgs" )?.value - let keyArgs: string[] | undefined = undefined; - if (keyArgsValueNode?.kind == Kind.STRING) { - const rawArgs = keyArgsValueNode.value.split(" "); + let keyArgs: string[] = []; + if (keyArgsValueNode?.kind === Kind.STRING) { + const rawArgs = keyArgsValueNode.value.split(/\s+/); keyArgs = [...new Set(rawArgs.filter(Boolean))]; } - if (!keyArgs) { + if (keyArgs.length === 0) { throw new GraphQLError( `'keyArgs' must be a space-separated list of identifiers.`, { nodes: directive } @@ -88,53 +88,12 @@ export function applyFieldPoliciesFor( } // validate the provided key args match an input parameter - const inputs = actualField.astNode?.arguments; - const inputNames = new Set(inputs?.map(input => input.name.value) ?? []); - for (const keyArg of keyArgs) { - if (!inputNames.has(keyArg)) { - throw new GraphQLError( - `@fieldPolicy key argument "${keyArg}" does not exist as an input argument of field "${actualField.name}".`, - { - nodes: actualField.astNode - } - ); - } - } + validateKeyArgs(actualField, keyArgs); // List input and return type validation - if (inputs) { - var numListInputs = 0; - const hasListReturnType = isListType(actualField.type); - - for (const inputArg of inputs) { - if (inputArg.type.kind == "ListType") { - numListInputs += 1; - } - } - - // validate we have at most 1 list input parameter - if (numListInputs > 1) { - throw new GraphQLError( - `@fieldPolicy can only have at most 1 List type input parameter.`, - { nodes: actualField.astNode } - ); - } + validateListRules(actualField); - // validate that a list input parameter and return type exist either together - // or not at all - if ((hasListReturnType && numListInputs != 1) || (numListInputs == 1 && !hasListReturnType)) { - throw new GraphQLError( - `@fieldPolicy requires either both a List return type and 1 List input parameter, or neither.`, - { nodes: actualField.astNode } - ); - } - } - - if (!(actualField as any)._apolloFieldPolicies) { - (actualField as any)._apolloFieldPolicies = keyArgs - } else { - (actualField as any)._apolloFieldPolicies = [] - } + (actualField as any)._apolloFieldPolicies = keyArgs; } } @@ -206,4 +165,108 @@ function matchDirectiveArguments( .sort() .toString() ); +} + +function validateKeyArgs( + actualField: GraphQLField, + keyArgs: string[] +): void { + for (const keyArg of keyArgs) { + validateKeyArgPath(actualField, keyArg); + } +} + +function validateKeyArgPath( + field: GraphQLField, + keyArg: string +): void { + const parts = keyArg.split(".").filter(Boolean); + const [argName, ...path] = parts; + + const arg = field.args.find(a => a.name === argName); + if (!arg) { + throw new GraphQLError( + `@fieldPolicy key argument "${keyArg}" does not exist as an input argument of field "${field.name}".`, + { nodes: field.astNode } + ); + } + + let curType: GraphQLInputType = base(arg.type); + + for (let i = 0; i < path.length; i++) { + const segment = path[i]; + if (!isInputObjectType(curType)) { + throw new GraphQLError( + `@fieldPolicy key "${keyArg}" traverses "${segment}" on non-object input type "${String(curType)}".`, + { nodes: field.astNode } + ); + } + const fieldMap = curType.getFields(); + const nextField = fieldMap[segment]; + if (!nextField) { + const suggestions = Object.keys(fieldMap).join(", "); + throw new GraphQLError( + `@fieldPolicy key "${keyArg}" refers to unknown input field "${segment}" on "${curType.name}". Known fields: ${suggestions}`, + { nodes: field.astNode } + ); + } + curType = base(nextField.type); + } + + if (!parts.length || isInputObjectType(curType)) { + throw new GraphQLError( + `@fieldPolicy key "${keyArg}" must resolve to a leaf input type (scalar/enum), got "${String(curType)}".`, + { nodes: field.astNode } + ); + } +} + +function base(type: GraphQLInputType): GraphQLInputType { + return getNamedType(type) as GraphQLInputType; +} + +function isListArg(t: GraphQLInputType): boolean { + return isListType(getNullableType(t)); +} + +function hasNestedList(t: GraphQLInputType): boolean { + let outer: any = isNonNullType(t) ? t.ofType : t; + if (!isListType(outer)) return false; + + let inner: any = isNonNullType(outer.ofType) ? outer.ofType.ofType : outer.ofType; + return isListType(inner); +} + +function validateListRules(field: GraphQLField) { + const hasListReturnType = isListType(getNullableType(field.type)); + + let numListInputs = 0; + + for (const arg of field.args) { + if (isListArg(arg.type)) { + numListInputs += 1; + + if (hasNestedList(arg.type)) { + throw new GraphQLError( + `@fieldPolicy does not allow nested list input parameters. Argument "${arg.name}" has type "${String(arg.type)}".`, + { nodes: field.astNode } + ); + } + } + } + + if (numListInputs > 1) { + throw new GraphQLError( + `@fieldPolicy can only have at most 1 List type input parameter.`, + { nodes: field.astNode } + ); + } + + if ((hasListReturnType && numListInputs !== 1) || + (!hasListReturnType && numListInputs !== 0)) { + throw new GraphQLError( + `@fieldPolicy requires either both a List return type and exactly 1 List input parameter, or neither.`, + { nodes: field.astNode } + ); + } } \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/IR/IR+Fields.swift b/apollo-ios-codegen/Sources/IR/IR+Fields.swift index 24665798b..6c45878f8 100644 --- a/apollo-ios-codegen/Sources/IR/IR+Fields.swift +++ b/apollo-ios-codegen/Sources/IR/IR+Fields.swift @@ -12,7 +12,7 @@ public class Field: Equatable, CustomDebugStringConvertible { public var responseKey: String { underlyingField.responseKey } public var type: GraphQLType { underlyingField.type } public var arguments: [CompilationResult.Argument]? { underlyingField.arguments } - public var fieldPolicyKeys: [String] { underlyingField.fieldPolicyKeys } + public var fieldPolicyKeys: [String]? { underlyingField.fieldPolicyKeys } fileprivate init( _ field: CompilationResult.Field, diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 1050924f1..506b674ef 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -34,8 +34,9 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, on object: Record ) -> PossiblyDeferred { - PossiblyDeferred { - let value = try object[info.cacheKeyForField()] + PossiblyDeferred { + + let value = try resolveCacheKey(with: info, on: object) switch value { case let reference as CacheReference: @@ -67,6 +68,105 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { } } } + + private func resolveCacheKey( + with info: FieldExecutionInfo, + on object: Record + ) throws -> AnyHashable? { + // TODO: Add call to new SchemaConfiguration method for programmatic field policy + // TODO: Revisit to determine what data we want to expose to pass to SchemaConfiguration + + if let keys = resolveFieldPolicy(with: info) { + if keys.count > 1 { + return keys.compactMap { $0 as? CacheKey }.map { object[$0] } + } else if let key = keys.first as? CacheKey { + return object[key] + } + return nil + } + + let key = try info.cacheKeyForField() + return object[key] + } + + private func resolveFieldPolicy(with info: FieldExecutionInfo) -> [AnyHashable]? { + guard let fieldPolicy = info.field.fieldPolicy, + let arguments = info.field.arguments else { + return nil + } + + struct ParsedKey { let name: String; let path: [String]? } + + let parsed: [ParsedKey] = fieldPolicy.keys.map { key in + if let dot = key.firstIndex(of: ".") { + let name = String(key[.. 1 { + listIndex = i + listValues = resolved + } else { + guard let value = resolved.first else { + return nil + } + fixedParts[i] = value + } + } + + if let idx = listIndex { + var keys: [String] = [] + keys.reserveCapacity(listValues.count) + for item in listValues { + var parts = [String]() + parts.reserveCapacity(parsed.count) + for j in 0.. String { + switch info.field.type.namedType { + case .object(let selectionSetType): + return selectionSetType.__parentType.__typename + default: + break + } + return "" + } private func deferredResolve(reference: CacheReference) -> PossiblyDeferred { guard let transaction else { @@ -103,4 +203,121 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { } } +extension ScalarType { + var cacheKeyComponentStringValue: String { + switch self { + case let strVal as String: + return strVal + case let boolVal as Bool: + return boolVal ? "true" : "false" + case let intVal as Int: + return String(intVal) + case let doubleVal as Double: + return String(doubleVal) + case let floatVal as Float: + return String(floatVal) + default: + return String(describing: self) + } + } +} + +extension JSONValue { + func cacheKeyComponentStringValue(keyPath: [String]? = nil) -> [String]? { + switch self { + case let strVal as String: + return [strVal] + case let boolVal as Bool: + return boolVal ? ["true"] : ["false"] + case let intVal as Int: + return [String(intVal)] + case let doubleVal as Double: + return [String(doubleVal)] + case let floatVal as Float: + return [String(floatVal)] + case let arrVal as [JSONValue]: + let values: [String] = arrVal.compactMap { $0.cacheKeyComponentStringValue()?.first } + guard !values.isEmpty else { return nil } + return values + case let objVal as JSONObject: + guard let keyPath, !keyPath.isEmpty else { return nil } + guard let targetValue = objVal.walk(path: keyPath[...]) else { return nil } + return targetValue.cacheKeyComponentStringValue() + default: + return [String(describing: self)] + } + } +} + +extension JSONObject { + fileprivate func walk( + path: ArraySlice + ) -> JSONValue? { + guard let head = path.first else { return self } + guard let next = self[head] else { return nil } + if path.count == 1 { return next } + if let nested = next as? JSONObject { + return nested.walk(path: path.dropFirst()) + } + return nil + } +} + +extension InputValue { + fileprivate func resolveValue(keyPath: [String]? = nil, variables: [String: (any GraphQLOperationVariableValue)]? = nil) -> [String]? { + switch self { + case .scalar(let scalar): + return [scalar.cacheKeyComponentStringValue] + case .variable(let varName): + guard let varValue = variables?[varName] else { + return nil + } + return varValue._jsonEncodableValue?._jsonValue.cacheKeyComponentStringValue(keyPath: keyPath) + case .list(let list): + if list.contains(where: { if case .list = $0 { return true } else { return false } }) { + return nil + } + let values = list.compactMap { $0.resolveValue()?.first } + guard !values.isEmpty else { return nil } + return values + case .object(let dict): + guard let keyPath, !keyPath.isEmpty else { return nil } + guard let targetValue = self.walk(dict: dict, path: keyPath[...]) else { return nil } + return targetValue.resolveValue() + default: + return nil + } + } + +// fileprivate func resolveScalar(_ scalar: any ScalarType) -> String? { +// switch scalar { +// case let strVal as String: +// return strVal +// case let boolVal as Bool: +// return boolVal ? "true" : "false" +// case let intVal as Int: +// return String(intVal) +// case let doubleVal as Double: +// return String(doubleVal) +// case let floatVal as Float: +// return String(floatVal) +// default: +// return String(describing: scalar) +// } +// } + + fileprivate func walk( + dict: [String: InputValue], + path: ArraySlice + ) -> InputValue? { + guard let head = path.first else { return .object(dict) } + guard let next = dict[head] else { return nil } + if path.count == 1 { return next } + if case .object(let nested) = next { + return walk(dict: nested, path: path.dropFirst()) + } + return nil + } +} + diff --git a/apollo-ios/Sources/ApolloAPI/Selection.swift b/apollo-ios/Sources/ApolloAPI/Selection.swift index 50345053e..fdebf6f1f 100644 --- a/apollo-ios/Sources/ApolloAPI/Selection.swift +++ b/apollo-ios/Sources/ApolloAPI/Selection.swift @@ -32,7 +32,7 @@ public enum Selection { self.alias = alias self.arguments = arguments self.type = type - self.fieldPolicy = nil + self.fieldPolicy = fieldPolicy } public indirect enum OutputType { @@ -66,6 +66,7 @@ public enum Selection { ) { self.keys = keys } + } // MARK: - Convenience Initializers From 660cb3ee50fc19182cd5db62109c94603c4be7f4 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Thu, 21 Aug 2025 19:47:56 -0400 Subject: [PATCH 04/35] Restructured field policy code --- .../CacheDataExecutionSource.swift | 200 +----------------- .../Sources/Apollo/FieldPolicyEvaluator.swift | 195 +++++++++++++++++ 2 files changed, 196 insertions(+), 199 deletions(-) create mode 100644 apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 506b674ef..8e41a07b3 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -76,7 +76,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { // TODO: Add call to new SchemaConfiguration method for programmatic field policy // TODO: Revisit to determine what data we want to expose to pass to SchemaConfiguration - if let keys = resolveFieldPolicy(with: info) { + if let keys = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables).resolveFieldPolicy() { if keys.count > 1 { return keys.compactMap { $0 as? CacheKey }.map { object[$0] } } else if let key = keys.first as? CacheKey { @@ -88,85 +88,6 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { let key = try info.cacheKeyForField() return object[key] } - - private func resolveFieldPolicy(with info: FieldExecutionInfo) -> [AnyHashable]? { - guard let fieldPolicy = info.field.fieldPolicy, - let arguments = info.field.arguments else { - return nil - } - - struct ParsedKey { let name: String; let path: [String]? } - - let parsed: [ParsedKey] = fieldPolicy.keys.map { key in - if let dot = key.firstIndex(of: ".") { - let name = String(key[.. 1 { - listIndex = i - listValues = resolved - } else { - guard let value = resolved.first else { - return nil - } - fixedParts[i] = value - } - } - - if let idx = listIndex { - var keys: [String] = [] - keys.reserveCapacity(listValues.count) - for item in listValues { - var parts = [String]() - parts.reserveCapacity(parsed.count) - for j in 0.. String { - switch info.field.type.namedType { - case .object(let selectionSetType): - return selectionSetType.__parentType.__typename - default: - break - } - return "" - } private func deferredResolve(reference: CacheReference) -> PossiblyDeferred { guard let transaction else { @@ -202,122 +123,3 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { } } } - -extension ScalarType { - var cacheKeyComponentStringValue: String { - switch self { - case let strVal as String: - return strVal - case let boolVal as Bool: - return boolVal ? "true" : "false" - case let intVal as Int: - return String(intVal) - case let doubleVal as Double: - return String(doubleVal) - case let floatVal as Float: - return String(floatVal) - default: - return String(describing: self) - } - } -} - -extension JSONValue { - func cacheKeyComponentStringValue(keyPath: [String]? = nil) -> [String]? { - switch self { - case let strVal as String: - return [strVal] - case let boolVal as Bool: - return boolVal ? ["true"] : ["false"] - case let intVal as Int: - return [String(intVal)] - case let doubleVal as Double: - return [String(doubleVal)] - case let floatVal as Float: - return [String(floatVal)] - case let arrVal as [JSONValue]: - let values: [String] = arrVal.compactMap { $0.cacheKeyComponentStringValue()?.first } - guard !values.isEmpty else { return nil } - return values - case let objVal as JSONObject: - guard let keyPath, !keyPath.isEmpty else { return nil } - guard let targetValue = objVal.walk(path: keyPath[...]) else { return nil } - return targetValue.cacheKeyComponentStringValue() - default: - return [String(describing: self)] - } - } -} - -extension JSONObject { - fileprivate func walk( - path: ArraySlice - ) -> JSONValue? { - guard let head = path.first else { return self } - guard let next = self[head] else { return nil } - if path.count == 1 { return next } - if let nested = next as? JSONObject { - return nested.walk(path: path.dropFirst()) - } - return nil - } -} - -extension InputValue { - fileprivate func resolveValue(keyPath: [String]? = nil, variables: [String: (any GraphQLOperationVariableValue)]? = nil) -> [String]? { - switch self { - case .scalar(let scalar): - return [scalar.cacheKeyComponentStringValue] - case .variable(let varName): - guard let varValue = variables?[varName] else { - return nil - } - return varValue._jsonEncodableValue?._jsonValue.cacheKeyComponentStringValue(keyPath: keyPath) - case .list(let list): - if list.contains(where: { if case .list = $0 { return true } else { return false } }) { - return nil - } - let values = list.compactMap { $0.resolveValue()?.first } - guard !values.isEmpty else { return nil } - return values - case .object(let dict): - guard let keyPath, !keyPath.isEmpty else { return nil } - guard let targetValue = self.walk(dict: dict, path: keyPath[...]) else { return nil } - return targetValue.resolveValue() - default: - return nil - } - } - -// fileprivate func resolveScalar(_ scalar: any ScalarType) -> String? { -// switch scalar { -// case let strVal as String: -// return strVal -// case let boolVal as Bool: -// return boolVal ? "true" : "false" -// case let intVal as Int: -// return String(intVal) -// case let doubleVal as Double: -// return String(doubleVal) -// case let floatVal as Float: -// return String(floatVal) -// default: -// return String(describing: scalar) -// } -// } - - fileprivate func walk( - dict: [String: InputValue], - path: ArraySlice - ) -> InputValue? { - guard let head = path.first else { return .object(dict) } - guard let next = dict[head] else { return nil } - if path.count == 1 { return next } - if case .object(let nested) = next { - return walk(dict: nested, path: path.dropFirst()) - } - return nil - } -} - - diff --git a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift new file mode 100644 index 000000000..d5c56c6f4 --- /dev/null +++ b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift @@ -0,0 +1,195 @@ +import Foundation +import ApolloAPI + +struct FieldPolicyEvaluator { + let field: Selection.Field + let variables: GraphQLOperation.Variables? + + private var typename: String { + switch field.type.namedType { + case .object(let selectionSetType): + return selectionSetType.__parentType.__typename + default: + break + } + return "" + } + + init( + field: Selection.Field, + variables: GraphQLOperation.Variables? + ) { + self.field = field + self.variables = variables + } + + func resolveFieldPolicy() -> [AnyHashable]? { + guard let fieldPolicy = field.fieldPolicy, + let arguments = field.arguments else { + return nil + } + + struct ParsedKey { let name: String; let path: [String]? } + + let parsed: [ParsedKey] = fieldPolicy.keys.map { key in + if let dot = key.firstIndex(of: ".") { + let name = String(key[.. 1 { + listIndex = i + listValues = resolved + } else { + guard let value = resolved.first else { + return nil + } + fixedParts[i] = value + } + } + + if let idx = listIndex { + var keys: [String] = [] + keys.reserveCapacity(listValues.count) + for item in listValues { + var parts = [String]() + parts.reserveCapacity(parsed.count) + for j in 0.. [String]? { + switch self { + case let strVal as String: + return [strVal] + case let boolVal as Bool: + return boolVal ? ["true"] : ["false"] + case let intVal as Int: + return [String(intVal)] + case let doubleVal as Double: + return [String(doubleVal)] + case let floatVal as Float: + return [String(floatVal)] + case let arrVal as [JSONValue]: + let values: [String] = arrVal.compactMap { $0.cacheKeyComponentStringValue()?.first } + guard !values.isEmpty else { return nil } + return values + case let objVal as JSONObject: + guard let keyPath, !keyPath.isEmpty else { return nil } + guard let targetValue = objVal.walk(path: keyPath[...]) else { return nil } + return targetValue.cacheKeyComponentStringValue() + default: + return [String(describing: self)] + } + } +} + +extension JSONObject { + fileprivate func walk( + path: ArraySlice + ) -> JSONValue? { + guard let head = path.first else { return self } + guard let next = self[head] else { return nil } + if path.count == 1 { return next } + if let nested = next as? JSONObject { + return nested.walk(path: path.dropFirst()) + } + return nil + } +} + +extension InputValue { + fileprivate func resolveValue(keyPath: [String]? = nil, variables: [String: (any GraphQLOperationVariableValue)]? = nil) -> [String]? { + switch self { + case .scalar(let scalar): + return [scalar.cacheKeyComponentStringValue] + case .variable(let varName): + guard let varValue = variables?[varName] else { + return nil + } + return varValue._jsonEncodableValue?._jsonValue.cacheKeyComponentStringValue(keyPath: keyPath) + case .list(let list): + if list.contains(where: { if case .list = $0 { return true } else { return false } }) { + return nil + } + let values = list.compactMap { $0.resolveValue()?.first } + guard !values.isEmpty else { return nil } + return values + case .object(let dict): + guard let keyPath, !keyPath.isEmpty else { return nil } + guard let targetValue = self.walk(dict: dict, path: keyPath[...]) else { return nil } + return targetValue.resolveValue() + default: + return nil + } + } + + fileprivate func walk( + dict: [String: InputValue], + path: ArraySlice + ) -> InputValue? { + guard let head = path.first else { return .object(dict) } + guard let next = dict[head] else { return nil } + if path.count == 1 { return next } + if case .object(let nested) = next { + return walk(dict: nested, path: path.dropFirst()) + } + return nil + } +} From 990ab11c712603821e4428ebde96fac41c4d1989 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 25 Aug 2025 16:47:38 -0400 Subject: [PATCH 05/35] CHecking in progress --- .../Sources/Schema/SchemaConfiguration.swift | 8 +++ .../MockSchemaMetadata.swift | 48 ++++++++++++++++++ Tests/ApolloTests/ResponsePathTests.swift | 1 + Tests/ApolloTests/TestMockTests.swift | 8 +++ .../FileGenerators/FileGenerator.swift | 4 ++ .../SchemaConfigurationFileGenerator.swift | 34 +++++++++++++ .../SchemaConfigurationTemplate.swift | 10 ++++ .../CacheDataExecutionSource.swift | 50 ++++++++++++++++--- .../Sources/Apollo/FieldPolicyEvaluator.swift | 25 ++++------ .../{Apollo => ApolloAPI}/ResponsePath.swift | 0 .../ApolloAPI/SchemaConfiguration.swift | 9 ++++ 11 files changed, 174 insertions(+), 23 deletions(-) rename apollo-ios/Sources/{Apollo => ApolloAPI}/ResponsePath.swift (100%) diff --git a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift index 7976ecf82..51c9dfb2b 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift @@ -12,4 +12,12 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } + + public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { + return nil + } + + public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + return nil + } } diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index 2d5534f1e..e119eef41 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -39,6 +39,26 @@ public class MockSchemaMetadata: SchemaMetadata { testObserver.start() } } + + @MainActor + public static func stub_cacheKeyForField_SingleReturn( + _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? + ) { + _configuration.stub_cacheKeyForField_SingleReturn = stub + if stub != nil { + testObserver.start() + } + } + + @MainActor + public static func stub_cacheKeyForField_ListReturn( + _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? + ) { + _configuration.stub_cacheKeyForField_ListReturn = stub + if stub != nil { + testObserver.start() + } + } public static func objectType(forTypename __typename: String) -> Object? { if let stub = objectTypeForTypeName { @@ -50,10 +70,22 @@ public class MockSchemaMetadata: SchemaMetadata { public class SchemaConfiguration: ApolloAPI.SchemaConfiguration { static var stub_cacheKeyInfoForType_Object: ((Object, ObjectData) -> CacheKeyInfo?)? + + static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? + + static var stub_cacheKeyForField_ListReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { stub_cacheKeyInfoForType_Object?(type, object) } + + public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { + stub_cacheKeyForField_SingleReturn?(field, variables, path) + } + + public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + stub_cacheKeyForField_ListReturn?(field, variables, path) + } } } @@ -102,6 +134,14 @@ public enum MockSchema1Configuration: SchemaConfiguration { public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { CacheKeyInfo(id: "one") } + + public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { + return nil + } + + public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + return nil + } } public enum MockSchema2: SchemaMetadata { @@ -116,4 +156,12 @@ public enum MockSchema2Configuration: SchemaConfiguration { public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { CacheKeyInfo(id: "two") } + + public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { + return nil + } + + public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + return nil + } } diff --git a/Tests/ApolloTests/ResponsePathTests.swift b/Tests/ApolloTests/ResponsePathTests.swift index f767b0dd6..677b16dcb 100644 --- a/Tests/ApolloTests/ResponsePathTests.swift +++ b/Tests/ApolloTests/ResponsePathTests.swift @@ -1,5 +1,6 @@ import XCTest @testable import Apollo +import ApolloAPI import Nimble class ResponsePathTests: XCTestCase { diff --git a/Tests/ApolloTests/TestMockTests.swift b/Tests/ApolloTests/TestMockTests.swift index c5bc55d15..54c905cfc 100644 --- a/Tests/ApolloTests/TestMockTests.swift +++ b/Tests/ApolloTests/TestMockTests.swift @@ -561,6 +561,14 @@ enum TestMockSchema: SchemaMetadata { static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { return nil } + + static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { + return nil + } + + static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + return nil + } } struct Interfaces { diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift index 763d2cc02..a69094914 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift @@ -53,6 +53,10 @@ extension FileGenerator { data: rendered.data(using: .utf8), overwrite: self.overwrite ) + + if let _ = self as? SchemaConfigurationFileGenerator { + print("Running default 'generate' for Schema Configuration") + } return errors } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift index 8baa7f9ee..0c176e7b9 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift @@ -10,4 +10,38 @@ struct SchemaConfigurationFileGenerator: FileGenerator { var overwrite: Bool { false } var target: FileTarget { .schema } var fileName: String { "SchemaConfiguration" } + + // Field Policy Handling + let singleValueRegex = #""" + (?s)\b(?:public|internal|fileprivate|private)?\s* + (?:static\s+)?func\s+cacheKey\s* + \(\s*for\s+field\s*:\s*Selection\.Field\s*,\s* + variables\s*:\s*GraphQLOperation\.Variables\?\s*,\s* + path\s*:\s*ResponsePath\s*\)\s* + (?:async\s+throws|throws\s+async|async|throws)?\s* + ->\s*(?:\w+\.)?CacheKeyInfo\?\s*\{ + """# + + let listValueRegex = #""" + (?s)\b(?:public|internal|fileprivate|private)?\s* + (?:static\s+)?func\s+cacheKeys\s* + \(\s*for\s+field\s*:\s*Selection\.Field\s*,\s* + variables\s*:\s*GraphQLOperation\.Variables\?\s*,\s* + path\s*:\s*ResponsePath\s*\)\s* + (?:async\s+throws|throws\s+async|async|throws)?\s* + ->\s*\[\s*(?:\w+\.)?CacheKeyInfo\s*\]\?\s*\{ + """# + + func appendFunctions(to filePath: String) throws { + var src = try String(contentsOfFile: filePath, encoding: .utf8) + if src.isEmpty { return } + + + } + + private func insertFunction(in src: String, regex: String, funcDecl: String) { + if !src.contains(Regex(regex)) { + g + } + } } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift index a95bd345e..b9a3b6e44 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift @@ -30,6 +30,16 @@ struct SchemaConfigurationTemplate: TemplateRenderer { return nil } } + + static func cacheKey(for field: \(config.ApolloAPITargetName).Selection.Field, variables: \(config.ApolloAPITargetName).GraphQLOperation.Variables?, path: \(config.ApolloAPITargetName).ResponsePath) -> \(config.ApolloAPITargetName).CacheKeyInfo? { + // Implement this function to configure cache key resolution for fields that return a single object/value + return nil + } + + static func cacheKeys(for field: \(config.ApolloAPITargetName).Selection.Field, variables: \(config.ApolloAPITargetName).GraphQLOperation.Variables?, path: \(config.ApolloAPITargetName).ResponsePath) -> [\(config.ApolloAPITargetName).CacheKeyInfo]? { + // Implement this function to configure cache key resolution for fields that return a list of objects/values + return nil + } """ } diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 8e41a07b3..6745f5ec6 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -73,21 +73,55 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, on object: Record ) throws -> AnyHashable? { - // TODO: Add call to new SchemaConfiguration method for programmatic field policy - // TODO: Revisit to determine what data we want to expose to pass to SchemaConfiguration - if let keys = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables).resolveFieldPolicy() { - if keys.count > 1 { - return keys.compactMap { $0 as? CacheKey }.map { object[$0] } - } else if let key = keys.first as? CacheKey { - return object[key] + let fieldTypename = typename(for: info.field) + + // Programmatic field policy checks + switch info.field.type { + case .nonNull(let innerType): + if case .list(_) = innerType.namedType { + if let cacheKeys = info.parentInfo.schema.configuration.cacheKeys(for: info.field, variables: info.parentInfo.variables, path: info.responsePath) { + return cacheKeys.map { "\($0.uniqueKeyGroup ?? fieldTypename):\($0.id)" }.map { object[$0] } + } + } + else { + if let cacheKey = info.parentInfo.schema.configuration.cacheKey(for: info.field, variables: info.parentInfo.variables, path: info.responsePath) { + return object["\(cacheKey.uniqueKeyGroup ?? fieldTypename):\(cacheKey.id)"] + } + } + case .list(_): + if let cacheKeys = info.parentInfo.schema.configuration.cacheKeys(for: info.field, variables: info.parentInfo.variables, path: info.responsePath) { + return cacheKeys.map { "\($0.uniqueKeyGroup ?? fieldTypename):\($0.id)" }.map { object[$0] } + } + default: + if let cacheKey = info.parentInfo.schema.configuration.cacheKey(for: info.field, variables: info.parentInfo.variables, path: info.responsePath) { + return object["\(cacheKey.uniqueKeyGroup ?? fieldTypename):\(cacheKey.id)"] + } + } + + // Directive based field policy checks + if let fieldPolicyResult = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables).resolveFieldPolicy() { + switch fieldPolicyResult { + case .single(let key): + return object["\(key.uniqueKeyGroup ?? fieldTypename):\(key.id)"] + case .list(let keys): + return keys.map { object["\($0.uniqueKeyGroup ?? fieldTypename):\($0.id)"] } } - return nil } let key = try info.cacheKeyForField() return object[key] } + + private func typename(for field: Selection.Field) -> String { + switch field.type.namedType { + case .object(let selectionSetType): + return selectionSetType.__parentType.__typename + default: + break + } + return "" + } private func deferredResolve(reference: CacheReference) -> PossiblyDeferred { guard let transaction else { diff --git a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift index d5c56c6f4..984f841fa 100644 --- a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift +++ b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift @@ -1,20 +1,15 @@ import Foundation import ApolloAPI +enum FieldPolicyResult { + case single(CacheKeyInfo) + case list([CacheKeyInfo]) +} + struct FieldPolicyEvaluator { let field: Selection.Field let variables: GraphQLOperation.Variables? - private var typename: String { - switch field.type.namedType { - case .object(let selectionSetType): - return selectionSetType.__parentType.__typename - default: - break - } - return "" - } - init( field: Selection.Field, variables: GraphQLOperation.Variables? @@ -23,7 +18,7 @@ struct FieldPolicyEvaluator { self.variables = variables } - func resolveFieldPolicy() -> [AnyHashable]? { + func resolveFieldPolicy() -> FieldPolicyResult? { guard let fieldPolicy = field.fieldPolicy, let arguments = field.arguments else { return nil @@ -66,7 +61,7 @@ struct FieldPolicyEvaluator { } if let idx = listIndex { - var keys: [String] = [] + var keys: [CacheKeyInfo] = [] keys.reserveCapacity(listValues.count) for item in listValues { var parts = [String]() @@ -80,15 +75,15 @@ struct FieldPolicyEvaluator { return nil } } - keys.append("\(typename):\(parts.joined(separator: "+"))") + keys.append(CacheKeyInfo(id: parts.joined(separator: "+"))) } - return keys + return .list(keys) } else { let parts = fixedParts.compactMap { $0 } guard parts.count == parsed.count else { return nil } - return ["\(typename):\(parts.joined(separator: "+"))"] + return .single(CacheKeyInfo(id: parts.joined(separator: "+"))) } } diff --git a/apollo-ios/Sources/Apollo/ResponsePath.swift b/apollo-ios/Sources/ApolloAPI/ResponsePath.swift similarity index 100% rename from apollo-ios/Sources/Apollo/ResponsePath.swift rename to apollo-ios/Sources/ApolloAPI/ResponsePath.swift diff --git a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift index b0c9473f7..b2f9fdd92 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift @@ -40,4 +40,13 @@ public protocol SchemaConfiguration { /// - Returns: A ``CacheKeyInfo`` describing the computed cache key for the response object. static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? + /// The entry point for resolving cache keys to read objects from the `NormalizedCache` when executing an operation, + /// prior to attempting to fetch data from the network. + /// + /// The default generated implementation always returns `nil`, disabling all cache normalization. + /// + /// This function returns an array containing 1 or more cache key strings depending on the return type of the given field. + static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? + + static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? } From 5c71da2938fef00e5032e72015950f6283168407 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Tue, 26 Aug 2025 12:20:18 -0400 Subject: [PATCH 06/35] Finishing SchemaConfigurationFIleGenerator updates --- .../Sources/Schema/SchemaConfiguration.swift | 12 +++++ .../Sources/Schema/SchemaConfiguration.swift | 12 +++++ .../Sources/Schema/SchemaConfiguration.swift | 12 +++++ .../Sources/Schema/SchemaConfiguration.swift | 12 +++++ .../Sources/Schema/SchemaConfiguration.swift | 12 +++++ .../FileGenerators/FileGenerator.swift | 4 +- .../SchemaConfigurationFileGenerator.swift | 53 +++++++++++++++++-- 7 files changed, 111 insertions(+), 6 deletions(-) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaConfiguration.swift index b446d8f9a..24940bfe8 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaConfiguration.swift @@ -15,4 +15,16 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } + + + static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { + // Implement this function to configure cache key resolution for fields that return a single object/value + return nil + } + + + static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + // Implement this function to configure cache key resolution for fields that return a list of objects/values + return nil + } } diff --git a/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaConfiguration.swift index 7976ecf82..e31bde815 100644 --- a/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaConfiguration.swift @@ -12,4 +12,16 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } + + + static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { + // Implement this function to configure cache key resolution for fields that return a single object/value + return nil + } + + + static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + // Implement this function to configure cache key resolution for fields that return a list of objects/values + return nil + } } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift index 7976ecf82..e31bde815 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift @@ -12,4 +12,16 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } + + + static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { + // Implement this function to configure cache key resolution for fields that return a single object/value + return nil + } + + + static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + // Implement this function to configure cache key resolution for fields that return a list of objects/values + return nil + } } diff --git a/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaConfiguration.swift index 7976ecf82..e31bde815 100644 --- a/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaConfiguration.swift @@ -12,4 +12,16 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } + + + static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { + // Implement this function to configure cache key resolution for fields that return a single object/value + return nil + } + + + static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + // Implement this function to configure cache key resolution for fields that return a list of objects/values + return nil + } } diff --git a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift index 51c9dfb2b..1b48d888a 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift @@ -20,4 +20,16 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { return nil } + + + static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { + // Implement this function to configure cache key resolution for fields that return a single object/value + return nil + } + + + static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + // Implement this function to configure cache key resolution for fields that return a list of objects/values + return nil + } } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift index a69094914..490a11c63 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift @@ -54,8 +54,8 @@ extension FileGenerator { overwrite: self.overwrite ) - if let _ = self as? SchemaConfigurationFileGenerator { - print("Running default 'generate' for Schema Configuration") + if let schemaConfigGenerator = self as? SchemaConfigurationFileGenerator { + try await schemaConfigGenerator.appendFunctions(to: filePath) } return errors diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift index 0c176e7b9..5b3504239 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift @@ -1,5 +1,6 @@ import Foundation import OrderedCollections +import TemplateString /// Generates a file containing schema metadata used by the GraphQL executor at runtime. struct SchemaConfigurationFileGenerator: FileGenerator { @@ -22,6 +23,15 @@ struct SchemaConfigurationFileGenerator: FileGenerator { ->\s*(?:\w+\.)?CacheKeyInfo\?\s*\{ """# + var singleValueFunc: TemplateString { + """ + static func cacheKey(for field: \(config.ApolloAPITargetName).Selection.Field, variables: \(config.ApolloAPITargetName).GraphQLOperation.Variables?, path: \(config.ApolloAPITargetName).ResponsePath) -> \(config.ApolloAPITargetName).CacheKeyInfo? { + // Implement this function to configure cache key resolution for fields that return a single object/value + return nil + } + """ + } + let listValueRegex = #""" (?s)\b(?:public|internal|fileprivate|private)?\s* (?:static\s+)?func\s+cacheKeys\s* @@ -32,16 +42,51 @@ struct SchemaConfigurationFileGenerator: FileGenerator { ->\s*\[\s*(?:\w+\.)?CacheKeyInfo\s*\]\?\s*\{ """# - func appendFunctions(to filePath: String) throws { + var listValueFunc: TemplateString { + """ + static func cacheKeys(for field: \(config.ApolloAPITargetName).Selection.Field, variables: \(config.ApolloAPITargetName).GraphQLOperation.Variables?, path: \(config.ApolloAPITargetName).ResponsePath) -> [\(config.ApolloAPITargetName).CacheKeyInfo]? { + // Implement this function to configure cache key resolution for fields that return a list of objects/values + return nil + } + """ + } + + func appendFunctions(to filePath: String) async throws { var src = try String(contentsOfFile: filePath, encoding: .utf8) if src.isEmpty { return } + insertFunction(in: &src, regex: singleValueRegex, funcDecl: singleValueFunc) + insertFunction(in: &src, regex: listValueRegex, funcDecl: listValueFunc) + try src.write(toFile: filePath, atomically: true, encoding: .utf8) } - private func insertFunction(in src: String, regex: String, funcDecl: String) { - if !src.contains(Regex(regex)) { - g + private func insertFunction(in src: inout String, regex: String, funcDecl: TemplateString) { +// if !src.contains(Regex(regex)), +// let enumDefRange = src.range(of: "enum SchemaConfiguration"), +// let closeBraceIndex = src[enumDefRange.lowerBound...].lastIndex(of: "}") { +// src.insert(contentsOf: "\n\n\(funcDecl)\n", at: closeBraceIndex) +// } + if !src.containsRegex(regex), + let enumDefRange = src.range(of: "enum SchemaConfiguration"), + let closeBraceIndex = src[enumDefRange.lowerBound...].lastIndex(of: "}") { + src.insert(contentsOf: "\n\n\(funcDecl)\n", at: closeBraceIndex) + } + } + +} + +extension String { + fileprivate func containsRegex(_ regex: String) -> Bool { + do { + let reg = try NSRegularExpression( + pattern: regex, + options: [] + ) + let range = NSRange(self.startIndex.. Date: Tue, 26 Aug 2025 12:42:34 -0400 Subject: [PATCH 07/35] Minor edit --- .../FileGenerators/SchemaConfigurationFileGenerator.swift | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift index 5b3504239..4927f0945 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift @@ -62,11 +62,6 @@ struct SchemaConfigurationFileGenerator: FileGenerator { } private func insertFunction(in src: inout String, regex: String, funcDecl: TemplateString) { -// if !src.contains(Regex(regex)), -// let enumDefRange = src.range(of: "enum SchemaConfiguration"), -// let closeBraceIndex = src[enumDefRange.lowerBound...].lastIndex(of: "}") { -// src.insert(contentsOf: "\n\n\(funcDecl)\n", at: closeBraceIndex) -// } if !src.containsRegex(regex), let enumDefRange = src.range(of: "enum SchemaConfiguration"), let closeBraceIndex = src[enumDefRange.lowerBound...].lastIndex(of: "}") { From e0e2760d719ac913c4c3bac26612204deaf9c2ff Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Wed, 27 Aug 2025 12:23:39 -0400 Subject: [PATCH 08/35] Addressing feedback and code cleanup --- .../Sources/Schema/SchemaConfiguration.swift | 12 - .../AnimalSchema.graphqls | 2 +- .../Sources/Schema/SchemaConfiguration.swift | 12 - .../Sources/Schema/SchemaConfiguration.swift | 12 - .../Sources/Schema/SchemaConfiguration.swift | 12 - .../Sources/Schema/SchemaConfiguration.swift | 20 - .../MockSchemaMetadata.swift | 2 +- .../ApolloTests/Cache/FieldPolicyTests.swift | 89 +- apollo-ios-codegen/.gitignore | 2 + .../FileGenerators/FileGenerator.swift | 4 - .../SchemaConfigurationFileGenerator.swift | 72 - .../Templates/SelectionSetTemplate.swift | 2 +- .../GraphQLCompiler/CompilationResult.swift | 5 +- .../JavaScript/coverage/clover.xml | 615 ------ .../JavaScript/coverage/coverage-final.json | 14 - .../JavaScript/coverage/lcov-report/base.css | 224 --- .../coverage/lcov-report/block-navigation.js | 87 - .../coverage/lcov-report/favicon.png | Bin 445 -> 0 bytes .../coverage/lcov-report/index.html | 146 -- .../coverage/lcov-report/prettify.css | 1 - .../coverage/lcov-report/prettify.js | 2 - .../lcov-report/sort-arrow-sprite.png | Bin 138 -> 0 bytes .../JavaScript/coverage/lcov-report/sorter.js | 196 -- .../lcov-report/src/compiler/index.html | 131 -- .../lcov-report/src/compiler/index.ts.html | 1720 ----------------- .../lcov-report/src/compiler/values.ts.html | 229 --- .../coverage/lcov-report/src/index.html | 131 -- .../coverage/lcov-report/src/index.ts.html | 463 ----- .../apolloCodegenSchemaExtension.ts.html | 334 ---- .../experimentalDeferDirective.ts.html | 391 ---- .../utilities/fieldPolicyDirective.ts.html | 709 ------- .../lcov-report/src/utilities/graphql.ts.html | 640 ------ .../lcov-report/src/utilities/index.html | 236 --- .../lcov-report/src/utilities/index.ts.html | 97 - .../legacySafelistingTransform.ts.html | 247 --- .../src/utilities/nodeHelpers.ts.html | 232 --- .../src/utilities/predicates.ts.html | 127 -- .../src/utilities/typePolicyDirective.ts.html | 616 ------ .../lcov-report/src/validationRules.ts.html | 547 ------ .../JavaScript/coverage/lcov.info | 1346 ------------- .../JavaScript/package-lock.json | 1134 ++++++----- .../src/utilities/fieldPolicyDirective.ts | 18 +- apollo-ios-codegen/Sources/IR/IR+Fields.swift | 2 + .../CacheDataExecutionSource.swift | 80 +- .../Sources/Apollo/FieldPolicyEvaluator.swift | 135 +- .../ApolloAPI/FieldPolicyProvider.swift | 11 + .../ApolloAPI/SchemaConfiguration.swift | 10 - apollo-ios/Sources/ApolloAPI/Selection.swift | 6 +- 48 files changed, 886 insertions(+), 10237 deletions(-) delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/clover.xml delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/coverage-final.json delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/base.css delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/block-navigation.js delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/favicon.png delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/index.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.css delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.js delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sort-arrow-sprite.png delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sorter.js delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/values.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/apolloCodegenSchemaExtension.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/experimentalDeferDirective.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/fieldPolicyDirective.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/graphql.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/legacySafelistingTransform.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/nodeHelpers.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/predicates.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/typePolicyDirective.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/validationRules.ts.html delete mode 100644 apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov.info create mode 100644 apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaConfiguration.swift index 24940bfe8..b446d8f9a 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Sources/Schema/SchemaConfiguration.swift @@ -15,16 +15,4 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } - - - static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { - // Implement this function to configure cache key resolution for fields that return a single object/value - return nil - } - - - static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - // Implement this function to configure cache key resolution for fields that return a list of objects/values - return nil - } } diff --git a/Sources/AnimalKingdomAPI/animalkingdom-graphql/AnimalSchema.graphqls b/Sources/AnimalKingdomAPI/animalkingdom-graphql/AnimalSchema.graphqls index 25acde888..b2fc323c8 100644 --- a/Sources/AnimalKingdomAPI/animalkingdom-graphql/AnimalSchema.graphqls +++ b/Sources/AnimalKingdomAPI/animalkingdom-graphql/AnimalSchema.graphqls @@ -1,5 +1,5 @@ type Query { - allAnimals(species: String): [Animal!]! + allAnimals: [Animal!]! classroomPets: [ClassroomPet] pets(filters: PetSearchFilters!): [Pet!]! findPet(input: PetSearchInput!): [Pet!]! diff --git a/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaConfiguration.swift index e31bde815..7976ecf82 100644 --- a/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/GitHubAPI/GitHubAPI/Sources/Schema/SchemaConfiguration.swift @@ -12,16 +12,4 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } - - - static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { - // Implement this function to configure cache key resolution for fields that return a single object/value - return nil - } - - - static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - // Implement this function to configure cache key resolution for fields that return a list of objects/values - return nil - } } diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift index e31bde815..7976ecf82 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift @@ -12,16 +12,4 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } - - - static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { - // Implement this function to configure cache key resolution for fields that return a single object/value - return nil - } - - - static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - // Implement this function to configure cache key resolution for fields that return a list of objects/values - return nil - } } diff --git a/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaConfiguration.swift index e31bde815..7976ecf82 100644 --- a/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/SubscriptionAPI/SubscriptionAPI/Sources/Schema/SchemaConfiguration.swift @@ -12,16 +12,4 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } - - - static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { - // Implement this function to configure cache key resolution for fields that return a single object/value - return nil - } - - - static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - // Implement this function to configure cache key resolution for fields that return a list of objects/values - return nil - } } diff --git a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift index 1b48d888a..7976ecf82 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift @@ -12,24 +12,4 @@ public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { // Implement this function to configure cache key resolution for your schema types. return nil } - - public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { - return nil - } - - public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { - return nil - } - - - static func cacheKey(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { - // Implement this function to configure cache key resolution for fields that return a single object/value - return nil - } - - - static func cacheKeys(for field: ApolloAPI.Selection.Field, variables: ApolloAPI.GraphQLOperation.Variables?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - // Implement this function to configure cache key resolution for fields that return a list of objects/values - return nil - } } diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index e119eef41..dce9a7bb9 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -68,7 +68,7 @@ public class MockSchemaMetadata: SchemaMetadata { return Object(typename: __typename, implementedInterfaces: []) } - public class SchemaConfiguration: ApolloAPI.SchemaConfiguration { + public class SchemaConfiguration: ApolloAPI.SchemaConfiguration, ApolloAPI.FieldPolicyProvider { static var stub_cacheKeyInfoForType_Object: ((Object, ObjectData) -> CacheKeyInfo?)? static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? diff --git a/Tests/ApolloTests/Cache/FieldPolicyTests.swift b/Tests/ApolloTests/Cache/FieldPolicyTests.swift index 3ce325f47..d9910aa01 100644 --- a/Tests/ApolloTests/Cache/FieldPolicyTests.swift +++ b/Tests/ApolloTests/Cache/FieldPolicyTests.swift @@ -3,6 +3,7 @@ import XCTest import ApolloAPI import ApolloInternalTestHelpers +@MainActor final class FieldPolicyTests: XCTestCase, CacheDependentTesting { var cacheType: any TestCacheProvider.Type { @@ -40,7 +41,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { func test_fieldPolicy_withStringKeyArgument_resolvesCorrectCacheKey() throws { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["name": .variable("name")], fieldPolicy: .init(keys: ["name"])) + .field("hero", Hero.self, arguments: ["name": .variable("name")], fieldPolicy: .init(keyArgs: ["name"])) ]} class Hero: MockSelectionSet { @@ -94,7 +95,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { func test_fieldPolicy_withIntKeyArgument_resolvesCorrectCacheKey() throws { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["age": .variable("age")], fieldPolicy: .init(keys: ["age"])) + .field("hero", Hero.self, arguments: ["age": .variable("age")], fieldPolicy: .init(keyArgs: ["age"])) ]} class Hero: MockSelectionSet { @@ -148,7 +149,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { func test_fieldPolicy_withDoubleKeyArgument_resolvesCorrectCacheKey() throws { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["weight": .variable("weight")], fieldPolicy: .init(keys: ["weight"])) + .field("hero", Hero.self, arguments: ["weight": .variable("weight")], fieldPolicy: .init(keyArgs: ["weight"])) ]} class Hero: MockSelectionSet { @@ -202,7 +203,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { func test_fieldPolicy_withBoolKeyArgument_resolvesCorrectCacheKey() throws { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["isJedi": .variable("isJedi")], fieldPolicy: .init(keys: ["isJedi"])) + .field("hero", Hero.self, arguments: ["isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["isJedi"])) ]} class Hero: MockSelectionSet { @@ -256,7 +257,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { func test_fieldPolicy_withListKeyArgument_resolvesCorrectCacheKey() throws { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["names": .variable("names")], fieldPolicy: .init(keys: ["names"])) + .field("heroes", [Hero].self, arguments: ["names": .variable("names")], fieldPolicy: .init(keyArgs: ["names"])) ]} var heroes: [Hero] { __data["heroes"] } @@ -359,7 +360,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.name"])) + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name"])) ]} class Hero: MockSelectionSet { @@ -451,7 +452,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.nameInput.name"])) + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name"])) ]} class Hero: MockSelectionSet { @@ -543,7 +544,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.nameInput.names"])) + .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names"])) ]} var heroes: [Hero] { __data["heroes"] } @@ -629,7 +630,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { func test_fieldPolicy_withMultipleKeyArguments_resolvesCorrectCacheKey() { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keys: ["name", "age"])) + .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["name", "age"])) ]} class Hero: MockSelectionSet { @@ -683,7 +684,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { func test_fieldPolicy_withMultipleKeyArguments_withDifferentOrder_resolvesCorrectCacheKey() { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keys: ["age", "name"])) + .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["age", "name"])) ]} class Hero: MockSelectionSet { @@ -737,7 +738,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { func test_fieldPolicy_withMultipleKeyArguments_includingList_resolvesCorrectCacheKey() { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["names": .variable("names"), "isJedi": .variable("isJedi")], fieldPolicy: .init(keys: ["names", "isJedi"])) + .field("heroes", [Hero].self, arguments: ["names": .variable("names"), "isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["names", "isJedi"])) ]} var heroes: [Hero] { __data["heroes"] } @@ -849,7 +850,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.name", "input.isJedi"])) + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name", "input.isJedi"])) ]} class Hero: MockSelectionSet { @@ -952,7 +953,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.nameInput.name", "input.isJedi"])) + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name", "input.isJedi"])) ]} class Hero: MockSelectionSet { @@ -1053,7 +1054,7 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { class HeroSelectionSet: MockSelectionSet { override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keys: ["input.nameInput.names", "input.isJedi"])) + .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names", "input.isJedi"])) ]} var heroes: [Hero] { __data["heroes"] } @@ -1134,4 +1135,64 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) } + // MARK: - FieldPolicyProvider Tests + + func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name")]) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + MockSchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in + return CacheKeyInfo(id: "Hero:Luke") + } + + let query = MockQuery() + query.__variables = ["name": "Luke"] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + } diff --git a/apollo-ios-codegen/.gitignore b/apollo-ios-codegen/.gitignore index 130007eea..0f43df261 100644 --- a/apollo-ios-codegen/.gitignore +++ b/apollo-ios-codegen/.gitignore @@ -87,3 +87,5 @@ Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Sou !Tests/TestCodeGenConfigurations/**/SchemaConfiguration.swift !Tests/TestCodeGenConfigurations/Other-CustomTarget/AnimalKingdomAPI/AnimalKingdomAPI.h !Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Sources/PackageTwo/PackageTwo.swift + +Sources/GraphQLCompiler/JavaScript/coverage/ \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift index 490a11c63..763d2cc02 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/FileGenerator.swift @@ -53,10 +53,6 @@ extension FileGenerator { data: rendered.data(using: .utf8), overwrite: self.overwrite ) - - if let schemaConfigGenerator = self as? SchemaConfigurationFileGenerator { - try await schemaConfigGenerator.appendFunctions(to: filePath) - } return errors } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift index 4927f0945..5fb6daa62 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift @@ -12,76 +12,4 @@ struct SchemaConfigurationFileGenerator: FileGenerator { var target: FileTarget { .schema } var fileName: String { "SchemaConfiguration" } - // Field Policy Handling - let singleValueRegex = #""" - (?s)\b(?:public|internal|fileprivate|private)?\s* - (?:static\s+)?func\s+cacheKey\s* - \(\s*for\s+field\s*:\s*Selection\.Field\s*,\s* - variables\s*:\s*GraphQLOperation\.Variables\?\s*,\s* - path\s*:\s*ResponsePath\s*\)\s* - (?:async\s+throws|throws\s+async|async|throws)?\s* - ->\s*(?:\w+\.)?CacheKeyInfo\?\s*\{ - """# - - var singleValueFunc: TemplateString { - """ - static func cacheKey(for field: \(config.ApolloAPITargetName).Selection.Field, variables: \(config.ApolloAPITargetName).GraphQLOperation.Variables?, path: \(config.ApolloAPITargetName).ResponsePath) -> \(config.ApolloAPITargetName).CacheKeyInfo? { - // Implement this function to configure cache key resolution for fields that return a single object/value - return nil - } - """ - } - - let listValueRegex = #""" - (?s)\b(?:public|internal|fileprivate|private)?\s* - (?:static\s+)?func\s+cacheKeys\s* - \(\s*for\s+field\s*:\s*Selection\.Field\s*,\s* - variables\s*:\s*GraphQLOperation\.Variables\?\s*,\s* - path\s*:\s*ResponsePath\s*\)\s* - (?:async\s+throws|throws\s+async|async|throws)?\s* - ->\s*\[\s*(?:\w+\.)?CacheKeyInfo\s*\]\?\s*\{ - """# - - var listValueFunc: TemplateString { - """ - static func cacheKeys(for field: \(config.ApolloAPITargetName).Selection.Field, variables: \(config.ApolloAPITargetName).GraphQLOperation.Variables?, path: \(config.ApolloAPITargetName).ResponsePath) -> [\(config.ApolloAPITargetName).CacheKeyInfo]? { - // Implement this function to configure cache key resolution for fields that return a list of objects/values - return nil - } - """ - } - - func appendFunctions(to filePath: String) async throws { - var src = try String(contentsOfFile: filePath, encoding: .utf8) - if src.isEmpty { return } - - insertFunction(in: &src, regex: singleValueRegex, funcDecl: singleValueFunc) - insertFunction(in: &src, regex: listValueRegex, funcDecl: listValueFunc) - - try src.write(toFile: filePath, atomically: true, encoding: .utf8) - } - - private func insertFunction(in src: inout String, regex: String, funcDecl: TemplateString) { - if !src.containsRegex(regex), - let enumDefRange = src.range(of: "enum SchemaConfiguration"), - let closeBraceIndex = src[enumDefRange.lowerBound...].lastIndex(of: "}") { - src.insert(contentsOf: "\n\n\(funcDecl)\n", at: closeBraceIndex) - } - } - -} - -extension String { - fileprivate func containsRegex(_ regex: String) -> Bool { - do { - let reg = try NSRegularExpression( - pattern: regex, - options: [] - ) - let range = NSRange(self.startIndex.. Self { - let name = jsValue["name"] as String - let fieldPolicy = jsValue["fieldPolicyKeys"] - + static func fromJSValue(_ jsValue: JSValue, bridge: isolated JavaScriptBridge) -> Self { return self.init( name: jsValue["name"], alias: jsValue["alias"], diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/clover.xml b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/clover.xml deleted file mode 100644 index fbf1e2c94..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/clover.xml +++ /dev/null @@ -1,615 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/coverage-final.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/coverage-final.json deleted file mode 100644 index f64ce1a2a..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/coverage-final.json +++ /dev/null @@ -1,14 +0,0 @@ -{"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/index.ts","statementMap":{"0":{"start":{"line":42,"column":0},"end":{"line":42,"column":16}},"1":{"start":{"line":98,"column":0},"end":{"line":98,"column":16}},"2":{"start":{"line":102,"column":0},"end":{"line":102,"column":16}},"3":{"start":{"line":106,"column":0},"end":{"line":106,"column":16}},"4":{"start":{"line":110,"column":0},"end":{"line":110,"column":16}},"5":{"start":{"line":118,"column":0},"end":{"line":118,"column":16}},"6":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":78}},"8":{"start":{"line":15,"column":0},"end":{"line":15,"column":60}},"9":{"start":{"line":16,"column":0},"end":{"line":16,"column":72}},"10":{"start":{"line":17,"column":0},"end":{"line":17,"column":null}},"11":{"start":{"line":20,"column":0},"end":{"line":20,"column":null}},"12":{"start":{"line":24,"column":0},"end":{"line":24,"column":82}},"13":{"start":{"line":25,"column":0},"end":{"line":25,"column":84}},"14":{"start":{"line":29,"column":0},"end":{"line":29,"column":null}},"15":{"start":{"line":30,"column":2},"end":{"line":30,"column":null}},"16":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}},"17":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}},"18":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}},"19":{"start":{"line":34,"column":2},"end":{"line":34,"column":null}},"20":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}},"21":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}},"22":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}},"23":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}},"24":{"start":{"line":40,"column":0},"end":{"line":40,"column":9}},"25":{"start":{"line":40,"column":9},"end":{"line":40,"column":67}},"26":{"start":{"line":45,"column":18},"end":{"line":45,"column":43}},"27":{"start":{"line":46,"column":2},"end":{"line":57,"column":3}},"28":{"start":{"line":47,"column":4},"end":{"line":56,"column":5}},"29":{"start":{"line":48,"column":6},"end":{"line":53,"column":7}},"30":{"start":{"line":49,"column":8},"end":{"line":49,"column":null}},"31":{"start":{"line":51,"column":8},"end":{"line":52,"column":null}},"32":{"start":{"line":55,"column":6},"end":{"line":55,"column":null}},"33":{"start":{"line":59,"column":17},"end":{"line":59,"column":80}},"34":{"start":{"line":61,"column":2},"end":{"line":81,"column":3}},"35":{"start":{"line":62,"column":4},"end":{"line":62,"column":null}},"36":{"start":{"line":63,"column":4},"end":{"line":63,"column":null}},"37":{"start":{"line":65,"column":19},"end":{"line":65,"column":88}},"38":{"start":{"line":66,"column":4},"end":{"line":66,"column":null}},"39":{"start":{"line":67,"column":4},"end":{"line":67,"column":null}},"40":{"start":{"line":68,"column":4},"end":{"line":68,"column":null}},"41":{"start":{"line":70,"column":4},"end":{"line":70,"column":null}},"42":{"start":{"line":73,"column":17},"end":{"line":73,"column":80}},"43":{"start":{"line":74,"column":4},"end":{"line":74,"column":null}},"44":{"start":{"line":75,"column":4},"end":{"line":75,"column":null}},"45":{"start":{"line":76,"column":4},"end":{"line":76,"column":null}},"46":{"start":{"line":77,"column":4},"end":{"line":77,"column":null}},"47":{"start":{"line":78,"column":4},"end":{"line":78,"column":null}},"48":{"start":{"line":80,"column":4},"end":{"line":80,"column":null}},"49":{"start":{"line":87,"column":16},"end":{"line":87,"column":47}},"50":{"start":{"line":89,"column":2},"end":{"line":91,"column":3}},"51":{"start":{"line":90,"column":4},"end":{"line":90,"column":27}},"52":{"start":{"line":93,"column":17},"end":{"line":93,"column":43}},"53":{"start":{"line":95,"column":2},"end":{"line":95,"column":16}},"54":{"start":{"line":99,"column":2},"end":{"line":99,"column":null}},"55":{"start":{"line":103,"column":2},"end":{"line":103,"column":23}},"56":{"start":{"line":107,"column":2},"end":{"line":107,"column":30}},"57":{"start":{"line":115,"column":2},"end":{"line":115,"column":79}},"58":{"start":{"line":125,"column":2},"end":{"line":125,"column":125}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":30,"column":2},"end":{"line":30,"column":8}},"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":null}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":31,"column":2},"end":{"line":31,"column":14}},"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":null}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":32,"column":2},"end":{"line":32,"column":15}},"loc":{"start":{"line":32,"column":2},"end":{"line":32,"column":null}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":33,"column":2},"end":{"line":33,"column":19}},"loc":{"start":{"line":33,"column":2},"end":{"line":33,"column":null}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":34,"column":2},"end":{"line":34,"column":19}},"loc":{"start":{"line":34,"column":2},"end":{"line":34,"column":null}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":35,"column":2},"end":{"line":35,"column":22}},"loc":{"start":{"line":35,"column":2},"end":{"line":35,"column":null}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":36,"column":2},"end":{"line":36,"column":18}},"loc":{"start":{"line":36,"column":2},"end":{"line":36,"column":null}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":37,"column":2},"end":{"line":37,"column":17}},"loc":{"start":{"line":37,"column":2},"end":{"line":37,"column":null}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":38,"column":2},"end":{"line":38,"column":24}},"loc":{"start":{"line":38,"column":2},"end":{"line":38,"column":null}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":40,"column":9},"end":{"line":40,"column":37}},"loc":{"start":{"line":40,"column":9},"end":{"line":40,"column":67}}},"10":{"name":"loadSchemaFromSources","decl":{"start":{"line":42,"column":16},"end":{"line":42,"column":37}},"loc":{"start":{"line":42,"column":55},"end":{"line":82,"column":1}}},"11":{"name":"loadSchemaFromIntrospectionResult","decl":{"start":{"line":84,"column":9},"end":{"line":84,"column":42}},"loc":{"start":{"line":85,"column":29},"end":{"line":96,"column":1}}},"12":{"name":"printSchemaToSDL","decl":{"start":{"line":98,"column":16},"end":{"line":98,"column":32}},"loc":{"start":{"line":98,"column":54},"end":{"line":100,"column":1}}},"13":{"name":"parseOperationDocument","decl":{"start":{"line":102,"column":16},"end":{"line":102,"column":38}},"loc":{"start":{"line":102,"column":53},"end":{"line":104,"column":1}}},"14":{"name":"mergeDocuments","decl":{"start":{"line":106,"column":16},"end":{"line":106,"column":30}},"loc":{"start":{"line":106,"column":56},"end":{"line":108,"column":1}}},"15":{"name":"validateDocument","decl":{"start":{"line":110,"column":16},"end":{"line":110,"column":32}},"loc":{"start":{"line":113,"column":38},"end":{"line":116,"column":1}}},"16":{"name":"compileDocument","decl":{"start":{"line":118,"column":16},"end":{"line":118,"column":31}},"loc":{"start":{"line":123,"column":38},"end":{"line":126,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":47,"column":4},"end":{"line":56,"column":5}},"type":"if","locations":[{"start":{"line":47,"column":4},"end":{"line":56,"column":5}},{"start":{"line":54,"column":11},"end":{"line":56,"column":5}}]},"1":{"loc":{"start":{"line":48,"column":6},"end":{"line":53,"column":7}},"type":"if","locations":[{"start":{"line":48,"column":6},"end":{"line":53,"column":7}},{"start":{"line":50,"column":13},"end":{"line":53,"column":7}}]},"2":{"loc":{"start":{"line":61,"column":2},"end":{"line":81,"column":3}},"type":"if","locations":[{"start":{"line":61,"column":2},"end":{"line":81,"column":3}},{"start":{"line":72,"column":9},"end":{"line":81,"column":3}}]},"3":{"loc":{"start":{"line":89,"column":2},"end":{"line":91,"column":3}},"type":"if","locations":[{"start":{"line":89,"column":2},"end":{"line":91,"column":3}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":12,"27":12,"28":12,"29":0,"30":0,"31":0,"32":12,"33":12,"34":12,"35":12,"36":12,"37":12,"38":12,"39":12,"40":7,"41":7,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":12,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0},"b":{"0":[0,12],"1":[0,0],"2":[12,0],"3":[0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/validationRules.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/validationRules.ts","statementMap":{"0":{"start":{"line":28,"column":0},"end":{"line":28,"column":16}},"1":{"start":{"line":42,"column":0},"end":{"line":42,"column":16}},"2":{"start":{"line":57,"column":0},"end":{"line":57,"column":16}},"3":{"start":{"line":72,"column":0},"end":{"line":72,"column":16}},"4":{"start":{"line":91,"column":0},"end":{"line":91,"column":16}},"5":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"6":{"start":{"line":14,"column":52},"end":{"line":14,"column":75}},"7":{"start":{"line":29,"column":35},"end":{"line":29,"column":105}},"8":{"start":{"line":30,"column":44},"end":{"line":30,"column":121}},"9":{"start":{"line":31,"column":2},"end":{"line":39,"column":4}},"10":{"start":{"line":38,"column":39},"end":{"line":38,"column":80}},"11":{"start":{"line":43,"column":2},"end":{"line":54,"column":4}},"12":{"start":{"line":45,"column":6},"end":{"line":51,"column":7}},"13":{"start":{"line":46,"column":8},"end":{"line":50,"column":10}},"14":{"start":{"line":52,"column":6},"end":{"line":52,"column":19}},"15":{"start":{"line":58,"column":2},"end":{"line":69,"column":4}},"16":{"start":{"line":60,"column":24},"end":{"line":60,"column":54}},"17":{"start":{"line":61,"column":6},"end":{"line":67,"column":7}},"18":{"start":{"line":62,"column":8},"end":{"line":66,"column":10}},"19":{"start":{"line":73,"column":2},"end":{"line":88,"column":4}},"20":{"start":{"line":75,"column":6},"end":{"line":86,"column":7}},"21":{"start":{"line":76,"column":8},"end":{"line":85,"column":9}},"22":{"start":{"line":77,"column":10},"end":{"line":84,"column":11}},"23":{"start":{"line":78,"column":12},"end":{"line":83,"column":null}},"24":{"start":{"line":92,"column":2},"end":{"line":109,"column":null}},"25":{"start":{"line":94,"column":6},"end":{"line":107,"column":7}},"26":{"start":{"line":95,"column":8},"end":{"line":106,"column":9}},"27":{"start":{"line":96,"column":10},"end":{"line":105,"column":11}},"28":{"start":{"line":97,"column":12},"end":{"line":97,"column":41}},"29":{"start":{"line":99,"column":12},"end":{"line":104,"column":null}},"30":{"start":{"line":113,"column":2},"end":{"line":130,"column":3}},"31":{"start":{"line":114,"column":4},"end":{"line":129,"column":null}},"32":{"start":{"line":115,"column":35},"end":{"line":115,"column":45}},"33":{"start":{"line":116,"column":6},"end":{"line":128,"column":8}},"34":{"start":{"line":118,"column":30},"end":{"line":118,"column":61}},"35":{"start":{"line":119,"column":44},"end":{"line":119,"column":102}},"36":{"start":{"line":120,"column":10},"end":{"line":126,"column":11}},"37":{"start":{"line":121,"column":12},"end":{"line":125,"column":14}},"38":{"start":{"line":131,"column":2},"end":{"line":131,"column":null}},"39":{"start":{"line":135,"column":2},"end":{"line":152,"column":3}},"40":{"start":{"line":136,"column":4},"end":{"line":151,"column":null}},"41":{"start":{"line":137,"column":30},"end":{"line":137,"column":35}},"42":{"start":{"line":138,"column":6},"end":{"line":150,"column":8}},"43":{"start":{"line":140,"column":32},"end":{"line":140,"column":56}},"44":{"start":{"line":141,"column":46},"end":{"line":141,"column":108}},"45":{"start":{"line":142,"column":10},"end":{"line":148,"column":11}},"46":{"start":{"line":143,"column":12},"end":{"line":147,"column":14}},"47":{"start":{"line":153,"column":2},"end":{"line":153,"column":null}}},"fnMap":{"0":{"name":"defaultValidationRules","decl":{"start":{"line":28,"column":16},"end":{"line":28,"column":38}},"loc":{"start":{"line":28,"column":65},"end":{"line":40,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":38,"column":29},"end":{"line":38,"column":30}},"loc":{"start":{"line":38,"column":39},"end":{"line":38,"column":80}}},"2":{"name":"NoAnonymousQueries","decl":{"start":{"line":42,"column":16},"end":{"line":42,"column":34}},"loc":{"start":{"line":42,"column":61},"end":{"line":55,"column":1}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":44,"column":4},"end":{"line":44,"column":23}},"loc":{"start":{"line":44,"column":53},"end":{"line":53,"column":5}}},"4":{"name":"NoTypenameAlias","decl":{"start":{"line":57,"column":16},"end":{"line":57,"column":31}},"loc":{"start":{"line":57,"column":58},"end":{"line":70,"column":1}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":59,"column":4},"end":{"line":59,"column":9}},"loc":{"start":{"line":59,"column":25},"end":{"line":68,"column":5}}},"6":{"name":"DeferredInlineFragmentNoTypeCondition","decl":{"start":{"line":72,"column":16},"end":{"line":72,"column":53}},"loc":{"start":{"line":72,"column":80},"end":{"line":89,"column":1}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":74,"column":4},"end":{"line":74,"column":18}},"loc":{"start":{"line":74,"column":43},"end":{"line":87,"column":5}}},"8":{"name":"DeferredInlineFragmentMissingLabelArgument","decl":{"start":{"line":91,"column":16},"end":{"line":91,"column":58}},"loc":{"start":{"line":91,"column":85},"end":{"line":110,"column":1}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":93,"column":4},"end":{"line":93,"column":18}},"loc":{"start":{"line":93,"column":43},"end":{"line":108,"column":5}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":96,"column":96},"end":{"line":96,"column":97}},"loc":{"start":{"line":97,"column":12},"end":{"line":97,"column":41}}},"11":{"name":"ApolloIOSDisallowedFieldNames","decl":{"start":{"line":112,"column":9},"end":{"line":112,"column":38}},"loc":{"start":{"line":112,"column":65},"end":{"line":132,"column":1}}},"12":{"name":"ApolloIOSDisallowedFieldNamesValidationRule","decl":{"start":{"line":114,"column":20},"end":{"line":114,"column":63}},"loc":{"start":{"line":114,"column":90},"end":{"line":129,"column":5}}},"13":{"name":"(anonymous_13)","decl":{"start":{"line":117,"column":8},"end":{"line":117,"column":13}},"loc":{"start":{"line":117,"column":29},"end":{"line":127,"column":9}}},"14":{"name":"ApolloIOSDisallowedInputParameterNames","decl":{"start":{"line":134,"column":9},"end":{"line":134,"column":47}},"loc":{"start":{"line":134,"column":69},"end":{"line":154,"column":1}}},"15":{"name":"ApolloIOSDisallowedInputParameterNamesValidationRule","decl":{"start":{"line":136,"column":20},"end":{"line":136,"column":72}},"loc":{"start":{"line":136,"column":99},"end":{"line":151,"column":5}}},"16":{"name":"(anonymous_16)","decl":{"start":{"line":139,"column":8},"end":{"line":139,"column":26}},"loc":{"start":{"line":139,"column":55},"end":{"line":149,"column":9}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":65},"end":{"line":29,"column":104}},"type":"cond-expr","locations":[{"start":{"line":29,"column":93},"end":{"line":29,"column":95}},{"start":{"line":29,"column":93},"end":{"line":29,"column":104}}]},"1":{"loc":{"start":{"line":29,"column":65},"end":{"line":29,"column":95}},"type":"binary-expr","locations":[{"start":{"line":29,"column":65},"end":{"line":29,"column":95}},{"start":{"line":29,"column":93},"end":{"line":29,"column":95}}]},"2":{"loc":{"start":{"line":36,"column":8},"end":{"line":36,"column":66}},"type":"cond-expr","locations":[{"start":{"line":36,"column":35},"end":{"line":36,"column":61}},{"start":{"line":36,"column":64},"end":{"line":36,"column":66}}]},"3":{"loc":{"start":{"line":37,"column":8},"end":{"line":37,"column":84}},"type":"cond-expr","locations":[{"start":{"line":37,"column":44},"end":{"line":37,"column":79}},{"start":{"line":37,"column":82},"end":{"line":37,"column":84}}]},"4":{"loc":{"start":{"line":45,"column":6},"end":{"line":51,"column":7}},"type":"if","locations":[{"start":{"line":45,"column":6},"end":{"line":51,"column":7}}]},"5":{"loc":{"start":{"line":60,"column":24},"end":{"line":60,"column":54}},"type":"binary-expr","locations":[{"start":{"line":60,"column":24},"end":{"line":60,"column":34}},{"start":{"line":60,"column":38},"end":{"line":60,"column":54}}]},"6":{"loc":{"start":{"line":61,"column":6},"end":{"line":67,"column":7}},"type":"if","locations":[{"start":{"line":61,"column":6},"end":{"line":67,"column":7}}]},"7":{"loc":{"start":{"line":75,"column":6},"end":{"line":86,"column":7}},"type":"if","locations":[{"start":{"line":75,"column":6},"end":{"line":86,"column":7}}]},"8":{"loc":{"start":{"line":77,"column":10},"end":{"line":84,"column":11}},"type":"if","locations":[{"start":{"line":77,"column":10},"end":{"line":84,"column":11}}]},"9":{"loc":{"start":{"line":77,"column":14},"end":{"line":77,"column":99}},"type":"binary-expr","locations":[{"start":{"line":77,"column":14},"end":{"line":77,"column":64}},{"start":{"line":77,"column":68},"end":{"line":77,"column":99}}]},"10":{"loc":{"start":{"line":94,"column":6},"end":{"line":107,"column":7}},"type":"if","locations":[{"start":{"line":94,"column":6},"end":{"line":107,"column":7}}]},"11":{"loc":{"start":{"line":96,"column":10},"end":{"line":105,"column":11}},"type":"if","locations":[{"start":{"line":96,"column":10},"end":{"line":105,"column":11}}]},"12":{"loc":{"start":{"line":96,"column":14},"end":{"line":98,"column":12}},"type":"binary-expr","locations":[{"start":{"line":96,"column":14},"end":{"line":96,"column":64}},{"start":{"line":96,"column":68},"end":{"line":98,"column":12}}]},"13":{"loc":{"start":{"line":96,"column":70},"end":{"line":97,"column":null}},"type":"cond-expr","locations":[{"start":{"line":96,"column":89},"end":{"line":96,"column":91}},{"start":{"line":96,"column":89},"end":{"line":97,"column":null}}]},"14":{"loc":{"start":{"line":96,"column":70},"end":{"line":96,"column":91}},"type":"binary-expr","locations":[{"start":{"line":96,"column":70},"end":{"line":96,"column":91}},{"start":{"line":96,"column":89},"end":{"line":96,"column":91}}]},"15":{"loc":{"start":{"line":113,"column":2},"end":{"line":130,"column":3}},"type":"if","locations":[{"start":{"line":113,"column":2},"end":{"line":130,"column":3}}]},"16":{"loc":{"start":{"line":118,"column":31},"end":{"line":118,"column":54}},"type":"cond-expr","locations":[{"start":{"line":118,"column":41},"end":{"line":118,"column":45}},{"start":{"line":118,"column":45},"end":{"line":118,"column":54}}]},"17":{"loc":{"start":{"line":118,"column":31},"end":{"line":118,"column":45}},"type":"binary-expr","locations":[{"start":{"line":118,"column":31},"end":{"line":118,"column":45}},{"start":{"line":118,"column":41},"end":{"line":118,"column":45}}]},"18":{"loc":{"start":{"line":120,"column":10},"end":{"line":126,"column":11}},"type":"if","locations":[{"start":{"line":120,"column":10},"end":{"line":126,"column":11}}]},"19":{"loc":{"start":{"line":135,"column":2},"end":{"line":152,"column":3}},"type":"if","locations":[{"start":{"line":135,"column":2},"end":{"line":152,"column":3}}]},"20":{"loc":{"start":{"line":142,"column":10},"end":{"line":148,"column":11}},"type":"if","locations":[{"start":{"line":142,"column":10},"end":{"line":148,"column":11}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0],"5":[0,0],"6":[0],"7":[0],"8":[0],"9":[0,0],"10":[0],"11":[0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0],"16":[0,0],"17":[0,0],"18":[0],"19":[0],"20":[0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/index.ts","statementMap":{"0":{"start":{"line":57,"column":0},"end":{"line":57,"column":16}},"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"2":{"start":{"line":8,"column":0},"end":{"line":8,"column":null}},"3":{"start":{"line":41,"column":0},"end":{"line":41,"column":46}},"4":{"start":{"line":43,"column":0},"end":{"line":43,"column":81}},"5":{"start":{"line":46,"column":2},"end":{"line":46,"column":32}},"6":{"start":{"line":65,"column":26},"end":{"line":65,"column":67}},"7":{"start":{"line":67,"column":2},"end":{"line":71,"column":3}},"8":{"start":{"line":68,"column":4},"end":{"line":68,"column":67}},"9":{"start":{"line":68,"column":58},"end":{"line":68,"column":67}},"10":{"start":{"line":70,"column":4},"end":{"line":70,"column":67}},"11":{"start":{"line":73,"column":47},"end":{"line":73,"column":49}},"12":{"start":{"line":74,"column":22},"end":{"line":74,"column":62}},"13":{"start":{"line":75,"column":26},"end":{"line":75,"column":53}},"14":{"start":{"line":76,"column":37},"end":{"line":76,"column":63}},"15":{"start":{"line":78,"column":20},"end":{"line":78,"column":61}},"16":{"start":{"line":79,"column":2},"end":{"line":81,"column":3}},"17":{"start":{"line":80,"column":4},"end":{"line":80,"column":95}},"18":{"start":{"line":83,"column":43},"end":{"line":87,"column":4}},"19":{"start":{"line":89,"column":2},"end":{"line":93,"column":3}},"20":{"start":{"line":90,"column":4},"end":{"line":90,"column":68}},"21":{"start":{"line":90,"column":59},"end":{"line":90,"column":68}},"22":{"start":{"line":92,"column":4},"end":{"line":92,"column":54}},"23":{"start":{"line":99,"column":2},"end":{"line":101,"column":3}},"24":{"start":{"line":100,"column":4},"end":{"line":100,"column":57}},"25":{"start":{"line":103,"column":2},"end":{"line":109,"column":4}},"26":{"start":{"line":112,"column":4},"end":{"line":112,"column":45}},"27":{"start":{"line":112,"column":37},"end":{"line":112,"column":43}},"28":{"start":{"line":114,"column":4},"end":{"line":114,"column":null}},"29":{"start":{"line":116,"column":4},"end":{"line":126,"column":5}},"30":{"start":{"line":117,"column":28},"end":{"line":117,"column":57}},"31":{"start":{"line":119,"column":7},"end":{"line":119,"column":57}},"32":{"start":{"line":121,"column":6},"end":{"line":125,"column":7}},"33":{"start":{"line":122,"column":8},"end":{"line":124,"column":9}},"34":{"start":{"line":123,"column":10},"end":{"line":123,"column":null}},"35":{"start":{"line":128,"column":4},"end":{"line":133,"column":5}},"36":{"start":{"line":129,"column":35},"end":{"line":129,"column":50}},"37":{"start":{"line":130,"column":6},"end":{"line":132,"column":7}},"38":{"start":{"line":131,"column":8},"end":{"line":131,"column":null}},"39":{"start":{"line":135,"column":4},"end":{"line":137,"column":5}},"40":{"start":{"line":136,"column":6},"end":{"line":136,"column":null}},"41":{"start":{"line":139,"column":4},"end":{"line":143,"column":5}},"42":{"start":{"line":140,"column":6},"end":{"line":142,"column":7}},"43":{"start":{"line":141,"column":8},"end":{"line":141,"column":null}},"44":{"start":{"line":149,"column":21},"end":{"line":149,"column":44}},"45":{"start":{"line":150,"column":4},"end":{"line":153,"column":5}},"46":{"start":{"line":151,"column":20},"end":{"line":151,"column":33}},"47":{"start":{"line":152,"column":6},"end":{"line":152,"column":null}},"48":{"start":{"line":159,"column":26},"end":{"line":159,"column":57}},"49":{"start":{"line":160,"column":4},"end":{"line":164,"column":5}},"50":{"start":{"line":161,"column":6},"end":{"line":163,"column":7}},"51":{"start":{"line":162,"column":8},"end":{"line":162,"column":20}},"52":{"start":{"line":165,"column":4},"end":{"line":165,"column":17}},"53":{"start":{"line":169,"column":19},"end":{"line":169,"column":40}},"54":{"start":{"line":170,"column":4},"end":{"line":170,"column":34}},"55":{"start":{"line":170,"column":18},"end":{"line":170,"column":34}},"56":{"start":{"line":172,"column":25},"end":{"line":172,"column":50}},"57":{"start":{"line":173,"column":4},"end":{"line":173,"column":40}},"58":{"start":{"line":173,"column":23},"end":{"line":173,"column":40}},"59":{"start":{"line":176,"column":4},"end":{"line":176,"column":33}},"60":{"start":{"line":178,"column":4},"end":{"line":178,"column":45}},"61":{"start":{"line":179,"column":4},"end":{"line":179,"column":36}},"62":{"start":{"line":180,"column":4},"end":{"line":180,"column":20}},"63":{"start":{"line":186,"column":4},"end":{"line":188,"column":5}},"64":{"start":{"line":187,"column":6},"end":{"line":187,"column":91}},"65":{"start":{"line":190,"column":21},"end":{"line":190,"column":57}},"66":{"start":{"line":191,"column":17},"end":{"line":191,"column":47}},"67":{"start":{"line":192,"column":26},"end":{"line":192,"column":55}},"68":{"start":{"line":193,"column":32},"end":{"line":193,"column":64}},"69":{"start":{"line":195,"column":22},"end":{"line":221,"column":null}},"70":{"start":{"line":197,"column":21},"end":{"line":197,"column":45}},"71":{"start":{"line":198,"column":29},"end":{"line":198,"column":98}},"72":{"start":{"line":203,"column":21},"end":{"line":203,"column":73}},"73":{"start":{"line":207,"column":8},"end":{"line":212,"column":9}},"74":{"start":{"line":208,"column":10},"end":{"line":211,"column":12}},"75":{"start":{"line":214,"column":8},"end":{"line":214,"column":46}},"76":{"start":{"line":216,"column":8},"end":{"line":220,"column":10}},"77":{"start":{"line":224,"column":19},"end":{"line":227,"column":6}},"78":{"start":{"line":228,"column":21},"end":{"line":228,"column":75}},"79":{"start":{"line":229,"column":26},"end":{"line":229,"column":101}},"80":{"start":{"line":231,"column":4},"end":{"line":231,"column":null}},"81":{"start":{"line":233,"column":25},"end":{"line":233,"column":109}},"82":{"start":{"line":234,"column":37},"end":{"line":234,"column":77}},"83":{"start":{"line":236,"column":4},"end":{"line":238,"column":5}},"84":{"start":{"line":237,"column":6},"end":{"line":237,"column":61}},"85":{"start":{"line":240,"column":4},"end":{"line":250,"column":6}},"86":{"start":{"line":256,"column":17},"end":{"line":256,"column":46}},"87":{"start":{"line":258,"column":21},"end":{"line":258,"column":56}},"88":{"start":{"line":259,"column":19},"end":{"line":262,"column":6}},"89":{"start":{"line":263,"column":32},"end":{"line":263,"column":64}},"90":{"start":{"line":265,"column":26},"end":{"line":267,"column":null}},"91":{"start":{"line":270,"column":26},"end":{"line":270,"column":100}},"92":{"start":{"line":272,"column":4},"end":{"line":272,"column":51}},"93":{"start":{"line":274,"column":25},"end":{"line":274,"column":113}},"94":{"start":{"line":275,"column":37},"end":{"line":275,"column":77}},"95":{"start":{"line":277,"column":4},"end":{"line":279,"column":5}},"96":{"start":{"line":278,"column":6},"end":{"line":278,"column":61}},"97":{"start":{"line":281,"column":4},"end":{"line":290,"column":6}},"98":{"start":{"line":296,"column":4},"end":{"line":299,"column":7}},"99":{"start":{"line":297,"column":6},"end":{"line":297,"column":null}},"100":{"start":{"line":298,"column":6},"end":{"line":298,"column":null}},"101":{"start":{"line":307,"column":4},"end":{"line":314,"column":6}},"102":{"start":{"line":311,"column":10},"end":{"line":311,"column":83}},"103":{"start":{"line":322,"column":46},"end":{"line":322,"column":115}},"104":{"start":{"line":324,"column":4},"end":{"line":438,"column":5}},"105":{"start":{"line":326,"column":21},"end":{"line":326,"column":45}},"106":{"start":{"line":327,"column":8},"end":{"line":327,"column":54}},"107":{"start":{"line":327,"column":36},"end":{"line":327,"column":53}},"108":{"start":{"line":328,"column":22},"end":{"line":328,"column":48}},"109":{"start":{"line":330,"column":25},"end":{"line":330,"column":62}},"110":{"start":{"line":331,"column":8},"end":{"line":336,"column":9}},"111":{"start":{"line":332,"column":10},"end":{"line":335,"column":12}},"112":{"start":{"line":338,"column":26},"end":{"line":338,"column":39}},"113":{"start":{"line":339,"column":35},"end":{"line":339,"column":62}},"114":{"start":{"line":341,"column":8},"end":{"line":341,"column":60}},"115":{"start":{"line":343,"column":51},"end":{"line":343,"column":59}},"116":{"start":{"line":344,"column":44},"end":{"line":344,"column":95}},"117":{"start":{"line":346,"column":30},"end":{"line":356,"column":10}},"118":{"start":{"line":359,"column":10},"end":{"line":369,"column":11}},"119":{"start":{"line":360,"column":32},"end":{"line":360,"column":63}},"120":{"start":{"line":361,"column":46},"end":{"line":361,"column":104}},"121":{"start":{"line":363,"column":12},"end":{"line":368,"column":13}},"122":{"start":{"line":364,"column":14},"end":{"line":367,"column":16}},"123":{"start":{"line":372,"column":8},"end":{"line":376,"column":9}},"124":{"start":{"line":373,"column":10},"end":{"line":373,"column":null}},"125":{"start":{"line":374,"column":15},"end":{"line":376,"column":9}},"126":{"start":{"line":375,"column":10},"end":{"line":375,"column":null}},"127":{"start":{"line":378,"column":8},"end":{"line":395,"column":9}},"128":{"start":{"line":379,"column":35},"end":{"line":379,"column":61}},"129":{"start":{"line":381,"column":10},"end":{"line":388,"column":11}},"130":{"start":{"line":382,"column":12},"end":{"line":387,"column":14}},"131":{"start":{"line":390,"column":10},"end":{"line":394,"column":12}},"132":{"start":{"line":396,"column":8},"end":{"line":396,"column":21}},"133":{"start":{"line":399,"column":25},"end":{"line":399,"column":52}},"134":{"start":{"line":400,"column":30},"end":{"line":402,"column":22}},"135":{"start":{"line":404,"column":8},"end":{"line":404,"column":41}},"136":{"start":{"line":406,"column":8},"end":{"line":415,"column":10}},"137":{"start":{"line":418,"column":29},"end":{"line":418,"column":53}},"138":{"start":{"line":420,"column":25},"end":{"line":420,"column":50}},"139":{"start":{"line":421,"column":8},"end":{"line":426,"column":9}},"140":{"start":{"line":422,"column":10},"end":{"line":425,"column":12}},"141":{"start":{"line":428,"column":8},"end":{"line":428,"column":51}},"142":{"start":{"line":430,"column":50},"end":{"line":435,"column":10}},"143":{"start":{"line":436,"column":8},"end":{"line":436,"column":30}},"144":{"start":{"line":446,"column":52},"end":{"line":446,"column":64}},"145":{"start":{"line":447,"column":4},"end":{"line":469,"column":18}},"146":{"start":{"line":449,"column":21},"end":{"line":449,"column":35}},"147":{"start":{"line":450,"column":23},"end":{"line":451,"column":null}},"148":{"start":{"line":451,"column":22},"end":{"line":451,"column":52}},"149":{"start":{"line":453,"column":27},"end":{"line":453,"column":39}},"150":{"start":{"line":455,"column":8},"end":{"line":460,"column":9}},"151":{"start":{"line":456,"column":10},"end":{"line":459,"column":12}},"152":{"start":{"line":462,"column":8},"end":{"line":467,"column":10}},"153":{"start":{"line":475,"column":4},"end":{"line":508,"column":5}},"154":{"start":{"line":476,"column":49},"end":{"line":476,"column":51}},"155":{"start":{"line":477,"column":59},"end":{"line":477,"column":61}},"156":{"start":{"line":479,"column":6},"end":{"line":499,"column":7}},"157":{"start":{"line":480,"column":21},"end":{"line":480,"column":41}},"158":{"start":{"line":481,"column":29},"end":{"line":481,"column":54}},"159":{"start":{"line":483,"column":8},"end":{"line":488,"column":9}},"160":{"start":{"line":484,"column":10},"end":{"line":487,"column":12}},"161":{"start":{"line":490,"column":8},"end":{"line":495,"column":10}},"162":{"start":{"line":497,"column":26},"end":{"line":497,"column":76}},"163":{"start":{"line":498,"column":8},"end":{"line":498,"column":62}},"164":{"start":{"line":498,"column":25},"end":{"line":498,"column":61}},"165":{"start":{"line":501,"column":6},"end":{"line":504,"column":null}},"166":{"start":{"line":507,"column":6},"end":{"line":507,"column":23}},"167":{"start":{"line":515,"column":4},"end":{"line":542,"column":5}},"168":{"start":{"line":516,"column":24},"end":{"line":516,"column":58}},"169":{"start":{"line":517,"column":25},"end":{"line":517,"column":52}},"170":{"start":{"line":519,"column":6},"end":{"line":539,"column":7}},"171":{"start":{"line":521,"column":10},"end":{"line":525,"column":11}},"172":{"start":{"line":522,"column":12},"end":{"line":522,"column":60}},"173":{"start":{"line":524,"column":12},"end":{"line":524,"column":60}},"174":{"start":{"line":528,"column":10},"end":{"line":531,"column":null}},"175":{"start":{"line":534,"column":10},"end":{"line":537,"column":12}},"176":{"start":{"line":538,"column":10},"end":{"line":538,"column":16}},"177":{"start":{"line":541,"column":6},"end":{"line":541,"column":null}}},"fnMap":{"0":{"name":"filePathForNode","decl":{"start":{"line":45,"column":9},"end":{"line":45,"column":24}},"loc":{"start":{"line":45,"column":38},"end":{"line":47,"column":1}}},"1":{"name":"compileToIR","decl":{"start":{"line":57,"column":16},"end":{"line":57,"column":27}},"loc":{"start":{"line":62,"column":38},"end":{"line":545,"column":1}}},"2":{"name":"addReferencedType","decl":{"start":{"line":111,"column":11},"end":{"line":111,"column":28}},"loc":{"start":{"line":111,"column":51},"end":{"line":144,"column":3}}},"3":{"name":"addReferencedTypesFromInputObject","decl":{"start":{"line":146,"column":11},"end":{"line":146,"column":44}},"loc":{"start":{"line":147,"column":39},"end":{"line":154,"column":3}}},"4":{"name":"hasTypePolicyDirective","decl":{"start":{"line":156,"column":11},"end":{"line":156,"column":33}},"loc":{"start":{"line":157,"column":30},"end":{"line":166,"column":3}}},"5":{"name":"getFragment","decl":{"start":{"line":168,"column":11},"end":{"line":168,"column":22}},"loc":{"start":{"line":168,"column":35},"end":{"line":181,"column":3}}},"6":{"name":"compileOperation","decl":{"start":{"line":183,"column":11},"end":{"line":183,"column":27}},"loc":{"start":{"line":184,"column":48},"end":{"line":251,"column":3}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":196,"column":6},"end":{"line":196,"column":7}},"loc":{"start":{"line":196,"column":15},"end":{"line":221,"column":7}}},"8":{"name":"compileFragment","decl":{"start":{"line":253,"column":11},"end":{"line":253,"column":26}},"loc":{"start":{"line":254,"column":46},"end":{"line":291,"column":3}}},"9":{"name":"overrideAsLocalCacheMutation","decl":{"start":{"line":293,"column":11},"end":{"line":293,"column":39}},"loc":{"start":{"line":294,"column":38},"end":{"line":300,"column":3}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":296,"column":22},"end":{"line":296,"column":29}},"loc":{"start":{"line":296,"column":32},"end":{"line":299,"column":5}}},"11":{"name":"compileSelectionSet","decl":{"start":{"line":302,"column":11},"end":{"line":302,"column":30}},"loc":{"start":{"line":305,"column":60},"end":{"line":315,"column":3}}},"12":{"name":"(anonymous_12)","decl":{"start":{"line":310,"column":13},"end":{"line":310,"column":14}},"loc":{"start":{"line":311,"column":10},"end":{"line":311,"column":83}}},"13":{"name":"compileSelection","decl":{"start":{"line":317,"column":11},"end":{"line":317,"column":27}},"loc":{"start":{"line":320,"column":60},"end":{"line":439,"column":3}}},"14":{"name":"validateFieldName","decl":{"start":{"line":358,"column":17},"end":{"line":358,"column":34}},"loc":{"start":{"line":358,"column":109},"end":{"line":370,"column":9}}},"15":{"name":"compileArguments","decl":{"start":{"line":441,"column":11},"end":{"line":441,"column":27}},"loc":{"start":{"line":444,"column":72},"end":{"line":470,"column":3}}},"16":{"name":"(anonymous_16)","decl":{"start":{"line":448,"column":20},"end":{"line":448,"column":21}},"loc":{"start":{"line":448,"column":28},"end":{"line":468,"column":7}}},"17":{"name":"(anonymous_17)","decl":{"start":{"line":451,"column":10},"end":{"line":451,"column":11}},"loc":{"start":{"line":451,"column":22},"end":{"line":451,"column":52}}},"18":{"name":"compileDirectives","decl":{"start":{"line":472,"column":11},"end":{"line":472,"column":28}},"loc":{"start":{"line":473,"column":45},"end":{"line":509,"column":3}}},"19":{"name":"compileInclusionCondition","decl":{"start":{"line":511,"column":11},"end":{"line":511,"column":36}},"loc":{"start":{"line":513,"column":34},"end":{"line":543,"column":3}}}},"branchMap":{"0":{"loc":{"start":{"line":46,"column":9},"end":{"line":46,"column":31}},"type":"cond-expr","locations":[{"start":{"line":46,"column":25},"end":{"line":46,"column":27}},{"start":{"line":46,"column":25},"end":{"line":46,"column":31}}]},"1":{"loc":{"start":{"line":46,"column":9},"end":{"line":46,"column":27}},"type":"binary-expr","locations":[{"start":{"line":46,"column":9},"end":{"line":46,"column":27}},{"start":{"line":46,"column":25},"end":{"line":46,"column":27}}]},"2":{"loc":{"start":{"line":46,"column":9},"end":{"line":46,"column":25}},"type":"cond-expr","locations":[{"start":{"line":46,"column":17},"end":{"line":46,"column":19}},{"start":{"line":46,"column":17},"end":{"line":46,"column":25}}]},"3":{"loc":{"start":{"line":46,"column":9},"end":{"line":46,"column":19}},"type":"binary-expr","locations":[{"start":{"line":46,"column":9},"end":{"line":46,"column":19}},{"start":{"line":46,"column":17},"end":{"line":46,"column":19}}]},"4":{"loc":{"start":{"line":68,"column":4},"end":{"line":68,"column":67}},"type":"if","locations":[{"start":{"line":68,"column":4},"end":{"line":68,"column":67}}]},"5":{"loc":{"start":{"line":79,"column":2},"end":{"line":81,"column":3}},"type":"if","locations":[{"start":{"line":79,"column":2},"end":{"line":81,"column":3}}]},"6":{"loc":{"start":{"line":85,"column":18},"end":{"line":85,"column":55}},"type":"cond-expr","locations":[{"start":{"line":85,"column":42},"end":{"line":85,"column":46}},{"start":{"line":85,"column":46},"end":{"line":85,"column":55}}]},"7":{"loc":{"start":{"line":85,"column":18},"end":{"line":85,"column":46}},"type":"binary-expr","locations":[{"start":{"line":85,"column":18},"end":{"line":85,"column":46}},{"start":{"line":85,"column":42},"end":{"line":85,"column":46}}]},"8":{"loc":{"start":{"line":86,"column":22},"end":{"line":86,"column":63}},"type":"cond-expr","locations":[{"start":{"line":86,"column":50},"end":{"line":86,"column":54}},{"start":{"line":86,"column":54},"end":{"line":86,"column":63}}]},"9":{"loc":{"start":{"line":86,"column":22},"end":{"line":86,"column":54}},"type":"binary-expr","locations":[{"start":{"line":86,"column":22},"end":{"line":86,"column":54}},{"start":{"line":86,"column":50},"end":{"line":86,"column":54}}]},"10":{"loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":68}},"type":"if","locations":[{"start":{"line":90,"column":4},"end":{"line":90,"column":68}}]},"11":{"loc":{"start":{"line":108,"column":25},"end":{"line":108,"column":56}},"type":"cond-expr","locations":[{"start":{"line":108,"column":43},"end":{"line":108,"column":47}},{"start":{"line":108,"column":47},"end":{"line":108,"column":56}}]},"12":{"loc":{"start":{"line":108,"column":25},"end":{"line":108,"column":47}},"type":"binary-expr","locations":[{"start":{"line":108,"column":25},"end":{"line":108,"column":47}},{"start":{"line":108,"column":43},"end":{"line":108,"column":47}}]},"13":{"loc":{"start":{"line":112,"column":4},"end":{"line":112,"column":45}},"type":"if","locations":[{"start":{"line":112,"column":4},"end":{"line":112,"column":45}}]},"14":{"loc":{"start":{"line":116,"column":4},"end":{"line":126,"column":5}},"type":"if","locations":[{"start":{"line":116,"column":4},"end":{"line":126,"column":5}}]},"15":{"loc":{"start":{"line":122,"column":8},"end":{"line":124,"column":9}},"type":"if","locations":[{"start":{"line":122,"column":8},"end":{"line":124,"column":9}}]},"16":{"loc":{"start":{"line":122,"column":12},"end":{"line":122,"column":68}},"type":"binary-expr","locations":[{"start":{"line":122,"column":12},"end":{"line":122,"column":30}},{"start":{"line":122,"column":34},"end":{"line":122,"column":68}}]},"17":{"loc":{"start":{"line":128,"column":4},"end":{"line":133,"column":5}},"type":"if","locations":[{"start":{"line":128,"column":4},"end":{"line":133,"column":5}}]},"18":{"loc":{"start":{"line":135,"column":4},"end":{"line":137,"column":5}},"type":"if","locations":[{"start":{"line":135,"column":4},"end":{"line":137,"column":5}}]},"19":{"loc":{"start":{"line":139,"column":4},"end":{"line":143,"column":5}},"type":"if","locations":[{"start":{"line":139,"column":4},"end":{"line":143,"column":5}}]},"20":{"loc":{"start":{"line":160,"column":28},"end":{"line":160,"column":58}},"type":"cond-expr","locations":[{"start":{"line":160,"column":52},"end":{"line":160,"column":56}},{"start":{"line":160,"column":56},"end":{"line":160,"column":58}}]},"21":{"loc":{"start":{"line":160,"column":28},"end":{"line":160,"column":56}},"type":"binary-expr","locations":[{"start":{"line":160,"column":28},"end":{"line":160,"column":56}},{"start":{"line":160,"column":52},"end":{"line":160,"column":56}}]},"22":{"loc":{"start":{"line":160,"column":28},"end":{"line":160,"column":52}},"type":"cond-expr","locations":[{"start":{"line":160,"column":40},"end":{"line":160,"column":42}},{"start":{"line":160,"column":40},"end":{"line":160,"column":52}}]},"23":{"loc":{"start":{"line":160,"column":28},"end":{"line":160,"column":42}},"type":"binary-expr","locations":[{"start":{"line":160,"column":28},"end":{"line":160,"column":42}},{"start":{"line":160,"column":40},"end":{"line":160,"column":42}}]},"24":{"loc":{"start":{"line":161,"column":6},"end":{"line":163,"column":7}},"type":"if","locations":[{"start":{"line":161,"column":6},"end":{"line":163,"column":7}}]},"25":{"loc":{"start":{"line":170,"column":4},"end":{"line":170,"column":34}},"type":"if","locations":[{"start":{"line":170,"column":4},"end":{"line":170,"column":34}}]},"26":{"loc":{"start":{"line":173,"column":4},"end":{"line":173,"column":40}},"type":"if","locations":[{"start":{"line":173,"column":4},"end":{"line":173,"column":40}}]},"27":{"loc":{"start":{"line":186,"column":4},"end":{"line":188,"column":5}},"type":"if","locations":[{"start":{"line":186,"column":4},"end":{"line":188,"column":5}}]},"28":{"loc":{"start":{"line":195,"column":23},"end":{"line":195,"column":68}},"type":"binary-expr","locations":[{"start":{"line":195,"column":23},"end":{"line":195,"column":62}},{"start":{"line":195,"column":66},"end":{"line":195,"column":68}}]},"29":{"loc":{"start":{"line":198,"column":29},"end":{"line":198,"column":98}},"type":"cond-expr","locations":[{"start":{"line":198,"column":49},"end":{"line":198,"column":86}},{"start":{"line":198,"column":89},"end":{"line":198,"column":98}}]},"30":{"loc":{"start":{"line":207,"column":8},"end":{"line":212,"column":9}},"type":"if","locations":[{"start":{"line":207,"column":8},"end":{"line":212,"column":9}}]},"31":{"loc":{"start":{"line":229,"column":26},"end":{"line":229,"column":101}},"type":"cond-expr","locations":[{"start":{"line":229,"column":75},"end":{"line":229,"column":79}},{"start":{"line":229,"column":79},"end":{"line":229,"column":101}}]},"32":{"loc":{"start":{"line":229,"column":26},"end":{"line":229,"column":79}},"type":"binary-expr","locations":[{"start":{"line":229,"column":26},"end":{"line":229,"column":79}},{"start":{"line":229,"column":75},"end":{"line":229,"column":79}}]},"33":{"loc":{"start":{"line":236,"column":4},"end":{"line":238,"column":5}},"type":"if","locations":[{"start":{"line":236,"column":4},"end":{"line":238,"column":5}}]},"34":{"loc":{"start":{"line":270,"column":26},"end":{"line":270,"column":100}},"type":"cond-expr","locations":[{"start":{"line":270,"column":74},"end":{"line":270,"column":78}},{"start":{"line":270,"column":78},"end":{"line":270,"column":100}}]},"35":{"loc":{"start":{"line":270,"column":26},"end":{"line":270,"column":78}},"type":"binary-expr","locations":[{"start":{"line":270,"column":26},"end":{"line":270,"column":78}},{"start":{"line":270,"column":74},"end":{"line":270,"column":78}}]},"36":{"loc":{"start":{"line":277,"column":4},"end":{"line":279,"column":5}},"type":"if","locations":[{"start":{"line":277,"column":4},"end":{"line":279,"column":5}}]},"37":{"loc":{"start":{"line":322,"column":46},"end":{"line":322,"column":115}},"type":"cond-expr","locations":[{"start":{"line":322,"column":89},"end":{"line":322,"column":93}},{"start":{"line":322,"column":93},"end":{"line":322,"column":115}}]},"38":{"loc":{"start":{"line":322,"column":46},"end":{"line":322,"column":93}},"type":"binary-expr","locations":[{"start":{"line":322,"column":46},"end":{"line":322,"column":93}},{"start":{"line":322,"column":89},"end":{"line":322,"column":93}}]},"39":{"loc":{"start":{"line":324,"column":4},"end":{"line":438,"column":5}},"type":"switch","locations":[{"start":{"line":325,"column":6},"end":{"line":397,"column":7}},{"start":{"line":398,"column":6},"end":{"line":416,"column":7}},{"start":{"line":417,"column":6},"end":{"line":437,"column":7}}]},"40":{"loc":{"start":{"line":327,"column":8},"end":{"line":327,"column":54}},"type":"if","locations":[{"start":{"line":327,"column":8},"end":{"line":327,"column":54}}]},"41":{"loc":{"start":{"line":328,"column":22},"end":{"line":328,"column":48}},"type":"cond-expr","locations":[{"start":{"line":328,"column":41},"end":{"line":328,"column":43}},{"start":{"line":328,"column":41},"end":{"line":328,"column":48}}]},"42":{"loc":{"start":{"line":328,"column":22},"end":{"line":328,"column":43}},"type":"binary-expr","locations":[{"start":{"line":328,"column":22},"end":{"line":328,"column":43}},{"start":{"line":328,"column":41},"end":{"line":328,"column":43}}]},"43":{"loc":{"start":{"line":331,"column":8},"end":{"line":336,"column":9}},"type":"if","locations":[{"start":{"line":331,"column":8},"end":{"line":336,"column":9}}]},"44":{"loc":{"start":{"line":353,"column":23},"end":{"line":353,"column":86}},"type":"cond-expr","locations":[{"start":{"line":353,"column":63},"end":{"line":353,"column":74}},{"start":{"line":353,"column":77},"end":{"line":353,"column":86}}]},"45":{"loc":{"start":{"line":353,"column":23},"end":{"line":353,"column":60}},"type":"binary-expr","locations":[{"start":{"line":353,"column":23},"end":{"line":353,"column":45}},{"start":{"line":353,"column":49},"end":{"line":353,"column":60}}]},"46":{"loc":{"start":{"line":354,"column":29},"end":{"line":354,"column":59}},"type":"binary-expr","locations":[{"start":{"line":354,"column":29},"end":{"line":354,"column":46}},{"start":{"line":354,"column":50},"end":{"line":354,"column":59}}]},"47":{"loc":{"start":{"line":359,"column":10},"end":{"line":369,"column":11}},"type":"if","locations":[{"start":{"line":359,"column":10},"end":{"line":369,"column":11}}]},"48":{"loc":{"start":{"line":359,"column":14},"end":{"line":359,"column":48}},"type":"binary-expr","locations":[{"start":{"line":359,"column":14},"end":{"line":359,"column":29}},{"start":{"line":359,"column":33},"end":{"line":359,"column":48}}]},"49":{"loc":{"start":{"line":360,"column":33},"end":{"line":360,"column":56}},"type":"cond-expr","locations":[{"start":{"line":360,"column":43},"end":{"line":360,"column":47}},{"start":{"line":360,"column":47},"end":{"line":360,"column":56}}]},"50":{"loc":{"start":{"line":360,"column":33},"end":{"line":360,"column":47}},"type":"binary-expr","locations":[{"start":{"line":360,"column":33},"end":{"line":360,"column":47}},{"start":{"line":360,"column":43},"end":{"line":360,"column":47}}]},"51":{"loc":{"start":{"line":363,"column":12},"end":{"line":368,"column":13}},"type":"if","locations":[{"start":{"line":363,"column":12},"end":{"line":368,"column":13}}]},"52":{"loc":{"start":{"line":363,"column":16},"end":{"line":363,"column":68}},"type":"cond-expr","locations":[{"start":{"line":363,"column":31},"end":{"line":363,"column":33}},{"start":{"line":363,"column":16},"end":{"line":363,"column":68}}]},"53":{"loc":{"start":{"line":363,"column":16},"end":{"line":363,"column":33}},"type":"binary-expr","locations":[{"start":{"line":363,"column":16},"end":{"line":363,"column":33}},{"start":{"line":363,"column":16},"end":{"line":363,"column":33}}]},"54":{"loc":{"start":{"line":372,"column":8},"end":{"line":376,"column":9}},"type":"if","locations":[{"start":{"line":372,"column":8},"end":{"line":376,"column":9}},{"start":{"line":374,"column":15},"end":{"line":376,"column":9}}]},"55":{"loc":{"start":{"line":372,"column":12},"end":{"line":372,"column":95}},"type":"binary-expr","locations":[{"start":{"line":372,"column":12},"end":{"line":372,"column":33}},{"start":{"line":372,"column":38},"end":{"line":372,"column":62}},{"start":{"line":372,"column":66},"end":{"line":372,"column":94}}]},"56":{"loc":{"start":{"line":373,"column":43},"end":{"line":373,"column":93}},"type":"cond-expr","locations":[{"start":{"line":373,"column":81},"end":{"line":373,"column":83}},{"start":{"line":373,"column":81},"end":{"line":373,"column":93}}]},"57":{"loc":{"start":{"line":373,"column":43},"end":{"line":373,"column":83}},"type":"binary-expr","locations":[{"start":{"line":373,"column":43},"end":{"line":373,"column":83}},{"start":{"line":373,"column":81},"end":{"line":373,"column":83}}]},"58":{"loc":{"start":{"line":374,"column":15},"end":{"line":376,"column":9}},"type":"if","locations":[{"start":{"line":374,"column":15},"end":{"line":376,"column":9}}]},"59":{"loc":{"start":{"line":375,"column":43},"end":{"line":375,"column":89}},"type":"cond-expr","locations":[{"start":{"line":375,"column":81},"end":{"line":375,"column":83}},{"start":{"line":375,"column":81},"end":{"line":375,"column":89}}]},"60":{"loc":{"start":{"line":375,"column":43},"end":{"line":375,"column":83}},"type":"binary-expr","locations":[{"start":{"line":375,"column":43},"end":{"line":375,"column":83}},{"start":{"line":375,"column":81},"end":{"line":375,"column":83}}]},"61":{"loc":{"start":{"line":378,"column":8},"end":{"line":395,"column":9}},"type":"if","locations":[{"start":{"line":378,"column":8},"end":{"line":395,"column":9}}]},"62":{"loc":{"start":{"line":381,"column":10},"end":{"line":388,"column":11}},"type":"if","locations":[{"start":{"line":381,"column":10},"end":{"line":388,"column":11}}]},"63":{"loc":{"start":{"line":400,"column":30},"end":{"line":402,"column":22}},"type":"cond-expr","locations":[{"start":{"line":401,"column":13},"end":{"line":401,"column":67}},{"start":{"line":402,"column":12},"end":{"line":402,"column":22}}]},"64":{"loc":{"start":{"line":421,"column":8},"end":{"line":426,"column":9}},"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":426,"column":9}}]},"65":{"loc":{"start":{"line":447,"column":11},"end":{"line":469,"column":17}},"type":"cond-expr","locations":[{"start":{"line":448,"column":8},"end":{"line":468,"column":8}},{"start":{"line":469,"column":8},"end":{"line":469,"column":17}}]},"66":{"loc":{"start":{"line":447,"column":11},"end":{"line":447,"column":40}},"type":"binary-expr","locations":[{"start":{"line":447,"column":11},"end":{"line":447,"column":18}},{"start":{"line":447,"column":22},"end":{"line":447,"column":40}}]},"67":{"loc":{"start":{"line":453,"column":27},"end":{"line":453,"column":39}},"type":"cond-expr","locations":[{"start":{"line":453,"column":33},"end":{"line":453,"column":35}},{"start":{"line":453,"column":27},"end":{"line":453,"column":39}}]},"68":{"loc":{"start":{"line":453,"column":27},"end":{"line":453,"column":35}},"type":"binary-expr","locations":[{"start":{"line":453,"column":27},"end":{"line":453,"column":35}},{"start":{"line":453,"column":27},"end":{"line":453,"column":35}}]},"69":{"loc":{"start":{"line":455,"column":8},"end":{"line":460,"column":9}},"type":"if","locations":[{"start":{"line":455,"column":8},"end":{"line":460,"column":9}}]},"70":{"loc":{"start":{"line":466,"column":29},"end":{"line":466,"column":66}},"type":"cond-expr","locations":[{"start":{"line":466,"column":53},"end":{"line":466,"column":57}},{"start":{"line":466,"column":57},"end":{"line":466,"column":66}}]},"71":{"loc":{"start":{"line":466,"column":29},"end":{"line":466,"column":57}},"type":"binary-expr","locations":[{"start":{"line":466,"column":29},"end":{"line":466,"column":57}},{"start":{"line":466,"column":53},"end":{"line":466,"column":57}}]},"72":{"loc":{"start":{"line":475,"column":4},"end":{"line":508,"column":5}},"type":"if","locations":[{"start":{"line":475,"column":4},"end":{"line":508,"column":5}},{"start":{"line":506,"column":11},"end":{"line":508,"column":5}}]},"73":{"loc":{"start":{"line":475,"column":8},"end":{"line":475,"column":43}},"type":"binary-expr","locations":[{"start":{"line":475,"column":8},"end":{"line":475,"column":18}},{"start":{"line":475,"column":22},"end":{"line":475,"column":43}}]},"74":{"loc":{"start":{"line":483,"column":8},"end":{"line":488,"column":9}},"type":"if","locations":[{"start":{"line":483,"column":8},"end":{"line":488,"column":9}}]},"75":{"loc":{"start":{"line":498,"column":8},"end":{"line":498,"column":62}},"type":"if","locations":[{"start":{"line":498,"column":8},"end":{"line":498,"column":62}}]},"76":{"loc":{"start":{"line":503,"column":8},"end":{"line":503,"column":72}},"type":"cond-expr","locations":[{"start":{"line":503,"column":41},"end":{"line":503,"column":60}},{"start":{"line":503,"column":63},"end":{"line":503,"column":72}}]},"77":{"loc":{"start":{"line":515,"column":4},"end":{"line":542,"column":5}},"type":"if","locations":[{"start":{"line":515,"column":4},"end":{"line":542,"column":5}},{"start":{"line":540,"column":11},"end":{"line":542,"column":5}}]},"78":{"loc":{"start":{"line":515,"column":8},"end":{"line":515,"column":69}},"type":"binary-expr","locations":[{"start":{"line":515,"column":8},"end":{"line":515,"column":38}},{"start":{"line":515,"column":42},"end":{"line":515,"column":69}}]},"79":{"loc":{"start":{"line":516,"column":24},"end":{"line":516,"column":58}},"type":"cond-expr","locations":[{"start":{"line":516,"column":47},"end":{"line":516,"column":50}},{"start":{"line":516,"column":47},"end":{"line":516,"column":58}}]},"80":{"loc":{"start":{"line":516,"column":24},"end":{"line":516,"column":50}},"type":"binary-expr","locations":[{"start":{"line":516,"column":24},"end":{"line":516,"column":50}},{"start":{"line":516,"column":47},"end":{"line":516,"column":50}}]},"81":{"loc":{"start":{"line":519,"column":6},"end":{"line":539,"column":7}},"type":"switch","locations":[{"start":{"line":520,"column":8},"end":{"line":525,"column":11}},{"start":{"line":527,"column":8},"end":{"line":531,"column":null}},{"start":{"line":533,"column":8},"end":{"line":538,"column":16}}]},"82":{"loc":{"start":{"line":519,"column":14},"end":{"line":519,"column":29}},"type":"cond-expr","locations":[{"start":{"line":519,"column":23},"end":{"line":519,"column":25}},{"start":{"line":519,"column":14},"end":{"line":519,"column":29}}]},"83":{"loc":{"start":{"line":519,"column":14},"end":{"line":519,"column":25}},"type":"binary-expr","locations":[{"start":{"line":519,"column":14},"end":{"line":519,"column":25}},{"start":{"line":519,"column":14},"end":{"line":519,"column":25}}]},"84":{"loc":{"start":{"line":521,"column":10},"end":{"line":525,"column":11}},"type":"if","locations":[{"start":{"line":521,"column":10},"end":{"line":525,"column":11}},{"start":{"line":523,"column":17},"end":{"line":525,"column":11}}]},"85":{"loc":{"start":{"line":522,"column":19},"end":{"line":522,"column":59}},"type":"cond-expr","locations":[{"start":{"line":522,"column":37},"end":{"line":522,"column":46}},{"start":{"line":522,"column":49},"end":{"line":522,"column":59}}]},"86":{"loc":{"start":{"line":524,"column":19},"end":{"line":524,"column":59}},"type":"cond-expr","locations":[{"start":{"line":524,"column":37},"end":{"line":524,"column":47}},{"start":{"line":524,"column":50},"end":{"line":524,"column":59}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0],"5":[0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0],"11":[0,0],"12":[0,0],"13":[0],"14":[0],"15":[0],"16":[0,0],"17":[0],"18":[0],"19":[0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0],"25":[0],"26":[0],"27":[0],"28":[0,0],"29":[0,0],"30":[0],"31":[0,0],"32":[0,0],"33":[0],"34":[0,0],"35":[0,0],"36":[0],"37":[0,0],"38":[0,0],"39":[0,0,0],"40":[0],"41":[0,0],"42":[0,0],"43":[0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0,0],"56":[0,0],"57":[0,0],"58":[0],"59":[0,0],"60":[0,0],"61":[0],"62":[0],"63":[0,0],"64":[0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0],"75":[0],"76":[0,0],"77":[0,0],"78":[0,0],"79":[0,0],"80":[0,0],"81":[0,0,0],"82":[0,0],"83":[0,0],"84":[0,0],"85":[0,0],"86":[0,0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/values.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/compiler/values.ts","statementMap":{"0":{"start":{"line":28,"column":0},"end":{"line":28,"column":16}},"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}},"2":{"start":{"line":29,"column":2},"end":{"line":47,"column":3}},"3":{"start":{"line":31,"column":6},"end":{"line":31,"column":67}},"4":{"start":{"line":33,"column":6},"end":{"line":36,"column":8}},"5":{"start":{"line":38,"column":6},"end":{"line":44,"column":8}},"6":{"start":{"line":41,"column":10},"end":{"line":41,"column":69}},"7":{"start":{"line":42,"column":10},"end":{"line":42,"column":24}},"8":{"start":{"line":46,"column":6},"end":{"line":46,"column":23}}},"fnMap":{"0":{"name":"valueFromValueNode","decl":{"start":{"line":28,"column":16},"end":{"line":28,"column":34}},"loc":{"start":{"line":28,"column":55},"end":{"line":48,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":40,"column":39},"end":{"line":40,"column":40}},"loc":{"start":{"line":40,"column":57},"end":{"line":43,"column":9}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":2},"end":{"line":47,"column":3}},"type":"switch","locations":[{"start":{"line":30,"column":4},"end":{"line":31,"column":67}},{"start":{"line":32,"column":4},"end":{"line":36,"column":8}},{"start":{"line":37,"column":4},"end":{"line":44,"column":8}},{"start":{"line":45,"column":4},"end":{"line":46,"column":23}}]}},"s":{"0":1,"1":1,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"f":{"0":0,"1":0},"b":{"0":[0,0,0,0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/apolloCodegenSchemaExtension.ts","statementMap":{"0":{"start":{"line":73,"column":0},"end":{"line":73,"column":16}},"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":96}},"2":{"start":{"line":2,"column":0},"end":{"line":2,"column":76}},"3":{"start":{"line":4,"column":13},"end":{"line":10,"column":null}},"4":{"start":{"line":12,"column":13},"end":{"line":26,"column":null}},"5":{"start":{"line":28,"column":13},"end":{"line":48,"column":null}},"6":{"start":{"line":50,"column":13},"end":{"line":64,"column":null}},"7":{"start":{"line":66,"column":25},"end":{"line":71,"column":null}},"8":{"start":{"line":74,"column":21},"end":{"line":77,"column":4}},"9":{"start":{"line":74,"column":58},"end":{"line":76,"column":null}},"10":{"start":{"line":75,"column":4},"end":{"line":76,"column":49}},"11":{"start":{"line":79,"column":2},"end":{"line":82,"column":6}}},"fnMap":{"0":{"name":"addApolloCodegenSchemaExtensionToDocument","decl":{"start":{"line":73,"column":16},"end":{"line":73,"column":57}},"loc":{"start":{"line":73,"column":80},"end":{"line":83,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":74,"column":45},"end":{"line":74,"column":54}},"loc":{"start":{"line":74,"column":58},"end":{"line":76,"column":null}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":74,"column":85},"end":{"line":74,"column":95}},"loc":{"start":{"line":75,"column":4},"end":{"line":76,"column":49}}}},"branchMap":{"0":{"loc":{"start":{"line":75,"column":4},"end":{"line":76,"column":49}},"type":"binary-expr","locations":[{"start":{"line":75,"column":4},"end":{"line":75,"column":48}},{"start":{"line":76,"column":4},"end":{"line":76,"column":49}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":12,"9":48,"10":140,"11":12},"f":{"0":12,"1":48,"2":140},"b":{"0":[140,0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/experimentalDeferDirective.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/experimentalDeferDirective.ts","statementMap":{"0":{"start":{"line":19,"column":0},"end":{"line":19,"column":16}},"1":{"start":{"line":53,"column":0},"end":{"line":53,"column":16}},"2":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"3":{"start":{"line":11,"column":0},"end":{"line":11,"column":47}},"4":{"start":{"line":20,"column":21},"end":{"line":20,"column":87}},"5":{"start":{"line":22,"column":2},"end":{"line":24,"column":3}},"6":{"start":{"line":23,"column":4},"end":{"line":23,"column":null}},"7":{"start":{"line":26,"column":30},"end":{"line":26,"column":67}},"8":{"start":{"line":28,"column":2},"end":{"line":39,"column":3}},"9":{"start":{"line":29,"column":4},"end":{"line":29,"column":null}},"10":{"start":{"line":31,"column":43},"end":{"line":36,"column":null}},"11":{"start":{"line":34,"column":19},"end":{"line":34,"column":86}},"12":{"start":{"line":38,"column":4},"end":{"line":38,"column":null}},"13":{"start":{"line":41,"column":2},"end":{"line":41,"column":null}},"14":{"start":{"line":54,"column":20},"end":{"line":54,"column":67}},"15":{"start":{"line":56,"column":2},"end":{"line":58,"column":3}},"16":{"start":{"line":57,"column":4},"end":{"line":57,"column":null}},"17":{"start":{"line":60,"column":2},"end":{"line":64,"column":3}},"18":{"start":{"line":61,"column":4},"end":{"line":61,"column":null}},"19":{"start":{"line":63,"column":4},"end":{"line":63,"column":null}},"20":{"start":{"line":66,"column":2},"end":{"line":66,"column":null}},"21":{"start":{"line":71,"column":2},"end":{"line":74,"column":null}},"22":{"start":{"line":78,"column":2},"end":{"line":81,"column":null}},"23":{"start":{"line":87,"column":2},"end":{"line":91,"column":null}},"24":{"start":{"line":89,"column":39},"end":{"line":89,"column":49}},"25":{"start":{"line":90,"column":41},"end":{"line":90,"column":57}},"26":{"start":{"line":90,"column":108},"end":{"line":90,"column":118}},"27":{"start":{"line":97,"column":2},"end":{"line":101,"column":null}},"28":{"start":{"line":100,"column":34},"end":{"line":100,"column":44}},"29":{"start":{"line":100,"column":95},"end":{"line":100,"column":105}}},"fnMap":{"0":{"name":"addExperimentalDeferDirectiveToSDLDocument","decl":{"start":{"line":19,"column":16},"end":{"line":19,"column":58}},"loc":{"start":{"line":19,"column":81},"end":{"line":42,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":34,"column":8},"end":{"line":34,"column":9}},"loc":{"start":{"line":34,"column":19},"end":{"line":34,"column":86}}},"2":{"name":"addExperimentalDeferDirectiveToIntrospectionSchema","decl":{"start":{"line":53,"column":16},"end":{"line":53,"column":66}},"loc":{"start":{"line":53,"column":112},"end":{"line":67,"column":1}}},"3":{"name":"isDeferDirectiveDefinitionNodePredicate","decl":{"start":{"line":70,"column":9},"end":{"line":70,"column":48}},"loc":{"start":{"line":70,"column":70},"end":{"line":75,"column":1}}},"4":{"name":"experimentalDeferDirectiveDocumentNode","decl":{"start":{"line":77,"column":9},"end":{"line":77,"column":47}},"loc":{"start":{"line":77,"column":47},"end":{"line":82,"column":1}}},"5":{"name":"matchDirectiveDefinition","decl":{"start":{"line":86,"column":9},"end":{"line":86,"column":33}},"loc":{"start":{"line":86,"column":95},"end":{"line":92,"column":1}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":89,"column":29},"end":{"line":89,"column":30}},"loc":{"start":{"line":89,"column":39},"end":{"line":89,"column":49}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":90,"column":30},"end":{"line":90,"column":31}},"loc":{"start":{"line":90,"column":41},"end":{"line":90,"column":57}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":90,"column":97},"end":{"line":90,"column":98}},"loc":{"start":{"line":90,"column":108},"end":{"line":90,"column":118}}},"9":{"name":"matchDirective","decl":{"start":{"line":96,"column":9},"end":{"line":96,"column":23}},"loc":{"start":{"line":96,"column":77},"end":{"line":102,"column":1}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":100,"column":23},"end":{"line":100,"column":24}},"loc":{"start":{"line":100,"column":34},"end":{"line":100,"column":44}}},"11":{"name":"(anonymous_11)","decl":{"start":{"line":100,"column":84},"end":{"line":100,"column":85}},"loc":{"start":{"line":100,"column":95},"end":{"line":100,"column":105}}}},"branchMap":{"0":{"loc":{"start":{"line":22,"column":2},"end":{"line":24,"column":3}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":24,"column":3}}]},"1":{"loc":{"start":{"line":28,"column":2},"end":{"line":39,"column":3}},"type":"if","locations":[{"start":{"line":28,"column":2},"end":{"line":39,"column":3}}]},"2":{"loc":{"start":{"line":34,"column":19},"end":{"line":34,"column":86}},"type":"cond-expr","locations":[{"start":{"line":34,"column":69},"end":{"line":34,"column":74}},{"start":{"line":34,"column":77},"end":{"line":34,"column":86}}]},"3":{"loc":{"start":{"line":56,"column":2},"end":{"line":58,"column":3}},"type":"if","locations":[{"start":{"line":56,"column":2},"end":{"line":58,"column":3}}]},"4":{"loc":{"start":{"line":60,"column":2},"end":{"line":64,"column":3}},"type":"if","locations":[{"start":{"line":60,"column":2},"end":{"line":64,"column":3}}]},"5":{"loc":{"start":{"line":72,"column":4},"end":{"line":73,"column":51}},"type":"binary-expr","locations":[{"start":{"line":72,"column":4},"end":{"line":72,"column":44}},{"start":{"line":73,"column":4},"end":{"line":73,"column":51}}]},"6":{"loc":{"start":{"line":88,"column":4},"end":{"line":90,"column":137}},"type":"binary-expr","locations":[{"start":{"line":88,"column":4},"end":{"line":88,"column":49}},{"start":{"line":89,"column":4},"end":{"line":89,"column":116}},{"start":{"line":90,"column":4},"end":{"line":90,"column":137}}]},"7":{"loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":76}},"type":"cond-expr","locations":[{"start":{"line":90,"column":24},"end":{"line":90,"column":26}},{"start":{"line":90,"column":24},"end":{"line":90,"column":76}}]},"8":{"loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":26}},"type":"binary-expr","locations":[{"start":{"line":90,"column":4},"end":{"line":90,"column":26}},{"start":{"line":90,"column":24},"end":{"line":90,"column":26}}]},"9":{"loc":{"start":{"line":98,"column":4},"end":{"line":100,"column":124}},"type":"binary-expr","locations":[{"start":{"line":98,"column":4},"end":{"line":98,"column":50}},{"start":{"line":99,"column":4},"end":{"line":99,"column":98}},{"start":{"line":100,"column":4},"end":{"line":100,"column":124}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":12,"5":12,"6":12,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":83,"22":12,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0},"f":{"0":12,"1":0,"2":0,"3":83,"4":12,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"b":{"0":[12],"1":[0],"2":[0,0],"3":[0],"4":[0],"5":[83,48],"6":[0,0,0],"7":[0,0],"8":[0,0],"9":[0,0,0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts","statementMap":{"0":{"start":{"line":24,"column":0},"end":{"line":24,"column":16}},"1":{"start":{"line":39,"column":0},"end":{"line":39,"column":16}},"2":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"3":{"start":{"line":15,"column":0},"end":{"line":15,"column":71}},"4":{"start":{"line":17,"column":22},"end":{"line":17,"column":54}},"5":{"start":{"line":27,"column":16},"end":{"line":27,"column":35}},"6":{"start":{"line":29,"column":2},"end":{"line":36,"column":3}},"7":{"start":{"line":30,"column":17},"end":{"line":30,"column":25}},"8":{"start":{"line":32,"column":4},"end":{"line":35,"column":5}},"9":{"start":{"line":34,"column":6},"end":{"line":34,"column":34}},"10":{"start":{"line":42,"column":21},"end":{"line":42,"column":51}},"11":{"start":{"line":43,"column":2},"end":{"line":45,"column":3}},"12":{"start":{"line":44,"column":4},"end":{"line":44,"column":11}},"13":{"start":{"line":47,"column":21},"end":{"line":47,"column":37}},"14":{"start":{"line":49,"column":2},"end":{"line":138,"column":3}},"15":{"start":{"line":50,"column":30},"end":{"line":52,"column":12}},"16":{"start":{"line":51,"column":13},"end":{"line":51,"column":40}},"17":{"start":{"line":53,"column":39},"end":{"line":53,"column":48}},"18":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"19":{"start":{"line":55,"column":6},"end":{"line":55,"column":null}},"20":{"start":{"line":58,"column":4},"end":{"line":63,"column":5}},"21":{"start":{"line":59,"column":6},"end":{"line":62,"column":8}},"22":{"start":{"line":65,"column":29},"end":{"line":67,"column":12}},"23":{"start":{"line":66,"column":13},"end":{"line":66,"column":39}},"24":{"start":{"line":68,"column":40},"end":{"line":68,"column":49}},"25":{"start":{"line":69,"column":4},"end":{"line":72,"column":5}},"26":{"start":{"line":70,"column":22},"end":{"line":70,"column":55}},"27":{"start":{"line":71,"column":6},"end":{"line":71,"column":54}},"28":{"start":{"line":74,"column":4},"end":{"line":79,"column":5}},"29":{"start":{"line":75,"column":6},"end":{"line":78,"column":8}},"30":{"start":{"line":82,"column":24},"end":{"line":82,"column":44}},"31":{"start":{"line":83,"column":4},"end":{"line":88,"column":5}},"32":{"start":{"line":84,"column":6},"end":{"line":87,"column":8}},"33":{"start":{"line":91,"column":19},"end":{"line":91,"column":49}},"34":{"start":{"line":92,"column":23},"end":{"line":92,"column":76}},"35":{"start":{"line":92,"column":52},"end":{"line":92,"column":68}},"36":{"start":{"line":93,"column":4},"end":{"line":102,"column":5}},"37":{"start":{"line":94,"column":6},"end":{"line":101,"column":7}},"38":{"start":{"line":95,"column":8},"end":{"line":100,"column":10}},"39":{"start":{"line":105,"column":4},"end":{"line":131,"column":5}},"40":{"start":{"line":106,"column":26},"end":{"line":106,"column":27}},"41":{"start":{"line":107,"column":32},"end":{"line":107,"column":60}},"42":{"start":{"line":109,"column":6},"end":{"line":113,"column":7}},"43":{"start":{"line":110,"column":8},"end":{"line":112,"column":9}},"44":{"start":{"line":111,"column":10},"end":{"line":111,"column":29}},"45":{"start":{"line":116,"column":6},"end":{"line":121,"column":7}},"46":{"start":{"line":117,"column":8},"end":{"line":120,"column":10}},"47":{"start":{"line":125,"column":6},"end":{"line":130,"column":7}},"48":{"start":{"line":126,"column":8},"end":{"line":129,"column":10}},"49":{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},"50":{"start":{"line":134,"column":7},"end":{"line":134,"column":null}},"51":{"start":{"line":136,"column":7},"end":{"line":136,"column":null}},"52":{"start":{"line":144,"column":2},"end":{"line":146,"column":3}},"53":{"start":{"line":145,"column":4},"end":{"line":145,"column":21}},"54":{"start":{"line":148,"column":34},"end":{"line":148,"column":36}},"55":{"start":{"line":150,"column":2},"end":{"line":157,"column":3}},"56":{"start":{"line":151,"column":22},"end":{"line":152,"column":null}},"57":{"start":{"line":152,"column":13},"end":{"line":152,"column":43}},"58":{"start":{"line":154,"column":4},"end":{"line":156,"column":5}},"59":{"start":{"line":155,"column":6},"end":{"line":155,"column":null}},"60":{"start":{"line":159,"column":2},"end":{"line":163,"column":3}},"61":{"start":{"line":160,"column":4},"end":{"line":162,"column":5}},"62":{"start":{"line":161,"column":6},"end":{"line":161,"column":29}},"63":{"start":{"line":165,"column":2},"end":{"line":186,"column":3}},"64":{"start":{"line":166,"column":4},"end":{"line":185,"column":5}},"65":{"start":{"line":167,"column":20},"end":{"line":167,"column":59}},"66":{"start":{"line":168,"column":6},"end":{"line":170,"column":7}},"67":{"start":{"line":169,"column":8},"end":{"line":169,"column":17}},"68":{"start":{"line":172,"column":6},"end":{"line":184,"column":7}},"69":{"start":{"line":173,"column":24},"end":{"line":173,"column":29}},"70":{"start":{"line":174,"column":8},"end":{"line":179,"column":9}},"71":{"start":{"line":175,"column":10},"end":{"line":178,"column":11}},"72":{"start":{"line":176,"column":12},"end":{"line":176,"column":29}},"73":{"start":{"line":177,"column":12},"end":{"line":177,"column":18}},"74":{"start":{"line":181,"column":8},"end":{"line":183,"column":9}},"75":{"start":{"line":182,"column":10},"end":{"line":182,"column":38}},"76":{"start":{"line":188,"column":2},"end":{"line":188,"column":null}},"77":{"start":{"line":195,"column":2},"end":{"line":208,"column":4}},"78":{"start":{"line":198,"column":8},"end":{"line":198,"column":74}},"79":{"start":{"line":204,"column":8},"end":{"line":204,"column":74}}},"fnMap":{"0":{"name":"addFieldPolicyDirectivesToSchema","decl":{"start":{"line":24,"column":16},"end":{"line":24,"column":48}},"loc":{"start":{"line":25,"column":23},"end":{"line":37,"column":1}}},"1":{"name":"applyFieldPoliciesFor","decl":{"start":{"line":39,"column":16},"end":{"line":39,"column":37}},"loc":{"start":{"line":40,"column":28},"end":{"line":139,"column":1}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":51,"column":6},"end":{"line":51,"column":7}},"loc":{"start":{"line":51,"column":13},"end":{"line":51,"column":40}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":66,"column":6},"end":{"line":66,"column":7}},"loc":{"start":{"line":66,"column":13},"end":{"line":66,"column":39}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":92,"column":43},"end":{"line":92,"column":48}},"loc":{"start":{"line":92,"column":52},"end":{"line":92,"column":68}}},"5":{"name":"fieldPolicyDirectivesFor","decl":{"start":{"line":141,"column":9},"end":{"line":141,"column":33}},"loc":{"start":{"line":142,"column":28},"end":{"line":189,"column":1}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":152,"column":6},"end":{"line":152,"column":7}},"loc":{"start":{"line":152,"column":13},"end":{"line":152,"column":43}}},"7":{"name":"matchDirectiveArguments","decl":{"start":{"line":191,"column":9},"end":{"line":191,"column":32}},"loc":{"start":{"line":193,"column":23},"end":{"line":209,"column":1}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":197,"column":11},"end":{"line":197,"column":12}},"loc":{"start":{"line":198,"column":8},"end":{"line":198,"column":74}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":203,"column":11},"end":{"line":203,"column":12}},"loc":{"start":{"line":204,"column":8},"end":{"line":204,"column":74}}}},"branchMap":{"0":{"loc":{"start":{"line":32,"column":4},"end":{"line":35,"column":5}},"type":"if","locations":[{"start":{"line":32,"column":4},"end":{"line":35,"column":5}}]},"1":{"loc":{"start":{"line":32,"column":8},"end":{"line":32,"column":81}},"type":"binary-expr","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":41}},{"start":{"line":32,"column":45},"end":{"line":32,"column":81}}]},"2":{"loc":{"start":{"line":43,"column":2},"end":{"line":45,"column":3}},"type":"if","locations":[{"start":{"line":43,"column":2},"end":{"line":45,"column":3}}]},"3":{"loc":{"start":{"line":43,"column":6},"end":{"line":43,"column":38}},"type":"binary-expr","locations":[{"start":{"line":43,"column":6},"end":{"line":43,"column":17}},{"start":{"line":43,"column":21},"end":{"line":43,"column":38}}]},"4":{"loc":{"start":{"line":50,"column":30},"end":{"line":52,"column":12}},"type":"cond-expr","locations":[{"start":{"line":52,"column":5},"end":{"line":52,"column":7}},{"start":{"line":52,"column":5},"end":{"line":52,"column":12}}]},"5":{"loc":{"start":{"line":50,"column":30},"end":{"line":52,"column":7}},"type":"binary-expr","locations":[{"start":{"line":50,"column":30},"end":{"line":52,"column":7}},{"start":{"line":52,"column":5},"end":{"line":52,"column":7}}]},"6":{"loc":{"start":{"line":50,"column":30},"end":{"line":51,"column":null}},"type":"cond-expr","locations":[{"start":{"line":50,"column":49},"end":{"line":50,"column":51}},{"start":{"line":50,"column":49},"end":{"line":51,"column":null}}]},"7":{"loc":{"start":{"line":50,"column":30},"end":{"line":50,"column":51}},"type":"binary-expr","locations":[{"start":{"line":50,"column":30},"end":{"line":50,"column":51}},{"start":{"line":50,"column":49},"end":{"line":50,"column":51}}]},"8":{"loc":{"start":{"line":54,"column":4},"end":{"line":56,"column":5}},"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":56,"column":5}}]},"9":{"loc":{"start":{"line":54,"column":8},"end":{"line":54,"column":31}},"type":"cond-expr","locations":[{"start":{"line":54,"column":25},"end":{"line":54,"column":27}},{"start":{"line":54,"column":8},"end":{"line":54,"column":31}}]},"10":{"loc":{"start":{"line":54,"column":8},"end":{"line":54,"column":27}},"type":"binary-expr","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":27}},{"start":{"line":54,"column":8},"end":{"line":54,"column":27}}]},"11":{"loc":{"start":{"line":58,"column":4},"end":{"line":63,"column":5}},"type":"if","locations":[{"start":{"line":58,"column":4},"end":{"line":63,"column":5}}]},"12":{"loc":{"start":{"line":65,"column":29},"end":{"line":67,"column":12}},"type":"cond-expr","locations":[{"start":{"line":67,"column":5},"end":{"line":67,"column":7}},{"start":{"line":67,"column":5},"end":{"line":67,"column":12}}]},"13":{"loc":{"start":{"line":65,"column":29},"end":{"line":67,"column":7}},"type":"binary-expr","locations":[{"start":{"line":65,"column":29},"end":{"line":67,"column":7}},{"start":{"line":67,"column":5},"end":{"line":67,"column":7}}]},"14":{"loc":{"start":{"line":65,"column":29},"end":{"line":66,"column":null}},"type":"cond-expr","locations":[{"start":{"line":65,"column":48},"end":{"line":65,"column":50}},{"start":{"line":65,"column":48},"end":{"line":66,"column":null}}]},"15":{"loc":{"start":{"line":65,"column":29},"end":{"line":65,"column":50}},"type":"binary-expr","locations":[{"start":{"line":65,"column":29},"end":{"line":65,"column":50}},{"start":{"line":65,"column":48},"end":{"line":65,"column":50}}]},"16":{"loc":{"start":{"line":69,"column":4},"end":{"line":72,"column":5}},"type":"if","locations":[{"start":{"line":69,"column":4},"end":{"line":72,"column":5}}]},"17":{"loc":{"start":{"line":69,"column":8},"end":{"line":69,"column":30}},"type":"cond-expr","locations":[{"start":{"line":69,"column":24},"end":{"line":69,"column":26}},{"start":{"line":69,"column":8},"end":{"line":69,"column":30}}]},"18":{"loc":{"start":{"line":69,"column":8},"end":{"line":69,"column":26}},"type":"binary-expr","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":26}},{"start":{"line":69,"column":8},"end":{"line":69,"column":26}}]},"19":{"loc":{"start":{"line":74,"column":4},"end":{"line":79,"column":5}},"type":"if","locations":[{"start":{"line":74,"column":4},"end":{"line":79,"column":5}}]},"20":{"loc":{"start":{"line":83,"column":4},"end":{"line":88,"column":5}},"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":88,"column":5}}]},"21":{"loc":{"start":{"line":86,"column":17},"end":{"line":86,"column":69}},"type":"cond-expr","locations":[{"start":{"line":86,"column":32},"end":{"line":86,"column":57}},{"start":{"line":86,"column":60},"end":{"line":86,"column":69}}]},"22":{"loc":{"start":{"line":91,"column":19},"end":{"line":91,"column":49}},"type":"cond-expr","locations":[{"start":{"line":91,"column":38},"end":{"line":91,"column":40}},{"start":{"line":91,"column":38},"end":{"line":91,"column":49}}]},"23":{"loc":{"start":{"line":91,"column":19},"end":{"line":91,"column":40}},"type":"binary-expr","locations":[{"start":{"line":91,"column":19},"end":{"line":91,"column":40}},{"start":{"line":91,"column":38},"end":{"line":91,"column":40}}]},"24":{"loc":{"start":{"line":92,"column":31},"end":{"line":92,"column":75}},"type":"cond-expr","locations":[{"start":{"line":92,"column":69},"end":{"line":92,"column":73}},{"start":{"line":92,"column":73},"end":{"line":92,"column":75}}]},"25":{"loc":{"start":{"line":92,"column":31},"end":{"line":92,"column":73}},"type":"binary-expr","locations":[{"start":{"line":92,"column":31},"end":{"line":92,"column":73}},{"start":{"line":92,"column":69},"end":{"line":92,"column":73}}]},"26":{"loc":{"start":{"line":92,"column":31},"end":{"line":92,"column":69}},"type":"cond-expr","locations":[{"start":{"line":92,"column":37},"end":{"line":92,"column":39}},{"start":{"line":92,"column":31},"end":{"line":92,"column":69}}]},"27":{"loc":{"start":{"line":92,"column":31},"end":{"line":92,"column":39}},"type":"binary-expr","locations":[{"start":{"line":92,"column":31},"end":{"line":92,"column":39}},{"start":{"line":92,"column":31},"end":{"line":92,"column":39}}]},"28":{"loc":{"start":{"line":94,"column":6},"end":{"line":101,"column":7}},"type":"if","locations":[{"start":{"line":94,"column":6},"end":{"line":101,"column":7}}]},"29":{"loc":{"start":{"line":105,"column":4},"end":{"line":131,"column":5}},"type":"if","locations":[{"start":{"line":105,"column":4},"end":{"line":131,"column":5}}]},"30":{"loc":{"start":{"line":110,"column":8},"end":{"line":112,"column":9}},"type":"if","locations":[{"start":{"line":110,"column":8},"end":{"line":112,"column":9}}]},"31":{"loc":{"start":{"line":116,"column":6},"end":{"line":121,"column":7}},"type":"if","locations":[{"start":{"line":116,"column":6},"end":{"line":121,"column":7}}]},"32":{"loc":{"start":{"line":125,"column":6},"end":{"line":130,"column":7}},"type":"if","locations":[{"start":{"line":125,"column":6},"end":{"line":130,"column":7}}]},"33":{"loc":{"start":{"line":125,"column":10},"end":{"line":125,"column":97}},"type":"binary-expr","locations":[{"start":{"line":125,"column":11},"end":{"line":125,"column":28}},{"start":{"line":125,"column":32},"end":{"line":125,"column":50}},{"start":{"line":125,"column":56},"end":{"line":125,"column":74}},{"start":{"line":125,"column":78},"end":{"line":125,"column":96}}]},"34":{"loc":{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},"type":"if","locations":[{"start":{"line":133,"column":4},"end":{"line":137,"column":5}},{"start":{"line":135,"column":11},"end":{"line":137,"column":5}}]},"35":{"loc":{"start":{"line":144,"column":2},"end":{"line":146,"column":3}},"type":"if","locations":[{"start":{"line":144,"column":2},"end":{"line":146,"column":3}}]},"36":{"loc":{"start":{"line":144,"column":5},"end":{"line":144,"column":50}},"type":"binary-expr","locations":[{"start":{"line":144,"column":5},"end":{"line":144,"column":24}},{"start":{"line":144,"column":28},"end":{"line":144,"column":50}}]},"37":{"loc":{"start":{"line":150,"column":26},"end":{"line":150,"column":54}},"type":"cond-expr","locations":[{"start":{"line":150,"column":48},"end":{"line":150,"column":52}},{"start":{"line":150,"column":52},"end":{"line":150,"column":54}}]},"38":{"loc":{"start":{"line":150,"column":26},"end":{"line":150,"column":52}},"type":"binary-expr","locations":[{"start":{"line":150,"column":26},"end":{"line":150,"column":52}},{"start":{"line":150,"column":48},"end":{"line":150,"column":52}}]},"39":{"loc":{"start":{"line":151,"column":22},"end":{"line":152,"column":null}},"type":"cond-expr","locations":[{"start":{"line":151,"column":42},"end":{"line":151,"column":44}},{"start":{"line":151,"column":42},"end":{"line":152,"column":null}}]},"40":{"loc":{"start":{"line":151,"column":22},"end":{"line":151,"column":44}},"type":"binary-expr","locations":[{"start":{"line":151,"column":22},"end":{"line":151,"column":44}},{"start":{"line":151,"column":42},"end":{"line":151,"column":44}}]},"41":{"loc":{"start":{"line":154,"column":4},"end":{"line":156,"column":5}},"type":"if","locations":[{"start":{"line":154,"column":4},"end":{"line":156,"column":5}}]},"42":{"loc":{"start":{"line":159,"column":26},"end":{"line":159,"column":56}},"type":"cond-expr","locations":[{"start":{"line":159,"column":50},"end":{"line":159,"column":54}},{"start":{"line":159,"column":54},"end":{"line":159,"column":56}}]},"43":{"loc":{"start":{"line":159,"column":26},"end":{"line":159,"column":54}},"type":"binary-expr","locations":[{"start":{"line":159,"column":26},"end":{"line":159,"column":54}},{"start":{"line":159,"column":50},"end":{"line":159,"column":54}}]},"44":{"loc":{"start":{"line":159,"column":26},"end":{"line":159,"column":50}},"type":"cond-expr","locations":[{"start":{"line":159,"column":38},"end":{"line":159,"column":40}},{"start":{"line":159,"column":38},"end":{"line":159,"column":50}}]},"45":{"loc":{"start":{"line":159,"column":26},"end":{"line":159,"column":40}},"type":"binary-expr","locations":[{"start":{"line":159,"column":26},"end":{"line":159,"column":40}},{"start":{"line":159,"column":38},"end":{"line":159,"column":40}}]},"46":{"loc":{"start":{"line":160,"column":4},"end":{"line":162,"column":5}},"type":"if","locations":[{"start":{"line":160,"column":4},"end":{"line":162,"column":5}}]},"47":{"loc":{"start":{"line":165,"column":2},"end":{"line":186,"column":3}},"type":"if","locations":[{"start":{"line":165,"column":2},"end":{"line":186,"column":3}}]},"48":{"loc":{"start":{"line":168,"column":6},"end":{"line":170,"column":7}},"type":"if","locations":[{"start":{"line":168,"column":6},"end":{"line":170,"column":7}}]},"49":{"loc":{"start":{"line":175,"column":10},"end":{"line":178,"column":11}},"type":"if","locations":[{"start":{"line":175,"column":10},"end":{"line":178,"column":11}}]},"50":{"loc":{"start":{"line":181,"column":8},"end":{"line":183,"column":9}},"type":"if","locations":[{"start":{"line":181,"column":8},"end":{"line":183,"column":9}}]},"51":{"loc":{"start":{"line":196,"column":5},"end":{"line":196,"column":26}},"type":"cond-expr","locations":[{"start":{"line":196,"column":20},"end":{"line":196,"column":24}},{"start":{"line":196,"column":24},"end":{"line":196,"column":26}}]},"52":{"loc":{"start":{"line":196,"column":5},"end":{"line":196,"column":24}},"type":"binary-expr","locations":[{"start":{"line":196,"column":5},"end":{"line":196,"column":24}},{"start":{"line":196,"column":20},"end":{"line":196,"column":24}}]},"53":{"loc":{"start":{"line":202,"column":5},"end":{"line":202,"column":27}},"type":"cond-expr","locations":[{"start":{"line":202,"column":21},"end":{"line":202,"column":25}},{"start":{"line":202,"column":25},"end":{"line":202,"column":27}}]},"54":{"loc":{"start":{"line":202,"column":5},"end":{"line":202,"column":25}},"type":"binary-expr","locations":[{"start":{"line":202,"column":5},"end":{"line":202,"column":25}},{"start":{"line":202,"column":21},"end":{"line":202,"column":25}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":12,"6":12,"7":98,"8":98,"9":62,"10":62,"11":62,"12":0,"13":62,"14":62,"15":15,"16":15,"17":15,"18":15,"19":15,"20":15,"21":0,"22":15,"23":30,"24":15,"25":15,"26":15,"27":15,"28":15,"29":0,"30":15,"31":15,"32":0,"33":15,"34":15,"35":18,"36":15,"37":18,"38":1,"39":14,"40":14,"41":14,"42":14,"43":16,"44":4,"45":14,"46":1,"47":13,"48":3,"49":10,"50":10,"51":0,"52":66,"53":0,"54":66,"55":66,"56":12,"57":12,"58":12,"59":12,"60":66,"61":5,"62":5,"63":66,"64":66,"65":4,"66":4,"67":0,"68":4,"69":4,"70":4,"71":2,"72":2,"73":2,"74":4,"75":2,"76":66,"77":2,"78":4,"79":4},"f":{"0":12,"1":62,"2":15,"3":30,"4":18,"5":66,"6":12,"7":2,"8":4,"9":4},"b":{"0":[62],"1":[98,41],"2":[0],"3":[62,62],"4":[0,15],"5":[15,15],"6":[0,15],"7":[15,15],"8":[15],"9":[0,15],"10":[15,15],"11":[0],"12":[0,15],"13":[15,15],"14":[0,15],"15":[15,15],"16":[15],"17":[0,15],"18":[15,15],"19":[0],"20":[0],"21":[0,0],"22":[0,15],"23":[15,15],"24":[15,0],"25":[15,15],"26":[0,15],"27":[15,15],"28":[1],"29":[14],"30":[4],"31":[1],"32":[3],"33":[13,3,11,2],"34":[10,0],"35":[0],"36":[66,9],"37":[66,0],"38":[66,66],"39":[0,12],"40":[12,12],"41":[12],"42":[5,61],"43":[66,66],"44":[42,24],"45":[66,66],"46":[5],"47":[66],"48":[0],"49":[2],"50":[2],"51":[2,0],"52":[2,2],"53":[2,0],"54":[2,2]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/graphql.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/graphql.ts","statementMap":{"0":{"start":{"line":36,"column":0},"end":{"line":36,"column":16}},"1":{"start":{"line":43,"column":0},"end":{"line":43,"column":16}},"2":{"start":{"line":50,"column":0},"end":{"line":50,"column":16}},"3":{"start":{"line":54,"column":0},"end":{"line":54,"column":16}},"4":{"start":{"line":58,"column":0},"end":{"line":58,"column":16}},"5":{"start":{"line":62,"column":0},"end":{"line":62,"column":16}},"6":{"start":{"line":79,"column":0},"end":{"line":79,"column":16}},"7":{"start":{"line":158,"column":0},"end":{"line":158,"column":16}},"8":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"9":{"start":{"line":23,"column":0},"end":{"line":23,"column":46}},"10":{"start":{"line":24,"column":0},"end":{"line":24,"column":58}},"11":{"start":{"line":25,"column":0},"end":{"line":25,"column":124}},"12":{"start":{"line":26,"column":0},"end":{"line":26,"column":84}},"13":{"start":{"line":30,"column":4},"end":{"line":30,"column":71}},"14":{"start":{"line":30,"column":42},"end":{"line":30,"column":55}},"15":{"start":{"line":29,"column":21},"end":{"line":29,"column":62}},"16":{"start":{"line":32,"column":4},"end":{"line":32,"column":47}},"17":{"start":{"line":28,"column":0},"end":{"line":28,"column":13}},"18":{"start":{"line":37,"column":17},"end":{"line":37,"column":38}},"19":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"20":{"start":{"line":39,"column":4},"end":{"line":39,"column":51}},"21":{"start":{"line":44,"column":17},"end":{"line":44,"column":39}},"22":{"start":{"line":45,"column":2},"end":{"line":47,"column":3}},"23":{"start":{"line":46,"column":4},"end":{"line":46,"column":51}},"24":{"start":{"line":51,"column":2},"end":{"line":51,"column":66}},"25":{"start":{"line":55,"column":2},"end":{"line":55,"column":32}},"26":{"start":{"line":59,"column":2},"end":{"line":59,"column":31}},"27":{"start":{"line":63,"column":2},"end":{"line":63,"column":null}},"28":{"start":{"line":63,"column":19},"end":{"line":63,"column":null}},"29":{"start":{"line":65,"column":2},"end":{"line":69,"column":3}},"30":{"start":{"line":66,"column":4},"end":{"line":68,"column":5}},"31":{"start":{"line":67,"column":6},"end":{"line":67,"column":null}},"32":{"start":{"line":71,"column":2},"end":{"line":71,"column":null}},"33":{"start":{"line":74,"column":33},"end":{"line":77,"column":2}},"34":{"start":{"line":83,"column":2},"end":{"line":85,"column":3}},"35":{"start":{"line":84,"column":4},"end":{"line":84,"column":null}},"36":{"start":{"line":87,"column":2},"end":{"line":106,"column":5}},"37":{"start":{"line":90,"column":8},"end":{"line":92,"column":9}},"38":{"start":{"line":91,"column":10},"end":{"line":91,"column":null}},"39":{"start":{"line":93,"column":8},"end":{"line":93,"column":null}},"40":{"start":{"line":98,"column":8},"end":{"line":98,"column":null}},"41":{"start":{"line":103,"column":8},"end":{"line":103,"column":null}},"42":{"start":{"line":110,"column":27},"end":{"line":111,"column":null}},"43":{"start":{"line":111,"column":4},"end":{"line":111,"column":92}},"44":{"start":{"line":114,"column":2},"end":{"line":121,"column":3}},"45":{"start":{"line":115,"column":4},"end":{"line":115,"column":null}},"46":{"start":{"line":117,"column":4},"end":{"line":120,"column":6}},"47":{"start":{"line":125,"column":2},"end":{"line":133,"column":3}},"48":{"start":{"line":126,"column":4},"end":{"line":130,"column":null}},"49":{"start":{"line":132,"column":4},"end":{"line":132,"column":16}},"50":{"start":{"line":137,"column":68},"end":{"line":140,"column":null}},"51":{"start":{"line":142,"column":2},"end":{"line":146,"column":3}},"52":{"start":{"line":143,"column":4},"end":{"line":145,"column":5}},"53":{"start":{"line":144,"column":6},"end":{"line":144,"column":null}},"54":{"start":{"line":148,"column":2},"end":{"line":148,"column":null}},"55":{"start":{"line":163,"column":2},"end":{"line":168,"column":3}},"56":{"start":{"line":167,"column":4},"end":{"line":167,"column":30}},"57":{"start":{"line":169,"column":2},"end":{"line":171,"column":3}},"58":{"start":{"line":170,"column":4},"end":{"line":170,"column":28}},"59":{"start":{"line":172,"column":2},"end":{"line":179,"column":3}},"60":{"start":{"line":178,"column":4},"end":{"line":178,"column":32}},"61":{"start":{"line":180,"column":2},"end":{"line":182,"column":3}},"62":{"start":{"line":181,"column":4},"end":{"line":181,"column":45}},"63":{"start":{"line":184,"column":2},"end":{"line":184,"column":19}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":29,"column":2},"end":{"line":29,"column":21}},"loc":{"start":{"line":29,"column":62},"end":{"line":33,"column":3}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":30,"column":31},"end":{"line":30,"column":32}},"loc":{"start":{"line":30,"column":42},"end":{"line":30,"column":55}}},"2":{"name":"assertValidSDL","decl":{"start":{"line":36,"column":16},"end":{"line":36,"column":30}},"loc":{"start":{"line":36,"column":53},"end":{"line":41,"column":1}}},"3":{"name":"assertValidSchema","decl":{"start":{"line":43,"column":16},"end":{"line":43,"column":33}},"loc":{"start":{"line":43,"column":55},"end":{"line":48,"column":1}}},"4":{"name":"sourceAt","decl":{"start":{"line":50,"column":16},"end":{"line":50,"column":24}},"loc":{"start":{"line":50,"column":43},"end":{"line":52,"column":1}}},"5":{"name":"filePathForNode","decl":{"start":{"line":54,"column":16},"end":{"line":54,"column":31}},"loc":{"start":{"line":54,"column":45},"end":{"line":56,"column":1}}},"6":{"name":"isMetaFieldName","decl":{"start":{"line":58,"column":16},"end":{"line":58,"column":31}},"loc":{"start":{"line":58,"column":44},"end":{"line":60,"column":1}}},"7":{"name":"containsLocalCacheMutationDirective","decl":{"start":{"line":62,"column":16},"end":{"line":62,"column":51}},"loc":{"start":{"line":62,"column":100},"end":{"line":72,"column":1}}},"8":{"name":"transformToNetworkRequestSourceDefinition","decl":{"start":{"line":79,"column":16},"end":{"line":79,"column":57}},"loc":{"start":{"line":81,"column":48},"end":{"line":107,"column":1}}},"9":{"name":"(anonymous_9)","decl":{"start":{"line":89,"column":6},"end":{"line":89,"column":11}},"loc":{"start":{"line":89,"column":45},"end":{"line":94,"column":7}}},"10":{"name":"(anonymous_10)","decl":{"start":{"line":97,"column":6},"end":{"line":97,"column":11}},"loc":{"start":{"line":97,"column":27},"end":{"line":99,"column":7}}},"11":{"name":"(anonymous_11)","decl":{"start":{"line":102,"column":6},"end":{"line":102,"column":11}},"loc":{"start":{"line":102,"column":31},"end":{"line":104,"column":7}}},"12":{"name":"addTypenameFieldToSelectionSetIfNeeded","decl":{"start":{"line":109,"column":9},"end":{"line":109,"column":47}},"loc":{"start":{"line":109,"column":70},"end":{"line":122,"column":1}}},"13":{"name":"(anonymous_13)","decl":{"start":{"line":110,"column":48},"end":{"line":110,"column":49}},"loc":{"start":{"line":111,"column":4},"end":{"line":111,"column":92}}},"14":{"name":"transformTypenameFieldIfNeeded","decl":{"start":{"line":124,"column":9},"end":{"line":124,"column":39}},"loc":{"start":{"line":124,"column":55},"end":{"line":134,"column":1}}},"15":{"name":"stripApolloClientSpecificDirectives","decl":{"start":{"line":136,"column":9},"end":{"line":136,"column":44}},"loc":{"start":{"line":136,"column":64},"end":{"line":149,"column":1}}},"16":{"name":"getFieldDef","decl":{"start":{"line":158,"column":16},"end":{"line":158,"column":27}},"loc":{"start":{"line":161,"column":19},"end":{"line":185,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":38,"column":2},"end":{"line":40,"column":3}},"type":"if","locations":[{"start":{"line":38,"column":2},"end":{"line":40,"column":3}}]},"1":{"loc":{"start":{"line":45,"column":2},"end":{"line":47,"column":3}},"type":"if","locations":[{"start":{"line":45,"column":2},"end":{"line":47,"column":3}}]},"2":{"loc":{"start":{"line":55,"column":9},"end":{"line":55,"column":31}},"type":"cond-expr","locations":[{"start":{"line":55,"column":25},"end":{"line":55,"column":27}},{"start":{"line":55,"column":25},"end":{"line":55,"column":31}}]},"3":{"loc":{"start":{"line":55,"column":9},"end":{"line":55,"column":27}},"type":"binary-expr","locations":[{"start":{"line":55,"column":9},"end":{"line":55,"column":27}},{"start":{"line":55,"column":25},"end":{"line":55,"column":27}}]},"4":{"loc":{"start":{"line":55,"column":9},"end":{"line":55,"column":25}},"type":"cond-expr","locations":[{"start":{"line":55,"column":17},"end":{"line":55,"column":19}},{"start":{"line":55,"column":17},"end":{"line":55,"column":25}}]},"5":{"loc":{"start":{"line":55,"column":9},"end":{"line":55,"column":19}},"type":"binary-expr","locations":[{"start":{"line":55,"column":9},"end":{"line":55,"column":19}},{"start":{"line":55,"column":17},"end":{"line":55,"column":19}}]},"6":{"loc":{"start":{"line":63,"column":2},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":63,"column":2},"end":{"line":63,"column":null}}]},"7":{"loc":{"start":{"line":66,"column":4},"end":{"line":68,"column":5}},"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":68,"column":5}}]},"8":{"loc":{"start":{"line":83,"column":2},"end":{"line":85,"column":3}},"type":"if","locations":[{"start":{"line":83,"column":2},"end":{"line":85,"column":3}}]},"9":{"loc":{"start":{"line":90,"column":8},"end":{"line":92,"column":9}},"type":"if","locations":[{"start":{"line":90,"column":8},"end":{"line":92,"column":9}}]},"10":{"loc":{"start":{"line":90,"column":12},"end":{"line":90,"column":91}},"type":"binary-expr","locations":[{"start":{"line":90,"column":12},"end":{"line":90,"column":26}},{"start":{"line":90,"column":30},"end":{"line":90,"column":91}}]},"11":{"loc":{"start":{"line":111,"column":4},"end":{"line":111,"column":92}},"type":"binary-expr","locations":[{"start":{"line":111,"column":4},"end":{"line":111,"column":40}},{"start":{"line":111,"column":44},"end":{"line":111,"column":92}}]},"12":{"loc":{"start":{"line":114,"column":2},"end":{"line":121,"column":3}},"type":"if","locations":[{"start":{"line":114,"column":2},"end":{"line":121,"column":3}},{"start":{"line":116,"column":9},"end":{"line":121,"column":3}}]},"13":{"loc":{"start":{"line":125,"column":2},"end":{"line":133,"column":3}},"type":"if","locations":[{"start":{"line":125,"column":2},"end":{"line":133,"column":3}},{"start":{"line":131,"column":9},"end":{"line":133,"column":3}}]},"14":{"loc":{"start":{"line":143,"column":4},"end":{"line":145,"column":5}},"type":"if","locations":[{"start":{"line":143,"column":4},"end":{"line":145,"column":5}}]},"15":{"loc":{"start":{"line":163,"column":2},"end":{"line":168,"column":3}},"type":"if","locations":[{"start":{"line":163,"column":2},"end":{"line":168,"column":3}}]},"16":{"loc":{"start":{"line":164,"column":4},"end":{"line":165,"column":40}},"type":"binary-expr","locations":[{"start":{"line":164,"column":4},"end":{"line":164,"column":41}},{"start":{"line":165,"column":4},"end":{"line":165,"column":40}}]},"17":{"loc":{"start":{"line":169,"column":2},"end":{"line":171,"column":3}},"type":"if","locations":[{"start":{"line":169,"column":2},"end":{"line":171,"column":3}}]},"18":{"loc":{"start":{"line":169,"column":6},"end":{"line":169,"column":81}},"type":"binary-expr","locations":[{"start":{"line":169,"column":6},"end":{"line":169,"column":41}},{"start":{"line":169,"column":45},"end":{"line":169,"column":81}}]},"19":{"loc":{"start":{"line":172,"column":2},"end":{"line":179,"column":3}},"type":"if","locations":[{"start":{"line":172,"column":2},"end":{"line":179,"column":3}}]},"20":{"loc":{"start":{"line":173,"column":4},"end":{"line":176,"column":30}},"type":"binary-expr","locations":[{"start":{"line":173,"column":4},"end":{"line":173,"column":43}},{"start":{"line":174,"column":5},"end":{"line":174,"column":29}},{"start":{"line":175,"column":6},"end":{"line":175,"column":33}},{"start":{"line":176,"column":6},"end":{"line":176,"column":29}}]},"21":{"loc":{"start":{"line":180,"column":2},"end":{"line":182,"column":3}},"type":"if","locations":[{"start":{"line":180,"column":2},"end":{"line":182,"column":3}}]},"22":{"loc":{"start":{"line":180,"column":6},"end":{"line":180,"column":61}},"type":"binary-expr","locations":[{"start":{"line":180,"column":6},"end":{"line":180,"column":30}},{"start":{"line":180,"column":34},"end":{"line":180,"column":61}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":0,"14":0,"15":0,"16":0,"17":1,"18":12,"19":12,"20":0,"21":7,"22":7,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":1,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0},"f":{"0":0,"1":0,"2":12,"3":7,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0},"b":{"0":[0],"1":[0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0],"7":[0],"8":[0],"9":[0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0],"15":[0],"16":[0,0],"17":[0],"18":[0,0],"19":[0],"20":[0,0,0,0],"21":[0],"22":[0,0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/index.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/index.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":47}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":30}}},"fnMap":{},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1},"f":{},"b":{}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/legacySafelistingTransform.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/legacySafelistingTransform.ts","statementMap":{"0":{"start":{"line":14,"column":0},"end":{"line":14,"column":16}},"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"2":{"start":{"line":9,"column":22},"end":{"line":12,"column":2}},"3":{"start":{"line":15,"column":2},"end":{"line":54,"column":5}},"4":{"start":{"line":17,"column":6},"end":{"line":32,"column":7}},"5":{"start":{"line":20,"column":8},"end":{"line":20,"column":25}},"6":{"start":{"line":22,"column":8},"end":{"line":31,"column":10}},"7":{"start":{"line":26,"column":14},"end":{"line":28,"column":null}},"8":{"start":{"line":35,"column":6},"end":{"line":43,"column":7}},"9":{"start":{"line":42,"column":8},"end":{"line":42,"column":25}},"10":{"start":{"line":44,"column":6},"end":{"line":44,"column":47}},"11":{"start":{"line":44,"column":30},"end":{"line":44,"column":47}},"12":{"start":{"line":46,"column":6},"end":{"line":52,"column":8}}},"fnMap":{"0":{"name":"addTypeNameFieldForLegacySafelisting","decl":{"start":{"line":14,"column":16},"end":{"line":14,"column":52}},"loc":{"start":{"line":14,"column":65},"end":{"line":55,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":16,"column":4},"end":{"line":16,"column":9}},"loc":{"start":{"line":16,"column":23},"end":{"line":33,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":25,"column":12},"end":{"line":25,"column":13}},"loc":{"start":{"line":26,"column":14},"end":{"line":28,"column":null}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":34,"column":4},"end":{"line":34,"column":9}},"loc":{"start":{"line":34,"column":23},"end":{"line":53,"column":5}}}},"branchMap":{"0":{"loc":{"start":{"line":17,"column":6},"end":{"line":32,"column":7}},"type":"if","locations":[{"start":{"line":17,"column":6},"end":{"line":32,"column":7}},{"start":{"line":21,"column":13},"end":{"line":32,"column":7}}]},"1":{"loc":{"start":{"line":27,"column":16},"end":{"line":28,"column":68}},"type":"binary-expr","locations":[{"start":{"line":27,"column":16},"end":{"line":27,"column":42}},{"start":{"line":28,"column":17},"end":{"line":28,"column":68}}]},"2":{"loc":{"start":{"line":35,"column":6},"end":{"line":43,"column":7}},"type":"if","locations":[{"start":{"line":35,"column":6},"end":{"line":43,"column":7}}]},"3":{"loc":{"start":{"line":37,"column":10},"end":{"line":39,"column":44}},"type":"binary-expr","locations":[{"start":{"line":37,"column":10},"end":{"line":37,"column":34}},{"start":{"line":38,"column":10},"end":{"line":38,"column":48}},{"start":{"line":39,"column":10},"end":{"line":39,"column":44}}]},"4":{"loc":{"start":{"line":44,"column":6},"end":{"line":44,"column":47}},"type":"if","locations":[{"start":{"line":44,"column":6},"end":{"line":44,"column":47}}]}},"s":{"0":1,"1":1,"2":1,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0},"f":{"0":0,"1":0,"2":0,"3":0},"b":{"0":[0,0],"1":[0,0],"2":[0],"3":[0,0,0],"4":[0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/nodeHelpers.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/nodeHelpers.ts","statementMap":{"0":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}},"1":{"start":{"line":10,"column":0},"end":{"line":10,"column":16}},"2":{"start":{"line":17,"column":0},"end":{"line":17,"column":16}},"3":{"start":{"line":26,"column":0},"end":{"line":26,"column":16}},"4":{"start":{"line":37,"column":0},"end":{"line":37,"column":16}},"5":{"start":{"line":44,"column":0},"end":{"line":44,"column":16}},"6":{"start":{"line":1,"column":0},"end":{"line":1,"column":206}},"7":{"start":{"line":4,"column":2},"end":{"line":7,"column":null}},"8":{"start":{"line":11,"column":2},"end":{"line":14,"column":null}},"9":{"start":{"line":18,"column":2},"end":{"line":23,"column":null}},"10":{"start":{"line":27,"column":2},"end":{"line":34,"column":null}},"11":{"start":{"line":32,"column":47},"end":{"line":32,"column":60}},"12":{"start":{"line":33,"column":42},"end":{"line":33,"column":71}},"13":{"start":{"line":38,"column":2},"end":{"line":41,"column":null}},"14":{"start":{"line":45,"column":2},"end":{"line":48,"column":null}}},"fnMap":{"0":{"name":"nameNode","decl":{"start":{"line":3,"column":16},"end":{"line":3,"column":24}},"loc":{"start":{"line":3,"column":37},"end":{"line":8,"column":1}}},"1":{"name":"stringNode","decl":{"start":{"line":10,"column":16},"end":{"line":10,"column":26}},"loc":{"start":{"line":10,"column":40},"end":{"line":15,"column":1}}},"2":{"name":"inputValueDefinitionNode","decl":{"start":{"line":17,"column":16},"end":{"line":17,"column":40}},"loc":{"start":{"line":17,"column":61},"end":{"line":24,"column":1}}},"3":{"name":"definitionNode","decl":{"start":{"line":26,"column":16},"end":{"line":26,"column":30}},"loc":{"start":{"line":26,"column":59},"end":{"line":35,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":32,"column":40},"end":{"line":32,"column":43}},"loc":{"start":{"line":32,"column":47},"end":{"line":32,"column":60}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":33,"column":35},"end":{"line":33,"column":38}},"loc":{"start":{"line":33,"column":42},"end":{"line":33,"column":71}}},"6":{"name":"typeNode","decl":{"start":{"line":37,"column":16},"end":{"line":37,"column":24}},"loc":{"start":{"line":37,"column":47},"end":{"line":42,"column":1}}},"7":{"name":"nonNullNode","decl":{"start":{"line":44,"column":16},"end":{"line":44,"column":27}},"loc":{"start":{"line":44,"column":62},"end":{"line":49,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":17},"end":{"line":29,"column":88}},"type":"cond-expr","locations":[{"start":{"line":29,"column":42},"end":{"line":29,"column":76}},{"start":{"line":29,"column":79},"end":{"line":29,"column":88}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":108,"8":44,"9":24,"10":12,"11":24,"12":24,"13":28,"14":4},"f":{"0":108,"1":44,"2":24,"3":12,"4":24,"5":24,"6":28,"7":4},"b":{"0":[12,0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/predicates.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/predicates.ts","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}},"1":{"start":{"line":7,"column":0},"end":{"line":7,"column":16}},"2":{"start":{"line":4,"column":2},"end":{"line":4,"column":56}},"3":{"start":{"line":8,"column":2},"end":{"line":13,"column":4}}},"fnMap":{"0":{"name":"isNotNullOrUndefined","decl":{"start":{"line":1,"column":16},"end":{"line":1,"column":36}},"loc":{"start":{"line":2,"column":29},"end":{"line":5,"column":1}}},"1":{"name":"isObject","decl":{"start":{"line":7,"column":16},"end":{"line":7,"column":24}},"loc":{"start":{"line":7,"column":35},"end":{"line":14,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":55}},"type":"binary-expr","locations":[{"start":{"line":4,"column":9},"end":{"line":4,"column":23}},{"start":{"line":4,"column":27},"end":{"line":4,"column":55}}]},"1":{"loc":{"start":{"line":9,"column":4},"end":{"line":12,"column":25}},"type":"binary-expr","locations":[{"start":{"line":9,"column":4},"end":{"line":9,"column":23}},{"start":{"line":10,"column":4},"end":{"line":10,"column":18}},{"start":{"line":11,"column":4},"end":{"line":11,"column":29}},{"start":{"line":12,"column":4},"end":{"line":12,"column":25}}]}},"s":{"0":1,"1":1,"2":0,"3":0},"f":{"0":0,"1":0},"b":{"0":[0,0],"1":[0,0,0,0]}} -,"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/typePolicyDirective.ts": {"path":"/Users/zachfettersmoore/Documents/Git/apollo-ios-dev/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/typePolicyDirective.ts","statementMap":{"0":{"start":{"line":147,"column":0},"end":{"line":147,"column":16}},"1":{"start":{"line":167,"column":0},"end":{"line":167,"column":16}},"2":{"start":{"line":1,"column":0},"end":{"line":1,"column":null}},"3":{"start":{"line":15,"column":0},"end":{"line":15,"column":70}},"4":{"start":{"line":17,"column":22},"end":{"line":17,"column":53}},"5":{"start":{"line":28,"column":2},"end":{"line":41,"column":4}},"6":{"start":{"line":31,"column":8},"end":{"line":31,"column":74}},"7":{"start":{"line":37,"column":8},"end":{"line":37,"column":74}},"8":{"start":{"line":47,"column":2},"end":{"line":49,"column":3}},"9":{"start":{"line":48,"column":4},"end":{"line":48,"column":21}},"10":{"start":{"line":51,"column":2},"end":{"line":58,"column":3}},"11":{"start":{"line":52,"column":22},"end":{"line":53,"column":null}},"12":{"start":{"line":53,"column":13},"end":{"line":53,"column":43}},"13":{"start":{"line":55,"column":4},"end":{"line":57,"column":5}},"14":{"start":{"line":56,"column":6},"end":{"line":56,"column":41}},"15":{"start":{"line":61,"column":2},"end":{"line":66,"column":3}},"16":{"start":{"line":62,"column":4},"end":{"line":65,"column":5}},"17":{"start":{"line":63,"column":6},"end":{"line":63,"column":43}},"18":{"start":{"line":64,"column":6},"end":{"line":64,"column":12}},"19":{"start":{"line":68,"column":2},"end":{"line":89,"column":3}},"20":{"start":{"line":69,"column":4},"end":{"line":88,"column":5}},"21":{"start":{"line":70,"column":20},"end":{"line":70,"column":57}},"22":{"start":{"line":71,"column":6},"end":{"line":71,"column":27}},"23":{"start":{"line":71,"column":18},"end":{"line":71,"column":27}},"24":{"start":{"line":73,"column":6},"end":{"line":87,"column":7}},"25":{"start":{"line":74,"column":8},"end":{"line":74,"column":23}},"26":{"start":{"line":75,"column":13},"end":{"line":87,"column":7}},"27":{"start":{"line":76,"column":8},"end":{"line":86,"column":9}},"28":{"start":{"line":77,"column":10},"end":{"line":80,"column":12}},"29":{"start":{"line":82,"column":10},"end":{"line":85,"column":12}},"30":{"start":{"line":91,"column":2},"end":{"line":91,"column":16}},"31":{"start":{"line":98,"column":38},"end":{"line":98,"column":44}},"32":{"start":{"line":100,"column":2},"end":{"line":102,"column":3}},"33":{"start":{"line":101,"column":4},"end":{"line":101,"column":11}},"34":{"start":{"line":104,"column":16},"end":{"line":104,"column":62}},"35":{"start":{"line":106,"column":18},"end":{"line":106,"column":34}},"36":{"start":{"line":107,"column":2},"end":{"line":144,"column":3}},"37":{"start":{"line":108,"column":4},"end":{"line":113,"column":5}},"38":{"start":{"line":109,"column":6},"end":{"line":112,"column":8}},"39":{"start":{"line":115,"column":24},"end":{"line":115,"column":43}},"40":{"start":{"line":116,"column":4},"end":{"line":121,"column":5}},"41":{"start":{"line":117,"column":6},"end":{"line":120,"column":8}},"42":{"start":{"line":123,"column":4},"end":{"line":132,"column":5}},"43":{"start":{"line":124,"column":6},"end":{"line":131,"column":8}},"44":{"start":{"line":134,"column":4},"end":{"line":143,"column":5}},"45":{"start":{"line":135,"column":6},"end":{"line":142,"column":8}},"46":{"start":{"line":148,"column":17},"end":{"line":148,"column":45}},"47":{"start":{"line":149,"column":2},"end":{"line":151,"column":3}},"48":{"start":{"line":150,"column":4},"end":{"line":150,"column":14}},"49":{"start":{"line":153,"column":24},"end":{"line":155,"column":10}},"50":{"start":{"line":154,"column":11},"end":{"line":154,"column":39}},"51":{"start":{"line":156,"column":2},"end":{"line":158,"column":3}},"52":{"start":{"line":157,"column":4},"end":{"line":157,"column":14}},"53":{"start":{"line":160,"column":17},"end":{"line":160,"column":47}},"54":{"start":{"line":162,"column":2},"end":{"line":162,"column":36}},"55":{"start":{"line":164,"column":2},"end":{"line":164,"column":16}},"56":{"start":{"line":168,"column":16},"end":{"line":168,"column":35}},"57":{"start":{"line":170,"column":2},"end":{"line":176,"column":3}},"58":{"start":{"line":171,"column":17},"end":{"line":171,"column":27}},"59":{"start":{"line":173,"column":4},"end":{"line":175,"column":5}},"60":{"start":{"line":174,"column":7},"end":{"line":174,"column":58}}},"fnMap":{"0":{"name":"matchDirectiveArguments","decl":{"start":{"line":24,"column":9},"end":{"line":24,"column":32}},"loc":{"start":{"line":26,"column":23},"end":{"line":42,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":30,"column":11},"end":{"line":30,"column":12}},"loc":{"start":{"line":31,"column":8},"end":{"line":31,"column":74}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":36,"column":11},"end":{"line":36,"column":12}},"loc":{"start":{"line":37,"column":8},"end":{"line":37,"column":74}}},"3":{"name":"typePolicyDirectiveFor","decl":{"start":{"line":44,"column":9},"end":{"line":44,"column":31}},"loc":{"start":{"line":45,"column":28},"end":{"line":92,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":53,"column":6},"end":{"line":53,"column":7}},"loc":{"start":{"line":53,"column":13},"end":{"line":53,"column":43}}},"5":{"name":"validateKeyFields","decl":{"start":{"line":94,"column":9},"end":{"line":94,"column":26}},"loc":{"start":{"line":96,"column":21},"end":{"line":145,"column":1}}},"6":{"name":"keyFieldsFor","decl":{"start":{"line":147,"column":16},"end":{"line":147,"column":28}},"loc":{"start":{"line":147,"column":55},"end":{"line":165,"column":1}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":154,"column":4},"end":{"line":154,"column":5}},"loc":{"start":{"line":154,"column":11},"end":{"line":154,"column":39}}},"8":{"name":"addTypePolicyDirectivesToSchema","decl":{"start":{"line":167,"column":16},"end":{"line":167,"column":47}},"loc":{"start":{"line":167,"column":69},"end":{"line":177,"column":1}}}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":5},"end":{"line":29,"column":26}},"type":"cond-expr","locations":[{"start":{"line":29,"column":20},"end":{"line":29,"column":24}},{"start":{"line":29,"column":24},"end":{"line":29,"column":26}}]},"1":{"loc":{"start":{"line":29,"column":5},"end":{"line":29,"column":24}},"type":"binary-expr","locations":[{"start":{"line":29,"column":5},"end":{"line":29,"column":24}},{"start":{"line":29,"column":20},"end":{"line":29,"column":24}}]},"2":{"loc":{"start":{"line":35,"column":5},"end":{"line":35,"column":27}},"type":"cond-expr","locations":[{"start":{"line":35,"column":21},"end":{"line":35,"column":25}},{"start":{"line":35,"column":25},"end":{"line":35,"column":27}}]},"3":{"loc":{"start":{"line":35,"column":5},"end":{"line":35,"column":25}},"type":"binary-expr","locations":[{"start":{"line":35,"column":5},"end":{"line":35,"column":25}},{"start":{"line":35,"column":21},"end":{"line":35,"column":25}}]},"4":{"loc":{"start":{"line":47,"column":2},"end":{"line":49,"column":3}},"type":"if","locations":[{"start":{"line":47,"column":2},"end":{"line":49,"column":3}}]},"5":{"loc":{"start":{"line":51,"column":26},"end":{"line":51,"column":54}},"type":"cond-expr","locations":[{"start":{"line":51,"column":48},"end":{"line":51,"column":52}},{"start":{"line":51,"column":52},"end":{"line":51,"column":54}}]},"6":{"loc":{"start":{"line":51,"column":26},"end":{"line":51,"column":52}},"type":"binary-expr","locations":[{"start":{"line":51,"column":26},"end":{"line":51,"column":52}},{"start":{"line":51,"column":48},"end":{"line":51,"column":52}}]},"7":{"loc":{"start":{"line":52,"column":22},"end":{"line":53,"column":null}},"type":"cond-expr","locations":[{"start":{"line":52,"column":42},"end":{"line":52,"column":44}},{"start":{"line":52,"column":42},"end":{"line":53,"column":null}}]},"8":{"loc":{"start":{"line":52,"column":22},"end":{"line":52,"column":44}},"type":"binary-expr","locations":[{"start":{"line":52,"column":22},"end":{"line":52,"column":44}},{"start":{"line":52,"column":42},"end":{"line":52,"column":44}}]},"9":{"loc":{"start":{"line":55,"column":4},"end":{"line":57,"column":5}},"type":"if","locations":[{"start":{"line":55,"column":4},"end":{"line":57,"column":5}}]},"10":{"loc":{"start":{"line":61,"column":26},"end":{"line":61,"column":56}},"type":"cond-expr","locations":[{"start":{"line":61,"column":50},"end":{"line":61,"column":54}},{"start":{"line":61,"column":54},"end":{"line":61,"column":56}}]},"11":{"loc":{"start":{"line":61,"column":26},"end":{"line":61,"column":54}},"type":"binary-expr","locations":[{"start":{"line":61,"column":26},"end":{"line":61,"column":54}},{"start":{"line":61,"column":50},"end":{"line":61,"column":54}}]},"12":{"loc":{"start":{"line":61,"column":26},"end":{"line":61,"column":50}},"type":"cond-expr","locations":[{"start":{"line":61,"column":38},"end":{"line":61,"column":40}},{"start":{"line":61,"column":38},"end":{"line":61,"column":50}}]},"13":{"loc":{"start":{"line":61,"column":26},"end":{"line":61,"column":40}},"type":"binary-expr","locations":[{"start":{"line":61,"column":26},"end":{"line":61,"column":40}},{"start":{"line":61,"column":38},"end":{"line":61,"column":40}}]},"14":{"loc":{"start":{"line":62,"column":4},"end":{"line":65,"column":5}},"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":65,"column":5}}]},"15":{"loc":{"start":{"line":68,"column":2},"end":{"line":89,"column":3}},"type":"if","locations":[{"start":{"line":68,"column":2},"end":{"line":89,"column":3}}]},"16":{"loc":{"start":{"line":71,"column":6},"end":{"line":71,"column":27}},"type":"if","locations":[{"start":{"line":71,"column":6},"end":{"line":71,"column":27}}]},"17":{"loc":{"start":{"line":73,"column":6},"end":{"line":87,"column":7}},"type":"if","locations":[{"start":{"line":73,"column":6},"end":{"line":87,"column":7}},{"start":{"line":75,"column":13},"end":{"line":87,"column":7}}]},"18":{"loc":{"start":{"line":75,"column":13},"end":{"line":87,"column":7}},"type":"if","locations":[{"start":{"line":75,"column":13},"end":{"line":87,"column":7}}]},"19":{"loc":{"start":{"line":76,"column":8},"end":{"line":86,"column":9}},"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":86,"column":9}},{"start":{"line":81,"column":15},"end":{"line":86,"column":9}}]},"20":{"loc":{"start":{"line":100,"column":2},"end":{"line":102,"column":3}},"type":"if","locations":[{"start":{"line":100,"column":2},"end":{"line":102,"column":3}}]},"21":{"loc":{"start":{"line":104,"column":16},"end":{"line":104,"column":62}},"type":"cond-expr","locations":[{"start":{"line":104,"column":40},"end":{"line":104,"column":51}},{"start":{"line":104,"column":54},"end":{"line":104,"column":62}}]},"22":{"loc":{"start":{"line":108,"column":4},"end":{"line":113,"column":5}},"type":"if","locations":[{"start":{"line":108,"column":4},"end":{"line":113,"column":5}}]},"23":{"loc":{"start":{"line":116,"column":4},"end":{"line":121,"column":5}},"type":"if","locations":[{"start":{"line":116,"column":4},"end":{"line":121,"column":5}}]},"24":{"loc":{"start":{"line":119,"column":17},"end":{"line":119,"column":69}},"type":"cond-expr","locations":[{"start":{"line":119,"column":32},"end":{"line":119,"column":57}},{"start":{"line":119,"column":60},"end":{"line":119,"column":69}}]},"25":{"loc":{"start":{"line":123,"column":4},"end":{"line":132,"column":5}},"type":"if","locations":[{"start":{"line":123,"column":4},"end":{"line":132,"column":5}}]},"26":{"loc":{"start":{"line":127,"column":17},"end":{"line":129,"column":23}},"type":"cond-expr","locations":[{"start":{"line":128,"column":14},"end":{"line":128,"column":46}},{"start":{"line":129,"column":14},"end":{"line":129,"column":23}}]},"27":{"loc":{"start":{"line":134,"column":4},"end":{"line":143,"column":5}},"type":"if","locations":[{"start":{"line":134,"column":4},"end":{"line":143,"column":5}}]},"28":{"loc":{"start":{"line":138,"column":17},"end":{"line":140,"column":23}},"type":"cond-expr","locations":[{"start":{"line":139,"column":14},"end":{"line":139,"column":46}},{"start":{"line":140,"column":14},"end":{"line":140,"column":23}}]},"29":{"loc":{"start":{"line":149,"column":2},"end":{"line":151,"column":3}},"type":"if","locations":[{"start":{"line":149,"column":2},"end":{"line":151,"column":3}}]},"30":{"loc":{"start":{"line":153,"column":24},"end":{"line":155,"column":10}},"type":"cond-expr","locations":[{"start":{"line":155,"column":3},"end":{"line":155,"column":5}},{"start":{"line":155,"column":3},"end":{"line":155,"column":10}}]},"31":{"loc":{"start":{"line":153,"column":24},"end":{"line":155,"column":5}},"type":"binary-expr","locations":[{"start":{"line":153,"column":24},"end":{"line":155,"column":5}},{"start":{"line":155,"column":3},"end":{"line":155,"column":5}}]},"32":{"loc":{"start":{"line":153,"column":24},"end":{"line":154,"column":null}},"type":"cond-expr","locations":[{"start":{"line":153,"column":51},"end":{"line":153,"column":53}},{"start":{"line":153,"column":51},"end":{"line":154,"column":null}}]},"33":{"loc":{"start":{"line":153,"column":24},"end":{"line":153,"column":53}},"type":"binary-expr","locations":[{"start":{"line":153,"column":24},"end":{"line":153,"column":53}},{"start":{"line":153,"column":51},"end":{"line":153,"column":53}}]},"34":{"loc":{"start":{"line":153,"column":24},"end":{"line":153,"column":51}},"type":"cond-expr","locations":[{"start":{"line":153,"column":40},"end":{"line":153,"column":42}},{"start":{"line":153,"column":40},"end":{"line":153,"column":51}}]},"35":{"loc":{"start":{"line":153,"column":24},"end":{"line":153,"column":42}},"type":"binary-expr","locations":[{"start":{"line":153,"column":24},"end":{"line":153,"column":42}},{"start":{"line":153,"column":40},"end":{"line":153,"column":42}}]},"36":{"loc":{"start":{"line":156,"column":2},"end":{"line":158,"column":3}},"type":"if","locations":[{"start":{"line":156,"column":2},"end":{"line":158,"column":3}}]},"37":{"loc":{"start":{"line":156,"column":6},"end":{"line":156,"column":58}},"type":"binary-expr","locations":[{"start":{"line":156,"column":6},"end":{"line":156,"column":20}},{"start":{"line":156,"column":24},"end":{"line":156,"column":58}}]},"38":{"loc":{"start":{"line":173,"column":4},"end":{"line":175,"column":5}},"type":"if","locations":[{"start":{"line":173,"column":4},"end":{"line":175,"column":5}}]},"39":{"loc":{"start":{"line":173,"column":8},"end":{"line":173,"column":81}},"type":"binary-expr","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":41}},{"start":{"line":173,"column":45},"end":{"line":173,"column":81}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":0,"6":0,"7":0,"8":101,"9":0,"10":101,"11":12,"12":12,"13":12,"14":0,"15":101,"16":5,"17":0,"18":0,"19":101,"20":101,"21":4,"22":4,"23":4,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":101,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":97,"47":97,"48":97,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":12,"57":12,"58":158,"59":158,"60":97},"f":{"0":0,"1":0,"2":0,"3":101,"4":12,"5":0,"6":97,"7":0,"8":12},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0],"5":[101,0],"6":[101,101],"7":[0,12],"8":[12,12],"9":[0],"10":[5,96],"11":[101,101],"12":[72,29],"13":[101,101],"14":[0],"15":[101],"16":[4],"17":[0,0],"18":[0],"19":[0,0],"20":[0],"21":[0,0],"22":[0],"23":[0],"24":[0,0],"25":[0],"26":[0,0],"27":[0],"28":[0,0],"29":[97],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0],"37":[0,0],"38":[97],"39":[158,66]}} -} diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/base.css b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/base.css deleted file mode 100644 index f418035b4..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/base.css +++ /dev/null @@ -1,224 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* yellow */ -.cbranch-no { background: yellow !important; color: #111; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -.highlighted, -.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ - background: #C21F39 !important; -} -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -.medium .chart { border:1px solid #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } - -.coverage-summary td.empty { - opacity: .5; - padding-top: 4px; - padding-bottom: 4px; - line-height: 1; - color: #888; -} - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/block-navigation.js b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/block-navigation.js deleted file mode 100644 index cc1213023..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/block-navigation.js +++ /dev/null @@ -1,87 +0,0 @@ -/* eslint-disable */ -var jumpToCode = (function init() { - // Classes of code we would like to highlight in the file view - var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; - - // Elements to highlight in the file listing view - var fileListingElements = ['td.pct.low']; - - // We don't want to select elements that are direct descendants of another match - var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` - - // Selecter that finds elements on the page to which we can jump - var selector = - fileListingElements.join(', ') + - ', ' + - notSelector + - missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` - - // The NodeList of matching elements - var missingCoverageElements = document.querySelectorAll(selector); - - var currentIndex; - - function toggleClass(index) { - missingCoverageElements - .item(currentIndex) - .classList.remove('highlighted'); - missingCoverageElements.item(index).classList.add('highlighted'); - } - - function makeCurrent(index) { - toggleClass(index); - currentIndex = index; - missingCoverageElements.item(index).scrollIntoView({ - behavior: 'smooth', - block: 'center', - inline: 'center' - }); - } - - function goToPrevious() { - var nextIndex = 0; - if (typeof currentIndex !== 'number' || currentIndex === 0) { - nextIndex = missingCoverageElements.length - 1; - } else if (missingCoverageElements.length > 1) { - nextIndex = currentIndex - 1; - } - - makeCurrent(nextIndex); - } - - function goToNext() { - var nextIndex = 0; - - if ( - typeof currentIndex === 'number' && - currentIndex < missingCoverageElements.length - 1 - ) { - nextIndex = currentIndex + 1; - } - - makeCurrent(nextIndex); - } - - return function jump(event) { - if ( - document.getElementById('fileSearch') === document.activeElement && - document.activeElement != null - ) { - // if we're currently focused on the search input, we don't want to navigate - return; - } - - switch (event.which) { - case 78: // n - case 74: // j - goToNext(); - break; - case 66: // b - case 75: // k - case 80: // p - goToPrevious(); - break; - } - }; -})(); -window.addEventListener('keydown', jumpToCode); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/favicon.png b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/favicon.png deleted file mode 100644 index c1525b811a167671e9de1fa78aab9f5c0b61cef7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 445 zcmV;u0Yd(XP))rP{nL}Ln%S7`m{0DjX9TLF* zFCb$4Oi7vyLOydb!7n&^ItCzb-%BoB`=x@N2jll2Nj`kauio%aw_@fe&*}LqlFT43 z8doAAe))z_%=P%v^@JHp3Hjhj^6*Kr_h|g_Gr?ZAa&y>wxHE99Gk>A)2MplWz2xdG zy8VD2J|Uf#EAw*bo5O*PO_}X2Tob{%bUoO2G~T`@%S6qPyc}VkhV}UifBuRk>%5v( z)x7B{I~z*k<7dv#5tC+m{km(D087J4O%+<<;K|qwefb6@GSX45wCK}Sn*> - - - - Code coverage report for All files - - - - - - - - - -
-
-

All files

-
- -
- 37.43% - Statements - 216/577 -
- - -
- 23% - Branches - 98/426 -
- - -
- 25.61% - Functions - 31/121 -
- - -
- 37.78% - Lines - 212/561 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
src -
-
42.99%46/1075.12%2/392.94%1/3442.45%45/106
src/compiler -
-
3.74%7/1870%0/1540%0/223.88%7/180
src/utilities -
-
57.59%163/28341.2%96/23346.15%30/6558.18%160/275
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.css b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7cda..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.js b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.js deleted file mode 100644 index b3225238f..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/prettify.js +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sort-arrow-sprite.png b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 6ed68316eb3f65dec9063332d2f69bf3093bbfab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qh}Z>jv*C{$p!i!8j}?a+@3A= zIAGwzjijN=FBi!|L1t?LM;Q;gkwn>2cAy-KV{dn nf0J1DIvEHQu*n~6U}x}qyky7vi4|9XhBJ7&`njxgN@xNA8m%nc diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sorter.js b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sorter.js deleted file mode 100644 index 2bb296a8c..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/sorter.js +++ /dev/null @@ -1,196 +0,0 @@ -/* eslint-disable */ -var addSorting = (function() { - 'use strict'; - var cols, - currentSort = { - index: 0, - desc: false - }; - - // returns the summary table element - function getTable() { - return document.querySelector('.coverage-summary'); - } - // returns the thead element of the summary table - function getTableHeader() { - return getTable().querySelector('thead tr'); - } - // returns the tbody element of the summary table - function getTableBody() { - return getTable().querySelector('tbody'); - } - // returns the th element for nth column - function getNthColumn(n) { - return getTableHeader().querySelectorAll('th')[n]; - } - - function onFilterInput() { - const searchValue = document.getElementById('fileSearch').value; - const rows = document.getElementsByTagName('tbody')[0].children; - for (let i = 0; i < rows.length; i++) { - const row = rows[i]; - if ( - row.textContent - .toLowerCase() - .includes(searchValue.toLowerCase()) - ) { - row.style.display = ''; - } else { - row.style.display = 'none'; - } - } - } - - // loads the search box - function addSearchBox() { - var template = document.getElementById('filterTemplate'); - var templateClone = template.content.cloneNode(true); - templateClone.getElementById('fileSearch').oninput = onFilterInput; - template.parentElement.appendChild(templateClone); - } - - // loads all columns - function loadColumns() { - var colNodes = getTableHeader().querySelectorAll('th'), - colNode, - cols = [], - col, - i; - - for (i = 0; i < colNodes.length; i += 1) { - colNode = colNodes[i]; - col = { - key: colNode.getAttribute('data-col'), - sortable: !colNode.getAttribute('data-nosort'), - type: colNode.getAttribute('data-type') || 'string' - }; - cols.push(col); - if (col.sortable) { - col.defaultDescSort = col.type === 'number'; - colNode.innerHTML = - colNode.innerHTML + ''; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function(a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function(a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc - ? ' sorted-desc' - : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function() { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i = 0; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function() { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(); - addSearchBox(); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.html deleted file mode 100644 index 28089819f..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - Code coverage report for src/compiler - - - - - - - - - -
-
-

All files src/compiler

-
- -
- 3.74% - Statements - 7/187 -
- - -
- 0% - Branches - 0/154 -
- - -
- 0% - Functions - 0/22 -
- - -
- 3.88% - Lines - 7/180 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.ts -
-
2.8%5/1780%0/1500%0/202.92%5/171
values.ts -
-
22.22%2/90%0/40%0/222.22%2/9
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.ts.html deleted file mode 100644 index 6416f4c8e..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/index.ts.html +++ /dev/null @@ -1,1720 +0,0 @@ - - - - - - Code coverage report for src/compiler/index.ts - - - - - - - - - -
-
-

All files / src/compiler index.ts

-
- -
- 2.8% - Statements - 5/178 -
- - -
- 0% - Branches - 0/150 -
- - -
- 0% - Functions - 0/20 -
- - -
- 2.92% - Lines - 5/171 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -5461x -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import {
-  containsLocalCacheMutationDirective,
-  getFieldDef,
-  isMetaFieldName,
-  isNotNullOrUndefined,
-  transformToNetworkRequestSourceDefinition,
-} from "../utilities";
-import {
-  ArgumentNode,
-  ASTNode,
-  DocumentNode,
-  DirectiveNode,
-  FragmentDefinitionNode,
-  getNamedType,
-  GraphQLArgument,
-  GraphQLCompositeType,
-  GraphQLDirective,
-  GraphQLError,
-  GraphQLField,
-  GraphQLInputObjectType,
-  GraphQLNamedType,
-  GraphQLObjectType,
-  GraphQLSchema,
-  GraphQLType,
-  isCompositeType,
-  isInputObjectType,
-  isUnionType,
-  Kind,
-  OperationDefinitionNode,
-  print,
-  SelectionNode,
-  SelectionSetNode,
-  typeFromAST,
-  isObjectType,
-  isInterfaceType,
-  isListType,
-  isNonNullType,
-  FieldNode,
-} from "graphql";
-import * as ir from "./ir";
-import { valueFromValueNode } from "./values";
-import { ValidationOptions } from "../validationRules";
-import { directive_typePolicy } from "../utilities/apolloCodegenSchemaExtension";
- 
-function filePathForNode(node: ASTNode): string | undefined {
-  return node.loc?.source?.name;
-}
- 
-export interface CompilationResult {
-  rootTypes: ir.RootTypeDefinition;
-  operations: ir.OperationDefinition[];
-  fragments: ir.FragmentDefinition[];
-  referencedTypes: GraphQLNamedType[];
-  schemaDocumentation: string | undefined;
-}
- 
-export function compileToIR(
-  schema: GraphQLSchema,
-  document: DocumentNode,
-  legacySafelistingCompatibleOperations: boolean,
-  reduceGeneratedSchemaTypes: boolean,
-  validationOptions: ValidationOptions
-): CompilationResult {
-  // Collect fragment definition nodes upfront so we can compile these as we encounter them.
-  const fragmentNodeMap = new Map<String, FragmentDefinitionNode>();
- 
-  for (const definitionNode of document.definitions) {
-    Iif (definitionNode.kind !== Kind.FRAGMENT_DEFINITION) continue;
- 
-    fragmentNodeMap.set(definitionNode.name.value, definitionNode);
-  }
- 
-  const operations: ir.OperationDefinition[] = [];
-  const fragmentMap = new Map<String, ir.FragmentDefinition>();
-  const referencedTypes = new Set<GraphQLNamedType>();
-  const reduceSchemaTypes: boolean = reduceGeneratedSchemaTypes
- 
-  const queryType = schema.getQueryType() as GraphQLNamedType;
-  Iif (queryType === undefined) {
-    throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.", { });
-  }
- 
-  const rootTypes: ir.RootTypeDefinition = {
-    queryType: queryType,
-    mutationType: schema.getMutationType() ?? undefined,
-    subscriptionType: schema.getSubscriptionType() ?? undefined
-  };
- 
-  for (const definitionNode of document.definitions) {
-    Iif (definitionNode.kind !== Kind.OPERATION_DEFINITION) continue;
- 
-    operations.push(compileOperation(definitionNode));
-  }
- 
-  // We should have encountered all fragments because GraphQL validation normally makes sure
-  // there are no unused fragments in the document. But to allow for situations where you want that
-  // validation rule removed, we compile the remaining ones separately.
- 
-  for (const [name, fragmentNode] of fragmentNodeMap.entries()) {
-    fragmentMap.set(name, compileFragment(fragmentNode));
-  }
- 
-  return {
-    rootTypes: rootTypes,
-    operations: operations,
-    fragments: Array.from(fragmentMap.values()),
-    referencedTypes: Array.from(referencedTypes.values()),
-    schemaDocumentation: schema.description ?? undefined
-  };
- 
-  function addReferencedType(type: GraphQLNamedType) {
-    Iif (referencedTypes.has(type)) { return }
- 
-    referencedTypes.add(type)
-    
-    Iif (isInterfaceType(type)) {
-      const possibleTypes = schema.getPossibleTypes(type);
- 
-      (type as any)._implementingObjects = possibleTypes;
- 
-      for (const objectType of possibleTypes) {
-        Iif (!reduceSchemaTypes || hasTypePolicyDirective(objectType)) {
-          addReferencedType(getNamedType(objectType))
-        }
-      }
-    }
- 
-    Iif (isUnionType(type)) {
-      const unionReferencedTypes = type.getTypes()
-      for (type of unionReferencedTypes) {
-        addReferencedType(getNamedType(type))
-      }
-    }
- 
-    Iif (isInputObjectType(type)) {
-      addReferencedTypesFromInputObject(type)
-    }
- 
-    Iif (isObjectType(type)) {
-      for (const interfaceType of type.getInterfaces()) {
-        addReferencedType(getNamedType(interfaceType))
-      }
-    }
-  }
- 
-  function addReferencedTypesFromInputObject(
-    inputObject: GraphQLInputObjectType
-  ) {
-    const fieldMap = inputObject.getFields()
-    for (const key in fieldMap) {
-      const field = fieldMap[key]
-      addReferencedType(getNamedType(field.type))
-    }
-  }
- 
-  function hasTypePolicyDirective(
-    type: GraphQLCompositeType
-  ): boolean {
-    const directiveName = directive_typePolicy.name.value;
-    for (const directive of type.astNode?.directives ?? []) {
-      Iif (directive.name.value === directiveName) {
-        return true;
-      }
-    }
-    return false;
-  }
- 
-  function getFragment(name: string): ir.FragmentDefinition | undefined {
-    let fragment = fragmentMap.get(name);
-    Iif (fragment) return fragment;
- 
-    const fragmentNode = fragmentNodeMap.get(name);
-    Iif (!fragmentNode) return undefined;
- 
-    // Remove the fragment node from the map so we know which ones we haven't encountered yet.
-    fragmentNodeMap.delete(name);
- 
-    fragment = compileFragment(fragmentNode);
-    fragmentMap.set(name, fragment);
-    return fragment;
-  }
- 
-  function compileOperation(
-    operationDefinition: OperationDefinitionNode
-  ): ir.OperationDefinition {
-    Iif (!operationDefinition.name) {
-      throw new GraphQLError("Operations should be named", { nodes: operationDefinition });
-    }
- 
-    const filePath = filePathForNode(operationDefinition);
-    const name = operationDefinition.name.value;
-    const operationType = operationDefinition.operation;
-    const referencedFragments = new Set<ir.FragmentDefinition>();
- 
-    const variables = (operationDefinition.variableDefinitions || []).map(
-      (node) => {
-        const name = node.variable.name.value;
-        const defaultValue = node.defaultValue ? valueFromValueNode(node.defaultValue) : undefined
- 
-        // The casts are a workaround for the lack of support for passing a type union
-        // to overloaded functions in TypeScript.
-        // See https://github.com/microsoft/TypeScript/issues/14107
-        const type = typeFromAST(schema, node.type as any) as GraphQLType;
- 
-        // `typeFromAST` returns `undefined` when a named type is not found
-        // in the schema.
-        Iif (!type) {
-          throw new GraphQLError(
-            `Couldn't get type from type node "${node.type}"`,
-            { nodes: node }
-          );
-        }
- 
-        addReferencedType(getNamedType(type));
- 
-        return {
-          name,
-          type,
-          defaultValue
-        };
-      }
-    );
- 
-    const source = print(transformToNetworkRequestSourceDefinition(
-      operationDefinition,
-      legacySafelistingCompatibleOperations
-    ));
-    const rootType = schema.getRootType(operationType) as GraphQLObjectType;
-    const [directives,] = compileDirectives(operationDefinition.directives) ?? [undefined, undefined];
- 
-    addReferencedType(rootType)
- 
-    const selectionSet = compileSelectionSet(operationDefinition.selectionSet, rootType, referencedFragments)
-    const referencedFragmentsArray = Array.from(referencedFragments.values())
- 
-    Iif (containsLocalCacheMutationDirective(operationDefinition.directives)) {
-      overrideAsLocalCacheMutation(referencedFragmentsArray);
-    }
- 
-    return {
-      name,
-      operationType,
-      variables,
-      rootType,
-      selectionSet: selectionSet,
-      directives: directives,
-      referencedFragments: referencedFragmentsArray,
-      source,
-      filePath
-    };
-  }
- 
-  function compileFragment(
-    fragmentDefinition: FragmentDefinitionNode
-  ): ir.FragmentDefinition {
-    const name = fragmentDefinition.name.value;
- 
-    const filePath = filePathForNode(fragmentDefinition);
-    const source = print(transformToNetworkRequestSourceDefinition(
-      fragmentDefinition,
-      legacySafelistingCompatibleOperations
-    ));
-    const referencedFragments = new Set<ir.FragmentDefinition>();
- 
-    const typeCondition = typeFromAST(
-      schema,
-      fragmentDefinition.typeCondition
-    ) as GraphQLCompositeType;
- 
-    const [directives,] = compileDirectives(fragmentDefinition.directives) ?? [undefined, undefined];
- 
-    addReferencedType(getNamedType(typeCondition));
- 
-    const selectionSet = compileSelectionSet(fragmentDefinition.selectionSet, typeCondition, referencedFragments)
-    const referencedFragmentsArray = Array.from(referencedFragments.values())
- 
-    Iif (containsLocalCacheMutationDirective(fragmentDefinition.directives)) {
-      overrideAsLocalCacheMutation(referencedFragmentsArray);
-    }
- 
-    return {
-      name,
-      filePath,
-      source,
-      typeCondition,
-      selectionSet: selectionSet,
-      directives: directives,
-      referencedFragments: referencedFragmentsArray,
-      overrideAsLocalCacheMutation: false
-    };
-  }
- 
-  function overrideAsLocalCacheMutation(
-    fragments: ir.FragmentDefinition[]
-  ) {
-    fragments.forEach(element => {
-      element.overrideAsLocalCacheMutation = true
-      overrideAsLocalCacheMutation(element.referencedFragments)
-    });
-  }
- 
-  function compileSelectionSet(
-    selectionSetNode: SelectionSetNode,
-    parentType: GraphQLCompositeType,
-    operationReferencedFragments: Set<ir.FragmentDefinition>,
-  ): ir.SelectionSet {
-    return {
-      parentType,
-      selections: selectionSetNode.selections
-        .map((selectionNode) =>
-          compileSelection(selectionNode, parentType, operationReferencedFragments)
-        )
-        .filter(isNotNullOrUndefined),
-    };
-  }
- 
-  function compileSelection(
-    selectionNode: SelectionNode,
-    parentType: GraphQLCompositeType,
-    operationReferencedFragments: Set<ir.FragmentDefinition>,
-  ): ir.Selection | undefined {
-    const [directives, inclusionConditions] = compileDirectives(selectionNode.directives) ?? [undefined, undefined];
- 
-    switch (selectionNode.kind) {
-      case Kind.FIELD: {
-        const name = selectionNode.name.value;
-        Iif (name == "__typename") { return undefined }
-        const alias = selectionNode.alias?.value;
- 
-        const fieldDef = getFieldDef(schema, parentType, name);
-        Iif (!fieldDef) {
-          throw new GraphQLError(
-            `Cannot query field "${name}" on type "${String(parentType)}"`,
-            { nodes: selectionNode }
-          );
-        }
- 
-        const fieldType = fieldDef.type;
-        const unwrappedFieldType = getNamedType(fieldDef.type);
- 
-        addReferencedType(getNamedType(unwrappedFieldType));
- 
-        const { description, deprecationReason } = fieldDef;
-        const args: ir.Field["arguments"] = compileArguments(fieldDef, selectionNode.arguments);
- 
-        let field: ir.Field = {
-          kind: "Field",
-          name,
-          alias,
-          type: fieldType,
-          arguments: args,
-          inclusionConditions: inclusionConditions,
-          description: !isMetaFieldName(name) && description ? description : undefined,
-          deprecationReason: deprecationReason || undefined,
-          directives: directives,
-        };
- 
-        function validateFieldName(node: FieldNode, disallowedNames?: Array<string>, schemaNamespace?: string) {
-          Iif (disallowedNames && schemaNamespace) {
-            const responseKey = (node.alias ?? node.name).value
-            const responseKeyFirstLowercase = responseKey.charAt(0).toLowerCase() + responseKey.slice(1)
- 
-            Iif (disallowedNames?.includes(responseKeyFirstLowercase)) {
-              throw new GraphQLError(
-                `Schema name "${schemaNamespace}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${schemaNamespace}Schema", "${schemaNamespace}GraphQL", "${schemaNamespace}API"`,
-                { nodes: node }
-              );
-            }
-          }
-        }
- 
-        if (isListType(fieldType) || (isNonNullType(fieldType) && isListType(fieldType.ofType))) {
-          validateFieldName(selectionNode, validationOptions.disallowedFieldNames?.entityList, validationOptions.schemaNamespace)
-        } else Iif (isCompositeType(unwrappedFieldType)) {
-          validateFieldName(selectionNode, validationOptions.disallowedFieldNames?.entity, validationOptions.schemaNamespace)
-        }
- 
-        Iif (isCompositeType(unwrappedFieldType)) {
-          const selectionSetNode = selectionNode.selectionSet;
- 
-          Iif (!selectionSetNode) {
-            throw new GraphQLError(
-              `Composite field "${name}" on type "${String(
-                parentType
-              )}" requires selection set`,
-              { nodes: selectionNode }
-            );
-          }
- 
-          field.selectionSet = compileSelectionSet(
-            selectionSetNode,
-            unwrappedFieldType,
-            operationReferencedFragments
-          );
-        }
-        return field;
-      }
-      case Kind.INLINE_FRAGMENT: {
-        const typeNode = selectionNode.typeCondition;
-        const typeCondition = typeNode
-          ? (typeFromAST(schema, typeNode) as GraphQLCompositeType)
-          : parentType;
- 
-        addReferencedType(typeCondition);
- 
-        return {
-          kind: "InlineFragment",
-          selectionSet: compileSelectionSet(
-            selectionNode.selectionSet,
-            typeCondition,
-            operationReferencedFragments
-          ),
-          inclusionConditions: inclusionConditions,
-          directives: directives
-        };
-      }
-      case Kind.FRAGMENT_SPREAD: {
-        const fragmentName = selectionNode.name.value;
- 
-        const fragment = getFragment(fragmentName);
-        Iif (!fragment) {
-          throw new GraphQLError(
-            `Unknown fragment "${fragmentName}".`,
-            { nodes: selectionNode.name }
-          );
-        }
- 
-        operationReferencedFragments.add(fragment);
- 
-        const fragmentSpread: ir.FragmentSpread = {
-          kind: "FragmentSpread",
-          fragment,
-          inclusionConditions: inclusionConditions,
-          directives: directives
-        };
-        return fragmentSpread;
-      }
-    }
-  }
- 
-  function compileArguments(
-    ...args:
-    [fieldDef: GraphQLField<any, any, any>, args?: ReadonlyArray<ArgumentNode>] |
-    [directiveDef: GraphQLDirective, args?: ReadonlyArray<ArgumentNode>]
-  ): ir.Argument[] | undefined {
-    const argDefs: ReadonlyArray<GraphQLArgument> = args[0].args
-    return args[1] && args[1].length > 0
-      ? args[1].map((arg) => {
-        const name = arg.name.value;
-        const argDef = argDefs.find(
-          (argDef) => argDef.name === arg.name.value
-        );
-        const argDefType = argDef?.type;
- 
-        Iif (!argDefType) {
-          throw new GraphQLError(
-            `Cannot find directive argument type for argument "${name}".`,
-            { nodes: [arg] }
-          );
-        }
- 
-        return {
-          name,
-          value: valueFromValueNode(arg.value),
-          type: argDefType,
-          deprecationReason: argDef.deprecationReason ?? undefined
-        };
-      })
-      : undefined;
-  }
- 
-  function compileDirectives(
-    directives?: ReadonlyArray<DirectiveNode>
-  ): [ir.Directive[], ir.InclusionCondition[]?] | undefined {
-    if (directives && directives.length > 0) {
-      const compiledDirectives: ir.Directive[] = [];
-      const inclusionConditions: ir.InclusionCondition[] = [];
- 
-      for (const directive of directives) {
-        const name = directive.name.value;
-        const directiveDef = schema.getDirective(name)
- 
-        Iif (!directiveDef) {
-          throw new GraphQLError(
-            `Cannot find directive "${name}".`,
-            { nodes: directive }
-          );
-        }
- 
-        compiledDirectives.push(
-          {
-            name: name,
-            arguments: compileArguments(directiveDef, directive.arguments)
-          }
-        );
- 
-        const condition = compileInclusionCondition(directive, directiveDef);
-        Iif (condition) { inclusionConditions.push(condition) };
-      }
- 
-      return [
-        compiledDirectives,
-        inclusionConditions.length > 0 ? inclusionConditions : undefined
-      ]
- 
-    } else {
-      return undefined;
-    }
-  }
- 
-  function compileInclusionCondition(
-    directiveNode: DirectiveNode,
-    directiveDef: GraphQLDirective
-  ): ir.InclusionCondition | undefined {
-    if (directiveDef.name == "include" || directiveDef.name == "skip") {
-      const condition = directiveNode.arguments?.[0].value;
-      const isInverted = directiveDef.name == "skip";
- 
-      switch (condition?.kind) {
-        case Kind.BOOLEAN:
-          if (isInverted) {
-            return condition.value ? "SKIPPED" : "INCLUDED";
-          } else {
-            return condition.value ? "INCLUDED" : "SKIPPED";
-          }
- 
-        case Kind.VARIABLE:
-          return {
-            variable: condition.name.value,
-            isInverted: isInverted
-          }
- 
-        default:
-          throw new GraphQLError(
-            `Conditional inclusion directive has invalid "if" argument.`,
-            { nodes: directiveNode }
-          );
-          break;
-      }
-    } else {
-      return undefined
-    }
-  }
- 
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/values.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/values.ts.html deleted file mode 100644 index aa4872c5c..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/compiler/values.ts.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - Code coverage report for src/compiler/values.ts - - - - - - - - - -
-
-

All files / src/compiler values.ts

-
- -
- 22.22% - Statements - 2/9 -
- - -
- 0% - Branches - 0/4 -
- - -
- 0% - Functions - 0/2 -
- - -
- 22.22% - Lines - 2/9 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -491x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { Kind, ValueNode } from 'graphql';
- 
-export type GraphQLValue =
-  | {
-      kind:
-        | 'Variable'
-        | 'IntValue'
-        | 'FloatValue'
-        | 'StringValue'
-        | 'EnumValue';
-      value: string;
-    }
-  | { kind: 'BooleanValue'; value: boolean }
-  | { kind: 'NullValue' }
-  | GraphQLListValue
-  | GraphQLObjectValue;
- 
-export interface GraphQLListValue {
-  kind: 'ListValue';
-  value: GraphQLValue[];
-}
- 
-export interface GraphQLObjectValue {
-  kind: 'ObjectValue';
-  value: { [name: string]: GraphQLValue };
-}
- 
-export function valueFromValueNode(valueNode: ValueNode): GraphQLValue {
-  switch (valueNode.kind) {
-    case Kind.VARIABLE:
-      return { kind: valueNode.kind, value: valueNode.name.value };
-    case Kind.LIST:
-      return {
-        kind: valueNode.kind,
-        value: valueNode.values.map(valueFromValueNode),
-      };
-    case Kind.OBJECT:
-      return {
-        kind: valueNode.kind,
-        value: valueNode.fields.reduce((object, field) => {
-          object[field.name.value] = valueFromValueNode(field.value);
-          return object;
-        }, {} as GraphQLObjectValue['value']),
-      };
-    default:
-      return valueNode;
-  }
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.html deleted file mode 100644 index 482394c46..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - Code coverage report for src - - - - - - - - - -
-
-

All files src

-
- -
- 42.99% - Statements - 46/107 -
- - -
- 5.12% - Branches - 2/39 -
- - -
- 2.94% - Functions - 1/34 -
- - -
- 42.45% - Lines - 45/106 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.ts -
-
66.1%39/5928.57%2/75.88%1/1765.51%38/58
validationRules.ts -
-
14.58%7/480%0/320%0/1714.58%7/48
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.ts.html deleted file mode 100644 index 516a5780e..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/index.ts.html +++ /dev/null @@ -1,463 +0,0 @@ - - - - - - Code coverage report for src/index.ts - - - - - - - - - -
-
-

All files / src index.ts

-
- -
- 66.1% - Statements - 39/59 -
- - -
- 28.57% - Branches - 2/7 -
- - -
- 5.88% - Functions - 1/17 -
- - -
- 65.51% - Lines - 38/58 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -1271x -  -  -  -  -  -  -  -  -  -  -  -  -1x -1x -1x -1x -  -  -1x -  -  -  -1x -1x -  -  -  -1x -1x -1x -1x -1x -1x -1x -1x -1x -1x -  -1x -  -1x -  -  -12x -12x -12x -  -  -  -  -  -  -  -12x -  -  -  -12x -  -12x -12x -12x -  -12x -12x -12x -7x -  -7x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -1x -  -  -  -1x -  -  -  -1x -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  - 
import {
-  Source,
-  buildClientSchema,
-  GraphQLSchema,
-  parse,
-  DocumentNode,
-  concatAST,
-  GraphQLError,
-  validate,
-  buildASTSchema,
-  printSchema,
-  extendSchema,
-} from "graphql";
-import { defaultValidationRules, ValidationOptions } from "./validationRules";
-import { compileToIR, CompilationResult } from "./compiler";
-import { assertValidSchema, assertValidSDL } from "./utilities/graphql";
-import {
-  addApolloCodegenSchemaExtensionToDocument,
-} from "./utilities/apolloCodegenSchemaExtension";
-import {
-  addExperimentalDeferDirectiveToSDLDocument,
-  addExperimentalDeferDirectiveToIntrospectionSchema
-} from "./utilities/experimentalDeferDirective";
-import { addTypePolicyDirectivesToSchema } from "./utilities/typePolicyDirective";
-import { addFieldPolicyDirectivesToSchema } from "./utilities/fieldPolicyDirective";
- 
-// We need to export all the classes we want to map to native objects,
-// so we have access to the constructor functions for type checks.
-export {
-  Source,
-  GraphQLError,
-  GraphQLSchema,
-  GraphQLScalarType,
-  GraphQLObjectType,
-  GraphQLInterfaceType,
-  GraphQLUnionType,
-  GraphQLEnumType,
-  GraphQLInputObjectType,
-} from "graphql";
-export { GraphQLSchemaValidationError } from "./utilities/graphql";
- 
-export function loadSchemaFromSources(sources: Source[]): GraphQLSchema {
-  var introspectionJSONResult: Source | undefined
- 
-  var documents = new Array<DocumentNode>()
-  for (const source of sources) {
-    Iif (source.name.endsWith(".json")) {
-      if (!introspectionJSONResult) {
-        introspectionJSONResult = source
-      } else {
-        throw new Error(`Schema search paths can only include one JSON schema definition.
-        Found "${introspectionJSONResult.name} & "${source.name}".`)
-      }
-    } else {
-      documents.push(parse(source))
-    }
-  }
- 
-  var document = addApolloCodegenSchemaExtensionToDocument(concatAST(documents))
- 
-  if (!introspectionJSONResult) {
-    document = addExperimentalDeferDirectiveToSDLDocument(document)
-    assertValidSDL(document)
- 
-    const schema = buildASTSchema(document, { assumeValid: true, assumeValidSDL: true })
-    addTypePolicyDirectivesToSchema(schema)
-    addFieldPolicyDirectivesToSchema(schema)
-    assertValidSchema(schema)
- 
-    return schema
- 
-  } else E{
-    var schema = loadSchemaFromIntrospectionResult(introspectionJSONResult.body)
-    document = addExperimentalDeferDirectiveToIntrospectionSchema(schema, document)
-    schema = extendSchema(schema, document, { assumeValid: true, assumeValidSDL: true })
-    addTypePolicyDirectivesToSchema(schema)
-    addFieldPolicyDirectivesToSchema(schema)
-    assertValidSchema(schema)
- 
-    return schema
-  }
-}
- 
-function loadSchemaFromIntrospectionResult(
-  introspectionResult: string
-): GraphQLSchema {
-  let payload = JSON.parse(introspectionResult);
- 
-  Iif (payload.data) {
-    payload = payload.data;
-  }
- 
-  const schema = buildClientSchema(payload);
- 
-  return schema;
-}
- 
-export function printSchemaToSDL(schema: GraphQLSchema): string {
-  return printSchema(schema)
-}
- 
-export function parseOperationDocument(source: Source): DocumentNode {
-  return parse(source);
-}
- 
-export function mergeDocuments(documents: DocumentNode[]): DocumentNode {
-  return concatAST(documents);
-}
- 
-export function validateDocument(
-  schema: GraphQLSchema,
-  document: DocumentNode,
-  validationOptions: ValidationOptions,
-): readonly GraphQLError[] {
-  return validate(schema, document, defaultValidationRules(validationOptions));
-}
- 
-export function compileDocument(
-  schema: GraphQLSchema,
-  document: DocumentNode,
-  legacySafelistingCompatibleOperations: boolean,
-  reduceGeneratedSchemaTypes: boolean,
-  validationOptions: ValidationOptions
-): CompilationResult {
-  return compileToIR(schema, document, legacySafelistingCompatibleOperations, reduceGeneratedSchemaTypes, validationOptions);
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/apolloCodegenSchemaExtension.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/apolloCodegenSchemaExtension.ts.html deleted file mode 100644 index 27cafbaaf..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/apolloCodegenSchemaExtension.ts.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - Code coverage report for src/utilities/apolloCodegenSchemaExtension.ts - - - - - - - - - -
-
-

All files / src/utilities apolloCodegenSchemaExtension.ts

-
- -
- 100% - Statements - 12/12 -
- - -
- 50% - Branches - 1/2 -
- - -
- 100% - Functions - 3/3 -
- - -
- 100% - Lines - 11/11 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -841x -1x -  -1x -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -1x -48x -140x -  -  -  -12x -  -  -  -  - 
import { DirectiveDefinitionNode, DocumentNode, Kind, concatAST, GraphQLString } from "graphql";
-import { nameNode, nonNullNode, stringNode, typeNode } from "./nodeHelpers";
- 
-export const directive_apollo_client_ios_localCacheMutation: DirectiveDefinitionNode = {
-  kind: Kind.DIRECTIVE_DEFINITION,
-  description: stringNode("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),
-  name: nameNode("apollo_client_ios_localCacheMutation"),
-  repeatable: false,
-  locations: [nameNode("QUERY"), nameNode("MUTATION"), nameNode("SUBSCRIPTION"), nameNode("FRAGMENT_DEFINITION")]
-}
- 
-export const directive_typePolicy: DirectiveDefinitionNode = {
-  kind: Kind.DIRECTIVE_DEFINITION,
-  description: stringNode("Attach extra information to a given type."),
-  name: nameNode("typePolicy"),
-  arguments: [
-    {
-      kind: Kind.INPUT_VALUE_DEFINITION,
-      description: stringNode("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),
-      name: nameNode("keyFields"),
-      type: nonNullNode(typeNode(GraphQLString))
-    }
-  ],
-  repeatable: false,
-  locations: [nameNode("OBJECT"), nameNode("INTERFACE")]
-}
- 
-export const directive_fieldPolicy: DirectiveDefinitionNode = {
-  kind: Kind.DIRECTIVE_DEFINITION,
-  description: stringNode("A directive used by Apollo iOS to map query input data to cache keys of objects."),
-  name: nameNode("fieldPolicy"),
-  arguments: [
-    {
-      kind: Kind.INPUT_VALUE_DEFINITION,
-      description: stringNode("The field you are setting the @fieldPolicy for."),
-      name: nameNode("forField"),
-      type: nonNullNode(typeNode(GraphQLString))
-    },
-    {
-      kind: Kind.INPUT_VALUE_DEFINITION,
-      description: stringNode("Set of fields used to compute the cache key."),
-      name: nameNode("keyArgs"),
-      type: nonNullNode(typeNode(GraphQLString))
-    }
-  ],
-  repeatable: true,
-  locations: [nameNode("OBJECT"), nameNode("INTERFACE")]
-}
- 
-export const directive_import_statement: DirectiveDefinitionNode = {
-  kind: Kind.DIRECTIVE_DEFINITION,
-  description: stringNode("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),
-  name: nameNode("import"),
-  arguments: [
-    {
-      kind: Kind.INPUT_VALUE_DEFINITION,
-      description: stringNode("The name of the module to import."),
-      name: nameNode("module"),
-      type: nonNullNode(typeNode(GraphQLString))
-    }
-  ],
-  repeatable: true,
-  locations: [nameNode("QUERY"), nameNode("MUTATION"), nameNode("SUBSCRIPTION"), nameNode("FRAGMENT_DEFINITION")]
-}
- 
-const apolloDirectives = [
-  directive_apollo_client_ios_localCacheMutation,
-  directive_import_statement,
-  directive_typePolicy,
-  directive_fieldPolicy
-]
- 
-export function addApolloCodegenSchemaExtensionToDocument(document: DocumentNode): DocumentNode {
-  const directives = apolloDirectives.filter(directive => !document.definitions.some(definition =>
-    definition.kind == Kind.DIRECTIVE_DEFINITION &&
-    definition.name.value == directive.name.value
-  ));
- 
-  return concatAST([document, {
-    kind: Kind.DOCUMENT,
-    definitions: directives
-  }]);
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/experimentalDeferDirective.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/experimentalDeferDirective.ts.html deleted file mode 100644 index cc7639795..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/experimentalDeferDirective.ts.html +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - Code coverage report for src/utilities/experimentalDeferDirective.ts - - - - - - - - - -
-
-

All files / src/utilities experimentalDeferDirective.ts

-
- -
- 30% - Statements - 9/30 -
- - -
- 16.66% - Branches - 3/18 -
- - -
- 25% - Functions - 3/12 -
- - -
- 32.14% - Lines - 9/28 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -1031x -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -1x -12x -  -12x -12x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -83x -  -  -  -  -  -  -12x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import {
-  DefinitionNode,
-  DirectiveDefinitionNode,
-  DocumentNode,
-  GraphQLDeferDirective,
-  GraphQLDirective,
-  GraphQLSchema,
-  Kind,
-  concatAST,
-} from "graphql";
-import { definitionNode } from "./nodeHelpers";
- 
-// While @defer is experimental the directive needs to be manually added to the list of directives
-// available to operations. If the directive is already in the document it must be validated to 
-// ensure it matches the @defer directive definition supported by Apollo iOS.
-//
-// Once defer is part of the GraphQL spec and the directive is no longer considered experimental
-// this function can be removed.
-export function addExperimentalDeferDirectiveToSDLDocument(document: DocumentNode): DocumentNode {
-  const definition = document.definitions.find(isDeferDirectiveDefinitionNodePredicate)
- 
-  if (!definition) {
-    return concatAST([document, experimentalDeferDirectiveDocumentNode()])
-  }
- 
-  const directiveDefinition = definition as DirectiveDefinitionNode
- 
-  Iif (!matchDirectiveDefinition(directiveDefinition, GraphQLDeferDirective)) {
-    console.warn(`Unsupported ${directiveDefinition.name.value} directive found. It will be replaced with a supported definition instead.`)
- 
-    const modifiedDocument: DocumentNode = {
-      kind: Kind.DOCUMENT,
-      definitions: document.definitions.filter(
-        (value) => !isDeferDirectiveDefinitionNodePredicate(value) ? value : undefined)
-        .concat(definitionNode(GraphQLDeferDirective))
-    }
- 
-    return modifiedDocument
-  }
- 
-  return document
-}
- 
-// NOTE: This function is used for adding the experimental defer directive to a document after
-// validating the existing of the defer directive in a schema built from an introspection result.
-//
-// While @defer is experimental the directive needs to be manually added to the list of directives
-// available to operations. If the directive is already in the document it must be validated to 
-// ensure it matches the @defer directive definition supported by Apollo iOS.
-//
-// Once defer is part of the GraphQL spec and the directive is no longer considered experimental
-// this function can be removed.
-export function addExperimentalDeferDirectiveToIntrospectionSchema(schema: GraphQLSchema, document: DocumentNode): DocumentNode {
-  const directive = schema.getDirective(GraphQLDeferDirective.name)
- 
-  Iif (!directive) {
-    return concatAST([document, experimentalDeferDirectiveDocumentNode()])
-  }
- 
-  Iif (!matchDirective(directive, GraphQLDeferDirective)) {
-    console.warn(`Unsupported ${directive.name} directive found. It will be replaced with a supported definition instead.`)
- 
-    return concatAST([document, experimentalDeferDirectiveDocumentNode()])
-  }
- 
-  return document
-}
- 
-// Checks whether the definition node is a defer directive definition node.
-function isDeferDirectiveDefinitionNodePredicate(value: DefinitionNode) {
-  return (
-    value.kind === Kind.DIRECTIVE_DEFINITION && 
-    value.name.value === GraphQLDeferDirective.name
-  )
-}
- 
-function experimentalDeferDirectiveDocumentNode(): DocumentNode {
-  return {
-    kind: Kind.DOCUMENT,
-    definitions: [definitionNode(GraphQLDeferDirective)]
-  }
-}
- 
-// Checks whether the supplied directive definition node matches against important properties
-// of the experimentally defined defer directive that Apollo iOS expects.
-function matchDirectiveDefinition(definition: DirectiveDefinitionNode, target: GraphQLDirective): Boolean {
-  return(
-    definition.repeatable === target.isRepeatable &&
-    definition.locations.map((node) => node.value).sort().toString() === target.locations.slice(0).sort().toString() &&
-    definition.arguments?.map((value) => value.name.value).sort().toString() === target.args.map((value) => value.name).sort().toString()
-  )
-}
- 
-// Checks whether the supplied directive matches against important properties
-// of the experimentally defined defer directive that Apollo iOS expects.
-function matchDirective(directive: GraphQLDirective, target: GraphQLDirective): Boolean {
-  return(
-    directive.isRepeatable === target.isRepeatable &&
-    directive.locations.slice(0).sort().toString() === target.locations.slice(0).sort().toString() &&
-    directive.args.map((value) => value.name).sort().toString() === target.args.map((value) => value.name).sort().toString()
-  )
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/fieldPolicyDirective.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/fieldPolicyDirective.ts.html deleted file mode 100644 index 5ddea69da..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/fieldPolicyDirective.ts.html +++ /dev/null @@ -1,709 +0,0 @@ - - - - - - Code coverage report for src/utilities/fieldPolicyDirective.ts - - - - - - - - - -
-
-

All files / src/utilities fieldPolicyDirective.ts

-
- -
- 91.25% - Statements - 73/80 -
- - -
- 76.34% - Branches - 71/93 -
- - -
- 100% - Functions - 10/10 -
- - -
- 91.13% - Lines - 72/79 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -2091x -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -1x -  -  -  -  -  -  -1x -  -  -12x -  -12x -98x -  -98x -  -62x -  -  -  -  -1x -  -  -62x -62x -  -  -  -62x -  -62x -15x -15x -  -15x -15x -15x -  -  -15x -  -  -  -  -  -  -15x -30x -  -15x -15x -15x -15x -  -  -15x -  -  -  -  -  -  -  -15x -15x -  -  -  -  -  -  -  -15x -18x -15x -18x -1x -  -  -  -  -  -  -  -  -  -14x -14x -14x -  -14x -16x -4x -  -  -  -  -14x -1x -  -  -  -  -  -  -  -13x -3x -  -  -  -  -  -  -10x -10x -  -  -  -  -  -  -  -  -  -66x -  -  -  -66x -  -66x -12x -12x -  -12x -12x -  -  -  -66x -5x -5x -  -  -  -66x -66x -4x -4x -  -  -  -4x -4x -4x -2x -2x -2x -  -  -  -4x -2x -  -  -  -  -  -66x -  -  -  -  -  -  -2x -  -  -4x -  -  -  -  -  -4x -  -  -  -  - 
import {
-  DirectiveNode,
-  GraphQLCompositeType,
-  GraphQLError,
-  GraphQLInterfaceType,
-  GraphQLObjectType,
-  GraphQLSchema,
-  isInterfaceType,
-  isListType,
-  isObjectType,
-  isUnionType,
-  Kind,
-  valueFromASTUntyped,
-} from "graphql";
-import { directive_fieldPolicy } from "./apolloCodegenSchemaExtension";
- 
-const directiveName = directive_fieldPolicy.name.value
- 
-// type FieldPolicyDirectiveResult = {
-//   directive: DirectiveNode;
-//   source: GraphQLObjectType;
-// };
- 
-export function addFieldPolicyDirectivesToSchema(
-  schema: GraphQLSchema
-) {
-  const types = schema.getTypeMap();
- 
-  for (const t in types) {
-    const type = types[t];
- 
-    if (type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) {
-      // (type as any)._apolloFieldPolicies = applyFieldPoliciesFor(type);
-      applyFieldPoliciesFor(type);
-    }
-  }
-}
- 
-export function applyFieldPoliciesFor(
-  type: GraphQLCompositeType
-) {
-  const directives = fieldPolicyDirectivesFor(type)
-  Iif (!directives || isUnionType(type)) {
-    return;
-  }
- 
-  const typeFields = type.getFields()
- 
-  for (const directive of directives) {
-    const forFieldValueNode = directive.arguments?.find(
-      (b) => b.name.value === "forField"
-    )?.value
-    let forField: string | undefined = undefined;
-    if (forFieldValueNode?.kind === Kind.STRING) {
-      forField = forFieldValueNode.value
-    }
- 
-    Iif (!forField) {
-      throw new GraphQLError(
-        `@fieldPolicy directive must have a 'forField' value.`,
-        { nodes: directive }
-      );
-    }
- 
-    const keyArgsValueNode = directive.arguments?.find(
-      (b) => b.name.value === "keyArgs"
-    )?.value
-    let keyArgs: string[] | undefined = undefined;
-    if (keyArgsValueNode?.kind == Kind.STRING) {
-      const rawArgs = keyArgsValueNode.value.split(" ");
-      keyArgs = [...new Set(rawArgs.filter(Boolean))];
-    }
- 
-    Iif (!keyArgs) {
-      throw new GraphQLError(
-        `'keyArgs' must be a space-separated list of identifiers.`,
-        { nodes: directive }
-      );
-    }
- 
-    // check that the field exists
-    const actualField = typeFields[forField]
-    Iif (!actualField) {
-      throw new GraphQLError(
-        `Field "${forField}" does not exist on type "${type.name}".`,
-        { nodes: type.astNode ? [type.astNode, directive] : directive}
-      );
-    }
- 
-    // validate the provided key args match an input parameter
-    const inputs = actualField.astNode?.arguments;
-    const inputNames = new Set(inputs?.map(input => input.name.value) ?? []);
-    for (const keyArg of keyArgs) {
-      if (!inputNames.has(keyArg)) {
-        throw new GraphQLError(
-          `@fieldPolicy key argument "${keyArg}" does not exist as an input argument of field "${actualField.name}".`,
-          {
-            nodes: actualField.astNode
-          }
-        );
-      }
-    }
- 
-    // List input and return type validation
-    if (inputs) {
-      var numListInputs = 0;
-      const hasListReturnType = isListType(actualField.type);
- 
-      for (const inputArg of inputs) {
-        if (inputArg.type.kind == "ListType") {
-          numListInputs += 1;
-        }
-      }
- 
-      // validate we have at most 1 list input parameter
-      if (numListInputs > 1) {
-        throw new GraphQLError(
-          `@fieldPolicy can only have at most 1 List type input parameter.`,
-          { nodes: actualField.astNode }
-        );
-      }
- 
-      // validate that a list input parameter and return type exist either together
-      // or not at all
-      if ((hasListReturnType && numListInputs != 1) || (numListInputs == 1 && !hasListReturnType)) {
-        throw new GraphQLError(
-          `@fieldPolicy requires either both a List return type and 1 List input parameter, or neither.`,
-          { nodes: actualField.astNode }
-        );
-      }
-    }
- 
-    if (!(actualField as any)._apolloFieldPolicies) {
-      (actualField as any)._apolloFieldPolicies = keyArgs
-    } else E{
-      (actualField as any)._apolloFieldPolicies = []
-    }
-  }
-}
- 
-function fieldPolicyDirectivesFor(
-  type: GraphQLCompositeType
-): DirectiveNode[] | undefined {
-  Iif(!isObjectType(type) && !isInterfaceType(type)) {
-    return undefined;
-  }
- 
-  const result: DirectiveNode[] = [];
- 
-  for (const extension of type.extensionASTNodes ?? []) {
-    const directive = extension.directives?.find(
-      (d) => d.name.value === directiveName
-    );
-    if (directive) {
-      result.push(directive)
-    }
-  }
- 
-  for (const directive of type.astNode?.directives ?? []) {
-    if (directive.name.value === directiveName) {
-      result.push(directive);
-    }
-  }
- 
-  if("getInterfaces" in type) {
-    for (const interfaceType of type.getInterfaces()) {
-      const found = fieldPolicyDirectivesFor(interfaceType);
-      Iif (!found) {
-        continue;
-      }
- 
-      for (const foundDirective of found) {
-        var duplicate = false;
-        for (const directive of result) {
-          if (matchDirectiveArguments(directive, foundDirective)) {
-            duplicate = true;
-            break;
-          }
-        }
- 
-        if (!duplicate) {
-          result.push(foundDirective);
-        }
-      }
-    }
-  }
- 
-  return result
-}
- 
-function matchDirectiveArguments(
-  first: DirectiveNode,
-  second: DirectiveNode
-): boolean {
-  return (
-    (first.arguments ?? [])
-      .map((node) =>
-        JSON.stringify([node.name.value, valueFromASTUntyped(node.value)])
-      )
-      .sort()
-      .toString() ===
-    (second.arguments ?? [])
-      .map((node) =>
-        JSON.stringify([node.name.value, valueFromASTUntyped(node.value)])
-      )
-      .sort()
-      .toString()
-  );
-}
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/graphql.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/graphql.ts.html deleted file mode 100644 index bf71eadef..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/graphql.ts.html +++ /dev/null @@ -1,640 +0,0 @@ - - - - - - Code coverage report for src/utilities/graphql.ts - - - - - - - - - -
-
-

All files / src/utilities graphql.ts

-
- -
- 29.68% - Statements - 19/64 -
- - -
- 0% - Branches - 0/37 -
- - -
- 11.76% - Functions - 2/17 -
- - -
- 30.64% - Lines - 19/62 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -1861x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -1x -1x -1x -  -1x -  -  -  -  -  -  -  -1x -12x -12x -  -  -  -  -1x -7x -7x -  -  -  -  -1x -  -  -  -1x -  -  -  -1x -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import {
-  ASTNode,
-  FieldNode,
-  GraphQLCompositeType,
-  GraphQLField,
-  GraphQLSchema,
-  isInterfaceType,
-  isObjectType,
-  isUnionType,
-  Kind,
-  Location,
-  SchemaMetaFieldDef,
-  SelectionSetNode,
-  TypeMetaFieldDef,
-  TypeNameMetaFieldDef,
-  validateSchema,
-  visit,
-  GraphQLError,
-  DocumentNode,
-  DirectiveNode,
-  DirectiveDefinitionNode
-} from "graphql";
-import { isNode } from "graphql/language/ast";
-import { validateSDL } from "graphql/validation/validate";
-import { directive_apollo_client_ios_localCacheMutation, directive_import_statement } from "./apolloCodegenSchemaExtension";
-import { addTypeNameFieldForLegacySafelisting } from "./legacySafelistingTransform";
- 
-export class GraphQLSchemaValidationError extends Error {
-  constructor(public validationErrors: readonly GraphQLError[]) {
-    super(validationErrors.map((error) => error.message).join("\n\n"));
- 
-    this.name = "GraphQLSchemaValidationError";
-  }
-}
- 
-export function assertValidSDL(document: DocumentNode) {
-  const errors = validateSDL(document);
-  Iif (errors.length !== 0) {
-    throw new GraphQLSchemaValidationError(errors);
-  }
-}
- 
-export function assertValidSchema(schema: GraphQLSchema) {
-  const errors = validateSchema(schema);
-  Iif (errors.length !== 0) {
-    throw new GraphQLSchemaValidationError(errors);
-  }
-}
- 
-export function sourceAt(location: Location) {
-  return location.source.body.slice(location.start, location.end);
-}
- 
-export function filePathForNode(node: ASTNode): string | undefined {
-  return node.loc?.source?.name;
-}
- 
-export function isMetaFieldName(name: string) {
-  return name.startsWith("__");
-}
- 
-export function containsLocalCacheMutationDirective(directives: readonly DirectiveNode[] | undefined): boolean {
-  Iif (!directives) return false
- 
-  for (const directive of directives) {
-    Iif (directive.name.value == directive_apollo_client_ios_localCacheMutation.name.value) {
-      return true
-    }
-  }
- 
-  return false
-}
- 
-const typenameField: FieldNode = {
-  kind: Kind.FIELD,
-  name: { kind: Kind.NAME, value: "__typename" },
-};
- 
-export function transformToNetworkRequestSourceDefinition(
-  ast: ASTNode,
-  legacySafelistingCompatibleOperations: boolean
-) {
-  Iif (legacySafelistingCompatibleOperations) {
-    ast = addTypeNameFieldForLegacySafelisting(ast)
-  }
- 
-  return visit(ast, {
-    SelectionSet: {
-      leave(node: SelectionSetNode, _, parent) {
-        Iif (isNode(parent) && ![Kind.FIELD, Kind.FRAGMENT_DEFINITION].includes(parent.kind)) {
-          return node
-        }
-        return addTypenameFieldToSelectionSetIfNeeded(node)
-      }
-    },
-    Field: {
-      enter(node: FieldNode) {
-        return transformTypenameFieldIfNeeded(node)
-      }
-    },
-    Directive: {
-      enter(node: DirectiveNode) {
-        return stripApolloClientSpecificDirectives(node)
-      }
-    }
-  });
-}
- 
-function addTypenameFieldToSelectionSetIfNeeded(node: SelectionSetNode): SelectionSetNode {
-  const hasTypenameField = node.selections.find((selection) =>
-    selection.kind == typenameField.kind && selection.name.value == typenameField.name.value
-  );
- 
-  if (hasTypenameField) {
-    return node
-  } else {
-    return {
-      ...node,
-      selections: [typenameField, ...node.selections],
-    };
-  }
-}
- 
-function transformTypenameFieldIfNeeded(node: FieldNode): FieldNode {
-  if (node.name.value == typenameField.name.value) {
-    return {
-      ...node,
-      alias: undefined,
-      directives: undefined
-    }
-  } else {
-    return node;
-  }
-}
- 
-function stripApolloClientSpecificDirectives(node: DirectiveNode): DirectiveNode | null {
-  const apolloClientSpecificDirectives: DirectiveDefinitionNode[] = [
-    directive_apollo_client_ios_localCacheMutation,
-    directive_import_statement
-  ]
- 
-  for (const directive of apolloClientSpecificDirectives) {
-    Iif (node.name.value == directive.name.value) {
-      return null
-    }
-  }
- 
-  return node
-}
- 
-// Utility functions extracted from graphql-js
- 
-/**
- * Not exactly the same as the executor's definition of getFieldDef, in this
- * statically evaluated environment we do not always have an Object type,
- * and need to handle Interface and Union types.
- */
-export function getFieldDef(
-  schema: GraphQLSchema,
-  parentType: GraphQLCompositeType,
-  fieldName: string,
-): GraphQLField<any, any> | undefined {
-  Iif (
-    fieldName === SchemaMetaFieldDef.name &&
-    schema.getQueryType() === parentType
-  ) {
-    return SchemaMetaFieldDef;
-  }
-  Iif (fieldName === TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
-    return TypeMetaFieldDef;
-  }
-  Iif (
-    fieldName === TypeNameMetaFieldDef.name &&
-    (isObjectType(parentType) ||
-      isInterfaceType(parentType) ||
-      isUnionType(parentType))
-  ) {
-    return TypeNameMetaFieldDef;
-  }
-  Iif (isObjectType(parentType) || isInterfaceType(parentType)) {
-    return parentType.getFields()[fieldName];
-  }
- 
-  return undefined;
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.html deleted file mode 100644 index b7616bef7..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - Code coverage report for src/utilities - - - - - - - - - -
-
-

All files src/utilities

-
- -
- 57.59% - Statements - 163/283 -
- - -
- 41.2% - Branches - 96/233 -
- - -
- 46.15% - Functions - 30/65 -
- - -
- 58.18% - Lines - 160/275 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
apolloCodegenSchemaExtension.ts -
-
100%12/1250%1/2100%3/3100%11/11
experimentalDeferDirective.ts -
-
30%9/3016.66%3/1825%3/1232.14%9/28
fieldPolicyDirective.ts -
-
91.25%73/8076.34%71/93100%10/1091.13%72/79
graphql.ts -
-
29.68%19/640%0/3711.76%2/1730.64%19/62
index.ts -
-
100%4/4100%0/0100%0/0100%4/4
legacySafelistingTransform.ts -
-
23.07%3/130%0/90%0/425%3/12
nodeHelpers.ts -
-
100%15/1550%1/2100%8/8100%15/15
predicates.ts -
-
50%2/40%0/60%0/250%2/4
typePolicyDirective.ts -
-
42.62%26/6130.3%20/6644.44%4/941.66%25/60
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.ts.html deleted file mode 100644 index a01b7130a..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/index.ts.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - Code coverage report for src/utilities/index.ts - - - - - - - - - -
-
-

All files / src/utilities index.ts

-
- -
- 100% - Statements - 4/4 -
- - -
- 100% - Branches - 0/0 -
- - -
- 100% - Functions - 0/0 -
- - -
- 100% - Lines - 4/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -51x -1x -1x -1x - 
export * from "./graphql";
-export * from "./predicates";
-export * from "./apolloCodegenSchemaExtension";
-export * from "./nodeHelpers";
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/legacySafelistingTransform.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/legacySafelistingTransform.ts.html deleted file mode 100644 index 84e1fa11a..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/legacySafelistingTransform.ts.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - Code coverage report for src/utilities/legacySafelistingTransform.ts - - - - - - - - - -
-
-

All files / src/utilities legacySafelistingTransform.ts

-
- -
- 23.07% - Statements - 3/13 -
- - -
- 0% - Branches - 0/9 -
- - -
- 0% - Functions - 0/4 -
- - -
- 25% - Lines - 3/12 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -551x -  -  -  -  -  -  -  -1x -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import {
-  ASTNode,
-  FieldNode,  
-  Kind,
-  visit,  
-} from "graphql";
- 
-// This has been copied from https://github.dev/apollographql/apollo-tooling/blob/cfe529bd83627eda7ea78818d32218af7a4e8f2b/packages/apollo-language-server/src/utilities/graphql.ts#L305-L347
-const typenameField = {
-  kind: Kind.FIELD,
-  name: { kind: Kind.NAME, value: "__typename" },
-};
- 
-export function addTypeNameFieldForLegacySafelisting(ast: ASTNode) {
-  return visit(ast, {
-    enter(node: ASTNode) {
-      if (
-        !(node.kind === Kind.SELECTION_SET)
-      ) {
-        return undefined;
-      } else {
-        return {
-          ...node,
-          selections: node.selections.filter(
-            (selection) =>
-              !(
-                selection.kind === "Field" &&
-                (selection as FieldNode).name.value === "__typename"
-              )
-          ),
-        };
-      }
-    },
-    leave(node: ASTNode) {
-      Iif (
-        !(
-          node.kind === Kind.FIELD ||
-          node.kind === Kind.FRAGMENT_DEFINITION ||
-          node.kind === Kind.INLINE_FRAGMENT
-        )
-      ) {
-        return undefined;
-      }
-      Iif (!node.selectionSet) return undefined;
- 
-      return {
-        ...node,
-        selectionSet: {
-          ...node.selectionSet,
-          selections: [typenameField, ...node.selectionSet.selections],
-        },
-      };
-    },
-  });
-}
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/nodeHelpers.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/nodeHelpers.ts.html deleted file mode 100644 index 49c3d3ff3..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/nodeHelpers.ts.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - Code coverage report for src/utilities/nodeHelpers.ts - - - - - - - - - -
-
-

All files / src/utilities nodeHelpers.ts

-
- -
- 100% - Statements - 15/15 -
- - -
- 50% - Branches - 1/2 -
- - -
- 100% - Functions - 8/8 -
- - -
- 100% - Lines - 15/15 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -501x -  -1x -108x -  -  -  -  -  -1x -44x -  -  -  -  -  -1x -24x -  -  -  -  -  -  -  -1x -12x -  -  -  -  -24x -24x -  -  -  -1x -28x -  -  -  -  -  -1x -4x -  -  -  -  - 
import { DefinitionNode, GraphQLArgument, GraphQLDirective, GraphQLNamedType, InputValueDefinitionNode, Kind, NameNode, StringValueNode, TypeNode, NamedTypeNode, ListTypeNode, getNamedType } from "graphql";
- 
-export function nameNode(name :string): NameNode {
-  return {
-    kind: Kind.NAME,
-    value: name
-  }
-}
- 
-export function stringNode(value :string): StringValueNode {
-  return {
-    kind: Kind.STRING,
-    value: value
-  }
-}
- 
-export function inputValueDefinitionNode(arg: GraphQLArgument): InputValueDefinitionNode {
-  return {
-    kind: Kind.INPUT_VALUE_DEFINITION,
-    description: stringNode(arg.description!),
-    name: nameNode(arg.name),
-    type: typeNode(getNamedType(arg.type))
-  }
-}
- 
-export function definitionNode(definition: GraphQLDirective): DefinitionNode {
-  return {
-    kind: Kind.DIRECTIVE_DEFINITION,
-    description: definition.description ? stringNode(definition.description) : undefined,
-    name: nameNode(definition.name),
-    repeatable: false,
-    locations: definition.locations.map(loc => nameNode(loc)),
-    arguments: definition.args.map(arg => inputValueDefinitionNode(arg))
-  }
-}
- 
-export function typeNode(type: GraphQLNamedType): NamedTypeNode {
-  return {
-    kind: Kind.NAMED_TYPE,
-    name: nameNode(type.name)
-  }
-}
- 
-export function nonNullNode(node: NamedTypeNode | ListTypeNode): TypeNode {
-  return {
-    kind: Kind.NON_NULL_TYPE,
-    type: node
-  }
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/predicates.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/predicates.ts.html deleted file mode 100644 index fb1ca21c6..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/predicates.ts.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - Code coverage report for src/utilities/predicates.ts - - - - - - - - - -
-
-

All files / src/utilities predicates.ts

-
- -
- 50% - Statements - 2/4 -
- - -
- 0% - Branches - 0/6 -
- - -
- 0% - Functions - 0/2 -
- - -
- 50% - Lines - 2/4 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -151x -  -  -  -  -  -1x -  -  -  -  -  -  -  - 
export function isNotNullOrUndefined<T>(
-  value: T | null | undefined,
-): value is T {
-  return value !== null && typeof value !== 'undefined';
-}
- 
-export function isObject(value: any): value is object {
-  return (
-    value !== undefined &&
-    value !== null &&
-    typeof value === 'object' &&
-    !Array.isArray(value)
-  );
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/typePolicyDirective.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/typePolicyDirective.ts.html deleted file mode 100644 index b3b9f478a..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/utilities/typePolicyDirective.ts.html +++ /dev/null @@ -1,616 +0,0 @@ - - - - - - Code coverage report for src/utilities/typePolicyDirective.ts - - - - - - - - - -
-
-

All files / src/utilities typePolicyDirective.ts

-
- -
- 42.62% - Statements - 26/61 -
- - -
- 30.3% - Branches - 20/66 -
- - -
- 44.44% - Functions - 4/9 -
- - -
- 41.66% - Lines - 25/60 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -1781x -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -101x -  -  -  -101x -12x -12x -  -12x -  -  -  -  -  -101x -5x -  -  -  -  -  -101x -101x -4x -4x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -101x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -97x -97x -97x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -12x -  -12x -158x -  -158x -97x -  -  -  - 
import {
-  DirectiveNode,
-  GraphQLCompositeType,
-  GraphQLError,
-  GraphQLInterfaceType,
-  GraphQLObjectType,
-  GraphQLSchema,
-  isInterfaceType,
-  isNonNullType,
-  isScalarType,
-  isUnionType,
-  Kind,
-  valueFromASTUntyped,
-} from "graphql";
-import { directive_typePolicy } from "./apolloCodegenSchemaExtension";
- 
-const directiveName = directive_typePolicy.name.value;
- 
-type TypePolicyDirectiveResult = {
-  directive: DirectiveNode;
-  source: GraphQLObjectType | GraphQLInterfaceType;
-};
- 
-function matchDirectiveArguments(
-  first: DirectiveNode,
-  second: DirectiveNode
-): boolean {
-  return (
-    (first.arguments ?? [])
-      .map((node) =>
-        JSON.stringify([node.name.value, valueFromASTUntyped(node.value)])
-      )
-      .sort()
-      .toString() ===
-    (second.arguments ?? [])
-      .map((node) =>
-        JSON.stringify([node.name.value, valueFromASTUntyped(node.value)])
-      )
-      .sort()
-      .toString()
-  );
-}
- 
-function typePolicyDirectiveFor(
-  type: GraphQLCompositeType
-): TypePolicyDirectiveResult | undefined {
-  Iif (isUnionType(type)) {
-    return undefined;
-  }
- 
-  for (const extension of type.extensionASTNodes ?? []) {
-    const directive = extension.directives?.find(
-      (d) => d.name.value === directiveName
-    );
-    Iif (directive) {
-      return { directive, source: type };
-    }
-  }
- 
-  let result: TypePolicyDirectiveResult | undefined;
-  for (const directive of type.astNode?.directives ?? []) {
-    Iif (directive.name.value === directiveName) {
-      result = { directive, source: type };
-      break;
-    }
-  }
- 
-  if ("getInterfaces" in type) {
-    for (const interfaceType of type.getInterfaces()) {
-      const found = typePolicyDirectiveFor(interfaceType);
-      if (!found) continue;
- 
-      if (!result) {
-        result = found;
-      } else Iif (!matchDirectiveArguments(result.directive, found.directive)) {
-        if (result.source === type) {
-          throw new GraphQLError(
-            `Type "${type.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${found.source.name}".`,
-            { nodes: type.astNode }
-          );
-        } else {
-          throw new GraphQLError(
-            `Type "${type.name}" inherits conflicting @typePolicy directives from interfaces "${result.source.name}" and "${found.source.name}".`,
-            { nodes: type.astNode }
-          );
-        }
-      }
-    }
-  }
- 
-  return result;
-}
- 
-function validateKeyFields(
-  result: TypePolicyDirectiveResult,
-  keyFields: string[]
-) {
-  const { directive, source: type } = result;
- 
-  Iif (isUnionType(type)) {
-    return;
-  }
- 
-  const label = isInterfaceType(type) ? "interface" : "object";
- 
-  var allFields = type.getFields();
-  for (const keyField of keyFields) {
-    Iif (!keyField) {
-      throw new GraphQLError(
-        `Key fields must be a space-separated list of identifiers.`,
-        { nodes: directive }
-      );
-    }
- 
-    const actualField = allFields[keyField];
-    Iif (!actualField) {
-      throw new GraphQLError(
-        `Key field "${keyField}" does not exist on ${label} "${type.name}".`,
-        { nodes: type.astNode ? [type.astNode, directive] : directive }
-      );
-    }
- 
-    Iif (!isNonNullType(actualField.type)) {
-      throw new GraphQLError(
-        `Key field "${keyField}" on ${label} "${type.name}" must be non-nullable.`,
-        {
-          nodes: actualField.astNode
-            ? [actualField.astNode, directive]
-            : directive,
-        }
-      );
-    }
- 
-    Iif (!isScalarType(actualField.type.ofType)) {
-      throw new GraphQLError(
-        `Key field "${keyField}" on ${label} "${type.name}" must be a scalar type, got ${actualField.type}.`,
-        {
-          nodes: actualField.astNode
-            ? [actualField.astNode, directive]
-            : directive,
-        }
-      );
-    }
-  }
-}
- 
-export function keyFieldsFor(type: GraphQLCompositeType): string[] {
-  const result = typePolicyDirectiveFor(type);
-  if (!result) {
-    return [];
-  }
- 
-  const argumentValue = result.directive?.arguments?.find(
-    (b) => b.name.value === "keyFields"
-  )?.value;
-  Iif (!argumentValue || argumentValue.kind !== Kind.STRING) {
-    return [];
-  }
- 
-  const fields = argumentValue.value.split(" ");
- 
-  validateKeyFields(result, fields);
- 
-  return fields;
-}
- 
-export function addTypePolicyDirectivesToSchema(schema: GraphQLSchema) {
-  const types = schema.getTypeMap();
- 
-  for (const key in types) {
-    const type = types[key];
- 
-    if (type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType) {
-      (type as any)._apolloKeyFields = keyFieldsFor(type);
-    }
-  }
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/validationRules.ts.html b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/validationRules.ts.html deleted file mode 100644 index 647af99d9..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov-report/src/validationRules.ts.html +++ /dev/null @@ -1,547 +0,0 @@ - - - - - - Code coverage report for src/validationRules.ts - - - - - - - - - -
-
-

All files / src validationRules.ts

-
- -
- 14.58% - Statements - 7/48 -
- - -
- 0% - Branches - 0/32 -
- - -
- 0% - Functions - 0/17 -
- - -
- 14.58% - Lines - 7/48 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-

-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -1551x -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import {
-  NoUnusedFragmentsRule,
-  ValidationRule,
-  specifiedRules,
-  FieldNode,
-  GraphQLError,
-  OperationDefinitionNode,
-  ValidationContext,
-  VariableDefinitionNode,
-  InlineFragmentNode,
-  GraphQLDeferDirective,
-} from "graphql";
- 
-const specifiedRulesToBeRemoved: [ValidationRule] = [NoUnusedFragmentsRule];
- 
-export interface DisallowedFieldNames {
-  allFields?: Array<string>
-  entity?: Array<string>
-  entityList?: Array<string>
-}
- 
-export interface ValidationOptions {
-  schemaNamespace?: string
-  disallowedFieldNames?: DisallowedFieldNames
-  disallowedInputParameterNames?: Array<string>
-}
- 
-export function defaultValidationRules(options: ValidationOptions): ValidationRule[] {
-  const disallowedFieldNamesRule = ApolloIOSDisallowedFieldNames(options.disallowedFieldNames?.allFields)
-  const disallowedInputParameterNamesRule = ApolloIOSDisallowedInputParameterNames(options.disallowedInputParameterNames)
-  return [
-    NoAnonymousQueries,
-    NoTypenameAlias,
-    DeferredInlineFragmentNoTypeCondition,
-    DeferredInlineFragmentMissingLabelArgument,
-    ...(disallowedFieldNamesRule ? [disallowedFieldNamesRule] : []),
-    ...(disallowedInputParameterNamesRule ? [disallowedInputParameterNamesRule] : []),
-    ...specifiedRules.filter((rule) => !specifiedRulesToBeRemoved.includes(rule)),
-  ];
-}
- 
-export function NoAnonymousQueries(context: ValidationContext) {
-  return {
-    OperationDefinition(node: OperationDefinitionNode) {
-      Iif (!node.name) {
-        context.reportError(
-          new GraphQLError(
-            "Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",
-            { nodes: node })
-        );
-      }
-      return false;
-    },
-  };
-}
- 
-export function NoTypenameAlias(context: ValidationContext) {
-  return {
-    Field(node: FieldNode) {
-      const aliasName = node.alias && node.alias.value;
-      Iif (aliasName == "__typename") {
-        context.reportError(
-          new GraphQLError(
-            "Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",
-            { nodes: node })
-        );
-      }
-    },
-  };
-}
- 
-export function DeferredInlineFragmentNoTypeCondition(context: ValidationContext) {
-  return {
-    InlineFragment(node: InlineFragmentNode) {
-      Iif (node.directives) {
-        for (const directive of node.directives) {
-          Iif (directive.name.value == GraphQLDeferDirective.name && node.typeCondition == undefined) {
-            context.reportError(
-              new GraphQLError(
-                "Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",
-                { nodes: node }
-              )
-            )
-          }
-        }
-      }
-    },
-  };
-}
- 
-export function DeferredInlineFragmentMissingLabelArgument(context: ValidationContext) {
-  return {
-    InlineFragment(node: InlineFragmentNode) {
-      Iif (node.directives) {
-        for (const directive of node.directives) {
-          Iif (directive.name.value == GraphQLDeferDirective.name && !(directive.arguments?.find((element) =>
-            element.name.value == 'label'
-          ))) {
-            context.reportError(
-              new GraphQLError(
-                "Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",
-                { nodes: node }
-              )
-            )
-          }
-        }
-      }
-    }
-  }
-}
- 
-function ApolloIOSDisallowedFieldNames(fieldNames?: Array<string>) {
-  Iif (fieldNames) {
-    return function ApolloIOSDisallowedFieldNamesValidationRule(context: ValidationContext) {
-      const disallowedFieldNames = fieldNames
-      return {
-        Field(node: FieldNode) {
-          const responseKey = (node.alias ?? node.name).value
-          const responseKeyFirstLowercase = responseKey.charAt(0).toLowerCase() + responseKey.slice(1)
-          Iif (disallowedFieldNames.includes(responseKeyFirstLowercase)) {
-            context.reportError(
-              new GraphQLError(
-                `Field name "${responseKey}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,
-                { nodes: node })
-            );
-          }
-        },
-      };
-    }
-  }
-  return undefined
-}
- 
-function ApolloIOSDisallowedInputParameterNames(names?: Array<string>) {
-  Iif (names) {
-    return function ApolloIOSDisallowedInputParameterNamesValidationRule(context: ValidationContext) {
-      const disallowedNames = names
-      return {
-        VariableDefinition(node: VariableDefinitionNode) {
-          const parameterName = node.variable.name.value
-          const parameterNameFirstLowercase = parameterName.charAt(0).toLowerCase() + parameterName.slice(1)
-          Iif (disallowedNames.includes(parameterNameFirstLowercase)) {
-            context.reportError(
-              new GraphQLError(
-                `Input Parameter name "${parameterName}" is not allowed because it conflicts with generated object APIs.`,
-                { nodes: node })
-            );
-          }
-        },
-      };
-    }
-  }
-  return undefined
-}
- 
- -
-
- - - - - - - - \ No newline at end of file diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov.info b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov.info deleted file mode 100644 index cba73cba3..000000000 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/coverage/lcov.info +++ /dev/null @@ -1,1346 +0,0 @@ -TN: -SF:src/index.ts -FN:30,(anonymous_0) -FN:31,(anonymous_1) -FN:32,(anonymous_2) -FN:33,(anonymous_3) -FN:34,(anonymous_4) -FN:35,(anonymous_5) -FN:36,(anonymous_6) -FN:37,(anonymous_7) -FN:38,(anonymous_8) -FN:40,(anonymous_9) -FN:42,loadSchemaFromSources -FN:84,loadSchemaFromIntrospectionResult -FN:98,printSchemaToSDL -FN:102,parseOperationDocument -FN:106,mergeDocuments -FN:110,validateDocument -FN:118,compileDocument -FNF:17 -FNH:1 -FNDA:0,(anonymous_0) -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -FNDA:0,(anonymous_8) -FNDA:0,(anonymous_9) -FNDA:12,loadSchemaFromSources -FNDA:0,loadSchemaFromIntrospectionResult -FNDA:0,printSchemaToSDL -FNDA:0,parseOperationDocument -FNDA:0,mergeDocuments -FNDA:0,validateDocument -FNDA:0,compileDocument -DA:1,1 -DA:14,1 -DA:15,1 -DA:16,1 -DA:17,1 -DA:20,1 -DA:24,1 -DA:25,1 -DA:29,1 -DA:30,1 -DA:31,1 -DA:32,1 -DA:33,1 -DA:34,1 -DA:35,1 -DA:36,1 -DA:37,1 -DA:38,1 -DA:40,1 -DA:42,1 -DA:45,12 -DA:46,12 -DA:47,12 -DA:48,0 -DA:49,0 -DA:51,0 -DA:55,12 -DA:59,12 -DA:61,12 -DA:62,12 -DA:63,12 -DA:65,12 -DA:66,12 -DA:67,12 -DA:68,7 -DA:70,7 -DA:73,0 -DA:74,0 -DA:75,0 -DA:76,0 -DA:77,0 -DA:78,0 -DA:80,0 -DA:87,0 -DA:89,0 -DA:90,0 -DA:93,0 -DA:95,0 -DA:98,1 -DA:99,0 -DA:102,1 -DA:103,0 -DA:106,1 -DA:107,0 -DA:110,1 -DA:115,0 -DA:118,1 -DA:125,0 -LF:58 -LH:38 -BRDA:47,0,0,0 -BRDA:47,0,1,12 -BRDA:48,1,0,0 -BRDA:48,1,1,0 -BRDA:61,2,0,12 -BRDA:61,2,1,0 -BRDA:89,3,0,0 -BRF:7 -BRH:2 -end_of_record -TN: -SF:src/validationRules.ts -FN:28,defaultValidationRules -FN:38,(anonymous_1) -FN:42,NoAnonymousQueries -FN:44,(anonymous_3) -FN:57,NoTypenameAlias -FN:59,(anonymous_5) -FN:72,DeferredInlineFragmentNoTypeCondition -FN:74,(anonymous_7) -FN:91,DeferredInlineFragmentMissingLabelArgument -FN:93,(anonymous_9) -FN:96,(anonymous_10) -FN:112,ApolloIOSDisallowedFieldNames -FN:114,ApolloIOSDisallowedFieldNamesValidationRule -FN:117,(anonymous_13) -FN:134,ApolloIOSDisallowedInputParameterNames -FN:136,ApolloIOSDisallowedInputParameterNamesValidationRule -FN:139,(anonymous_16) -FNF:17 -FNH:0 -FNDA:0,defaultValidationRules -FNDA:0,(anonymous_1) -FNDA:0,NoAnonymousQueries -FNDA:0,(anonymous_3) -FNDA:0,NoTypenameAlias -FNDA:0,(anonymous_5) -FNDA:0,DeferredInlineFragmentNoTypeCondition -FNDA:0,(anonymous_7) -FNDA:0,DeferredInlineFragmentMissingLabelArgument -FNDA:0,(anonymous_9) -FNDA:0,(anonymous_10) -FNDA:0,ApolloIOSDisallowedFieldNames -FNDA:0,ApolloIOSDisallowedFieldNamesValidationRule -FNDA:0,(anonymous_13) -FNDA:0,ApolloIOSDisallowedInputParameterNames -FNDA:0,ApolloIOSDisallowedInputParameterNamesValidationRule -FNDA:0,(anonymous_16) -DA:1,1 -DA:14,1 -DA:28,1 -DA:29,0 -DA:30,0 -DA:31,0 -DA:38,0 -DA:42,1 -DA:43,0 -DA:45,0 -DA:46,0 -DA:52,0 -DA:57,1 -DA:58,0 -DA:60,0 -DA:61,0 -DA:62,0 -DA:72,1 -DA:73,0 -DA:75,0 -DA:76,0 -DA:77,0 -DA:78,0 -DA:91,1 -DA:92,0 -DA:94,0 -DA:95,0 -DA:96,0 -DA:97,0 -DA:99,0 -DA:113,0 -DA:114,0 -DA:115,0 -DA:116,0 -DA:118,0 -DA:119,0 -DA:120,0 -DA:121,0 -DA:131,0 -DA:135,0 -DA:136,0 -DA:137,0 -DA:138,0 -DA:140,0 -DA:141,0 -DA:142,0 -DA:143,0 -DA:153,0 -LF:48 -LH:7 -BRDA:29,0,0,0 -BRDA:29,0,1,0 -BRDA:29,1,0,0 -BRDA:29,1,1,0 -BRDA:36,2,0,0 -BRDA:36,2,1,0 -BRDA:37,3,0,0 -BRDA:37,3,1,0 -BRDA:45,4,0,0 -BRDA:60,5,0,0 -BRDA:60,5,1,0 -BRDA:61,6,0,0 -BRDA:75,7,0,0 -BRDA:77,8,0,0 -BRDA:77,9,0,0 -BRDA:77,9,1,0 -BRDA:94,10,0,0 -BRDA:96,11,0,0 -BRDA:96,12,0,0 -BRDA:96,12,1,0 -BRDA:96,13,0,0 -BRDA:96,13,1,0 -BRDA:96,14,0,0 -BRDA:96,14,1,0 -BRDA:113,15,0,0 -BRDA:118,16,0,0 -BRDA:118,16,1,0 -BRDA:118,17,0,0 -BRDA:118,17,1,0 -BRDA:120,18,0,0 -BRDA:135,19,0,0 -BRDA:142,20,0,0 -BRF:32 -BRH:0 -end_of_record -TN: -SF:src/compiler/index.ts -FN:45,filePathForNode -FN:57,compileToIR -FN:111,addReferencedType -FN:146,addReferencedTypesFromInputObject -FN:156,hasTypePolicyDirective -FN:168,getFragment -FN:183,compileOperation -FN:196,(anonymous_7) -FN:253,compileFragment -FN:293,overrideAsLocalCacheMutation -FN:296,(anonymous_10) -FN:302,compileSelectionSet -FN:310,(anonymous_12) -FN:317,compileSelection -FN:358,validateFieldName -FN:441,compileArguments -FN:448,(anonymous_16) -FN:451,(anonymous_17) -FN:472,compileDirectives -FN:511,compileInclusionCondition -FNF:20 -FNH:0 -FNDA:0,filePathForNode -FNDA:0,compileToIR -FNDA:0,addReferencedType -FNDA:0,addReferencedTypesFromInputObject -FNDA:0,hasTypePolicyDirective -FNDA:0,getFragment -FNDA:0,compileOperation -FNDA:0,(anonymous_7) -FNDA:0,compileFragment -FNDA:0,overrideAsLocalCacheMutation -FNDA:0,(anonymous_10) -FNDA:0,compileSelectionSet -FNDA:0,(anonymous_12) -FNDA:0,compileSelection -FNDA:0,validateFieldName -FNDA:0,compileArguments -FNDA:0,(anonymous_16) -FNDA:0,(anonymous_17) -FNDA:0,compileDirectives -FNDA:0,compileInclusionCondition -DA:1,1 -DA:8,1 -DA:41,1 -DA:43,1 -DA:46,0 -DA:57,1 -DA:65,0 -DA:67,0 -DA:68,0 -DA:70,0 -DA:73,0 -DA:74,0 -DA:75,0 -DA:76,0 -DA:78,0 -DA:79,0 -DA:80,0 -DA:83,0 -DA:89,0 -DA:90,0 -DA:92,0 -DA:99,0 -DA:100,0 -DA:103,0 -DA:112,0 -DA:114,0 -DA:116,0 -DA:117,0 -DA:119,0 -DA:121,0 -DA:122,0 -DA:123,0 -DA:128,0 -DA:129,0 -DA:130,0 -DA:131,0 -DA:135,0 -DA:136,0 -DA:139,0 -DA:140,0 -DA:141,0 -DA:149,0 -DA:150,0 -DA:151,0 -DA:152,0 -DA:159,0 -DA:160,0 -DA:161,0 -DA:162,0 -DA:165,0 -DA:169,0 -DA:170,0 -DA:172,0 -DA:173,0 -DA:176,0 -DA:178,0 -DA:179,0 -DA:180,0 -DA:186,0 -DA:187,0 -DA:190,0 -DA:191,0 -DA:192,0 -DA:193,0 -DA:195,0 -DA:197,0 -DA:198,0 -DA:203,0 -DA:207,0 -DA:208,0 -DA:214,0 -DA:216,0 -DA:224,0 -DA:228,0 -DA:229,0 -DA:231,0 -DA:233,0 -DA:234,0 -DA:236,0 -DA:237,0 -DA:240,0 -DA:256,0 -DA:258,0 -DA:259,0 -DA:263,0 -DA:265,0 -DA:270,0 -DA:272,0 -DA:274,0 -DA:275,0 -DA:277,0 -DA:278,0 -DA:281,0 -DA:296,0 -DA:297,0 -DA:298,0 -DA:307,0 -DA:311,0 -DA:322,0 -DA:324,0 -DA:326,0 -DA:327,0 -DA:328,0 -DA:330,0 -DA:331,0 -DA:332,0 -DA:338,0 -DA:339,0 -DA:341,0 -DA:343,0 -DA:344,0 -DA:346,0 -DA:359,0 -DA:360,0 -DA:361,0 -DA:363,0 -DA:364,0 -DA:372,0 -DA:373,0 -DA:374,0 -DA:375,0 -DA:378,0 -DA:379,0 -DA:381,0 -DA:382,0 -DA:390,0 -DA:396,0 -DA:399,0 -DA:400,0 -DA:404,0 -DA:406,0 -DA:418,0 -DA:420,0 -DA:421,0 -DA:422,0 -DA:428,0 -DA:430,0 -DA:436,0 -DA:446,0 -DA:447,0 -DA:449,0 -DA:450,0 -DA:451,0 -DA:453,0 -DA:455,0 -DA:456,0 -DA:462,0 -DA:475,0 -DA:476,0 -DA:477,0 -DA:479,0 -DA:480,0 -DA:481,0 -DA:483,0 -DA:484,0 -DA:490,0 -DA:497,0 -DA:498,0 -DA:501,0 -DA:507,0 -DA:515,0 -DA:516,0 -DA:517,0 -DA:519,0 -DA:521,0 -DA:522,0 -DA:524,0 -DA:528,0 -DA:534,0 -DA:538,0 -DA:541,0 -LF:171 -LH:5 -BRDA:46,0,0,0 -BRDA:46,0,1,0 -BRDA:46,1,0,0 -BRDA:46,1,1,0 -BRDA:46,2,0,0 -BRDA:46,2,1,0 -BRDA:46,3,0,0 -BRDA:46,3,1,0 -BRDA:68,4,0,0 -BRDA:79,5,0,0 -BRDA:85,6,0,0 -BRDA:85,6,1,0 -BRDA:85,7,0,0 -BRDA:85,7,1,0 -BRDA:86,8,0,0 -BRDA:86,8,1,0 -BRDA:86,9,0,0 -BRDA:86,9,1,0 -BRDA:90,10,0,0 -BRDA:108,11,0,0 -BRDA:108,11,1,0 -BRDA:108,12,0,0 -BRDA:108,12,1,0 -BRDA:112,13,0,0 -BRDA:116,14,0,0 -BRDA:122,15,0,0 -BRDA:122,16,0,0 -BRDA:122,16,1,0 -BRDA:128,17,0,0 -BRDA:135,18,0,0 -BRDA:139,19,0,0 -BRDA:160,20,0,0 -BRDA:160,20,1,0 -BRDA:160,21,0,0 -BRDA:160,21,1,0 -BRDA:160,22,0,0 -BRDA:160,22,1,0 -BRDA:160,23,0,0 -BRDA:160,23,1,0 -BRDA:161,24,0,0 -BRDA:170,25,0,0 -BRDA:173,26,0,0 -BRDA:186,27,0,0 -BRDA:195,28,0,0 -BRDA:195,28,1,0 -BRDA:198,29,0,0 -BRDA:198,29,1,0 -BRDA:207,30,0,0 -BRDA:229,31,0,0 -BRDA:229,31,1,0 -BRDA:229,32,0,0 -BRDA:229,32,1,0 -BRDA:236,33,0,0 -BRDA:270,34,0,0 -BRDA:270,34,1,0 -BRDA:270,35,0,0 -BRDA:270,35,1,0 -BRDA:277,36,0,0 -BRDA:322,37,0,0 -BRDA:322,37,1,0 -BRDA:322,38,0,0 -BRDA:322,38,1,0 -BRDA:324,39,0,0 -BRDA:324,39,1,0 -BRDA:324,39,2,0 -BRDA:327,40,0,0 -BRDA:328,41,0,0 -BRDA:328,41,1,0 -BRDA:328,42,0,0 -BRDA:328,42,1,0 -BRDA:331,43,0,0 -BRDA:353,44,0,0 -BRDA:353,44,1,0 -BRDA:353,45,0,0 -BRDA:353,45,1,0 -BRDA:354,46,0,0 -BRDA:354,46,1,0 -BRDA:359,47,0,0 -BRDA:359,48,0,0 -BRDA:359,48,1,0 -BRDA:360,49,0,0 -BRDA:360,49,1,0 -BRDA:360,50,0,0 -BRDA:360,50,1,0 -BRDA:363,51,0,0 -BRDA:363,52,0,0 -BRDA:363,52,1,0 -BRDA:363,53,0,0 -BRDA:363,53,1,0 -BRDA:372,54,0,0 -BRDA:372,54,1,0 -BRDA:372,55,0,0 -BRDA:372,55,1,0 -BRDA:372,55,2,0 -BRDA:373,56,0,0 -BRDA:373,56,1,0 -BRDA:373,57,0,0 -BRDA:373,57,1,0 -BRDA:374,58,0,0 -BRDA:375,59,0,0 -BRDA:375,59,1,0 -BRDA:375,60,0,0 -BRDA:375,60,1,0 -BRDA:378,61,0,0 -BRDA:381,62,0,0 -BRDA:400,63,0,0 -BRDA:400,63,1,0 -BRDA:421,64,0,0 -BRDA:447,65,0,0 -BRDA:447,65,1,0 -BRDA:447,66,0,0 -BRDA:447,66,1,0 -BRDA:453,67,0,0 -BRDA:453,67,1,0 -BRDA:453,68,0,0 -BRDA:453,68,1,0 -BRDA:455,69,0,0 -BRDA:466,70,0,0 -BRDA:466,70,1,0 -BRDA:466,71,0,0 -BRDA:466,71,1,0 -BRDA:475,72,0,0 -BRDA:475,72,1,0 -BRDA:475,73,0,0 -BRDA:475,73,1,0 -BRDA:483,74,0,0 -BRDA:498,75,0,0 -BRDA:503,76,0,0 -BRDA:503,76,1,0 -BRDA:515,77,0,0 -BRDA:515,77,1,0 -BRDA:515,78,0,0 -BRDA:515,78,1,0 -BRDA:516,79,0,0 -BRDA:516,79,1,0 -BRDA:516,80,0,0 -BRDA:516,80,1,0 -BRDA:519,81,0,0 -BRDA:519,81,1,0 -BRDA:519,81,2,0 -BRDA:519,82,0,0 -BRDA:519,82,1,0 -BRDA:519,83,0,0 -BRDA:519,83,1,0 -BRDA:521,84,0,0 -BRDA:521,84,1,0 -BRDA:522,85,0,0 -BRDA:522,85,1,0 -BRDA:524,86,0,0 -BRDA:524,86,1,0 -BRF:150 -BRH:0 -end_of_record -TN: -SF:src/compiler/values.ts -FN:28,valueFromValueNode -FN:40,(anonymous_1) -FNF:2 -FNH:0 -FNDA:0,valueFromValueNode -FNDA:0,(anonymous_1) -DA:1,1 -DA:28,1 -DA:29,0 -DA:31,0 -DA:33,0 -DA:38,0 -DA:41,0 -DA:42,0 -DA:46,0 -LF:9 -LH:2 -BRDA:29,0,0,0 -BRDA:29,0,1,0 -BRDA:29,0,2,0 -BRDA:29,0,3,0 -BRF:4 -BRH:0 -end_of_record -TN: -SF:src/utilities/apolloCodegenSchemaExtension.ts -FN:73,addApolloCodegenSchemaExtensionToDocument -FN:74,(anonymous_1) -FN:74,(anonymous_2) -FNF:3 -FNH:3 -FNDA:12,addApolloCodegenSchemaExtensionToDocument -FNDA:48,(anonymous_1) -FNDA:140,(anonymous_2) -DA:1,1 -DA:2,1 -DA:4,1 -DA:12,1 -DA:28,1 -DA:50,1 -DA:66,1 -DA:73,1 -DA:74,48 -DA:75,140 -DA:79,12 -LF:11 -LH:11 -BRDA:75,0,0,140 -BRDA:75,0,1,0 -BRF:2 -BRH:1 -end_of_record -TN: -SF:src/utilities/experimentalDeferDirective.ts -FN:19,addExperimentalDeferDirectiveToSDLDocument -FN:34,(anonymous_1) -FN:53,addExperimentalDeferDirectiveToIntrospectionSchema -FN:70,isDeferDirectiveDefinitionNodePredicate -FN:77,experimentalDeferDirectiveDocumentNode -FN:86,matchDirectiveDefinition -FN:89,(anonymous_6) -FN:90,(anonymous_7) -FN:90,(anonymous_8) -FN:96,matchDirective -FN:100,(anonymous_10) -FN:100,(anonymous_11) -FNF:12 -FNH:3 -FNDA:12,addExperimentalDeferDirectiveToSDLDocument -FNDA:0,(anonymous_1) -FNDA:0,addExperimentalDeferDirectiveToIntrospectionSchema -FNDA:83,isDeferDirectiveDefinitionNodePredicate -FNDA:12,experimentalDeferDirectiveDocumentNode -FNDA:0,matchDirectiveDefinition -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -FNDA:0,(anonymous_8) -FNDA:0,matchDirective -FNDA:0,(anonymous_10) -FNDA:0,(anonymous_11) -DA:1,1 -DA:11,1 -DA:19,1 -DA:20,12 -DA:22,12 -DA:23,12 -DA:26,0 -DA:28,0 -DA:29,0 -DA:31,0 -DA:34,0 -DA:38,0 -DA:41,0 -DA:53,1 -DA:54,0 -DA:56,0 -DA:57,0 -DA:60,0 -DA:61,0 -DA:63,0 -DA:66,0 -DA:71,83 -DA:78,12 -DA:87,0 -DA:89,0 -DA:90,0 -DA:97,0 -DA:100,0 -LF:28 -LH:9 -BRDA:22,0,0,12 -BRDA:28,1,0,0 -BRDA:34,2,0,0 -BRDA:34,2,1,0 -BRDA:56,3,0,0 -BRDA:60,4,0,0 -BRDA:72,5,0,83 -BRDA:72,5,1,48 -BRDA:88,6,0,0 -BRDA:88,6,1,0 -BRDA:88,6,2,0 -BRDA:90,7,0,0 -BRDA:90,7,1,0 -BRDA:90,8,0,0 -BRDA:90,8,1,0 -BRDA:98,9,0,0 -BRDA:98,9,1,0 -BRDA:98,9,2,0 -BRF:18 -BRH:3 -end_of_record -TN: -SF:src/utilities/fieldPolicyDirective.ts -FN:24,addFieldPolicyDirectivesToSchema -FN:39,applyFieldPoliciesFor -FN:51,(anonymous_2) -FN:66,(anonymous_3) -FN:92,(anonymous_4) -FN:141,fieldPolicyDirectivesFor -FN:152,(anonymous_6) -FN:191,matchDirectiveArguments -FN:197,(anonymous_8) -FN:203,(anonymous_9) -FNF:10 -FNH:10 -FNDA:12,addFieldPolicyDirectivesToSchema -FNDA:62,applyFieldPoliciesFor -FNDA:15,(anonymous_2) -FNDA:30,(anonymous_3) -FNDA:18,(anonymous_4) -FNDA:66,fieldPolicyDirectivesFor -FNDA:12,(anonymous_6) -FNDA:2,matchDirectiveArguments -FNDA:4,(anonymous_8) -FNDA:4,(anonymous_9) -DA:1,1 -DA:15,1 -DA:17,1 -DA:24,1 -DA:27,12 -DA:29,12 -DA:30,98 -DA:32,98 -DA:34,62 -DA:39,1 -DA:42,62 -DA:43,62 -DA:44,0 -DA:47,62 -DA:49,62 -DA:50,15 -DA:51,15 -DA:53,15 -DA:54,15 -DA:55,15 -DA:58,15 -DA:59,0 -DA:65,15 -DA:66,30 -DA:68,15 -DA:69,15 -DA:70,15 -DA:71,15 -DA:74,15 -DA:75,0 -DA:82,15 -DA:83,15 -DA:84,0 -DA:91,15 -DA:92,18 -DA:93,15 -DA:94,18 -DA:95,1 -DA:105,14 -DA:106,14 -DA:107,14 -DA:109,14 -DA:110,16 -DA:111,4 -DA:116,14 -DA:117,1 -DA:125,13 -DA:126,3 -DA:133,10 -DA:134,10 -DA:136,0 -DA:144,66 -DA:145,0 -DA:148,66 -DA:150,66 -DA:151,12 -DA:152,12 -DA:154,12 -DA:155,12 -DA:159,66 -DA:160,5 -DA:161,5 -DA:165,66 -DA:166,66 -DA:167,4 -DA:168,4 -DA:169,0 -DA:172,4 -DA:173,4 -DA:174,4 -DA:175,2 -DA:176,2 -DA:177,2 -DA:181,4 -DA:182,2 -DA:188,66 -DA:195,2 -DA:198,4 -DA:204,4 -LF:79 -LH:72 -BRDA:32,0,0,62 -BRDA:32,1,0,98 -BRDA:32,1,1,41 -BRDA:43,2,0,0 -BRDA:43,3,0,62 -BRDA:43,3,1,62 -BRDA:50,4,0,0 -BRDA:50,4,1,15 -BRDA:50,5,0,15 -BRDA:50,5,1,15 -BRDA:50,6,0,0 -BRDA:50,6,1,15 -BRDA:50,7,0,15 -BRDA:50,7,1,15 -BRDA:54,8,0,15 -BRDA:54,9,0,0 -BRDA:54,9,1,15 -BRDA:54,10,0,15 -BRDA:54,10,1,15 -BRDA:58,11,0,0 -BRDA:65,12,0,0 -BRDA:65,12,1,15 -BRDA:65,13,0,15 -BRDA:65,13,1,15 -BRDA:65,14,0,0 -BRDA:65,14,1,15 -BRDA:65,15,0,15 -BRDA:65,15,1,15 -BRDA:69,16,0,15 -BRDA:69,17,0,0 -BRDA:69,17,1,15 -BRDA:69,18,0,15 -BRDA:69,18,1,15 -BRDA:74,19,0,0 -BRDA:83,20,0,0 -BRDA:86,21,0,0 -BRDA:86,21,1,0 -BRDA:91,22,0,0 -BRDA:91,22,1,15 -BRDA:91,23,0,15 -BRDA:91,23,1,15 -BRDA:92,24,0,15 -BRDA:92,24,1,0 -BRDA:92,25,0,15 -BRDA:92,25,1,15 -BRDA:92,26,0,0 -BRDA:92,26,1,15 -BRDA:92,27,0,15 -BRDA:92,27,1,15 -BRDA:94,28,0,1 -BRDA:105,29,0,14 -BRDA:110,30,0,4 -BRDA:116,31,0,1 -BRDA:125,32,0,3 -BRDA:125,33,0,13 -BRDA:125,33,1,3 -BRDA:125,33,2,11 -BRDA:125,33,3,2 -BRDA:133,34,0,10 -BRDA:133,34,1,0 -BRDA:144,35,0,0 -BRDA:144,36,0,66 -BRDA:144,36,1,9 -BRDA:150,37,0,66 -BRDA:150,37,1,0 -BRDA:150,38,0,66 -BRDA:150,38,1,66 -BRDA:151,39,0,0 -BRDA:151,39,1,12 -BRDA:151,40,0,12 -BRDA:151,40,1,12 -BRDA:154,41,0,12 -BRDA:159,42,0,5 -BRDA:159,42,1,61 -BRDA:159,43,0,66 -BRDA:159,43,1,66 -BRDA:159,44,0,42 -BRDA:159,44,1,24 -BRDA:159,45,0,66 -BRDA:159,45,1,66 -BRDA:160,46,0,5 -BRDA:165,47,0,66 -BRDA:168,48,0,0 -BRDA:175,49,0,2 -BRDA:181,50,0,2 -BRDA:196,51,0,2 -BRDA:196,51,1,0 -BRDA:196,52,0,2 -BRDA:196,52,1,2 -BRDA:202,53,0,2 -BRDA:202,53,1,0 -BRDA:202,54,0,2 -BRDA:202,54,1,2 -BRF:93 -BRH:71 -end_of_record -TN: -SF:src/utilities/graphql.ts -FN:29,(anonymous_0) -FN:30,(anonymous_1) -FN:36,assertValidSDL -FN:43,assertValidSchema -FN:50,sourceAt -FN:54,filePathForNode -FN:58,isMetaFieldName -FN:62,containsLocalCacheMutationDirective -FN:79,transformToNetworkRequestSourceDefinition -FN:89,(anonymous_9) -FN:97,(anonymous_10) -FN:102,(anonymous_11) -FN:109,addTypenameFieldToSelectionSetIfNeeded -FN:110,(anonymous_13) -FN:124,transformTypenameFieldIfNeeded -FN:136,stripApolloClientSpecificDirectives -FN:158,getFieldDef -FNF:17 -FNH:2 -FNDA:0,(anonymous_0) -FNDA:0,(anonymous_1) -FNDA:12,assertValidSDL -FNDA:7,assertValidSchema -FNDA:0,sourceAt -FNDA:0,filePathForNode -FNDA:0,isMetaFieldName -FNDA:0,containsLocalCacheMutationDirective -FNDA:0,transformToNetworkRequestSourceDefinition -FNDA:0,(anonymous_9) -FNDA:0,(anonymous_10) -FNDA:0,(anonymous_11) -FNDA:0,addTypenameFieldToSelectionSetIfNeeded -FNDA:0,(anonymous_13) -FNDA:0,transformTypenameFieldIfNeeded -FNDA:0,stripApolloClientSpecificDirectives -FNDA:0,getFieldDef -DA:1,1 -DA:23,1 -DA:24,1 -DA:25,1 -DA:26,1 -DA:28,1 -DA:29,0 -DA:30,0 -DA:32,0 -DA:36,1 -DA:37,12 -DA:38,12 -DA:39,0 -DA:43,1 -DA:44,7 -DA:45,7 -DA:46,0 -DA:50,1 -DA:51,0 -DA:54,1 -DA:55,0 -DA:58,1 -DA:59,0 -DA:62,1 -DA:63,0 -DA:65,0 -DA:66,0 -DA:67,0 -DA:71,0 -DA:74,1 -DA:79,1 -DA:83,0 -DA:84,0 -DA:87,0 -DA:90,0 -DA:91,0 -DA:93,0 -DA:98,0 -DA:103,0 -DA:110,0 -DA:111,0 -DA:114,0 -DA:115,0 -DA:117,0 -DA:125,0 -DA:126,0 -DA:132,0 -DA:137,0 -DA:142,0 -DA:143,0 -DA:144,0 -DA:148,0 -DA:158,1 -DA:163,0 -DA:167,0 -DA:169,0 -DA:170,0 -DA:172,0 -DA:178,0 -DA:180,0 -DA:181,0 -DA:184,0 -LF:62 -LH:19 -BRDA:38,0,0,0 -BRDA:45,1,0,0 -BRDA:55,2,0,0 -BRDA:55,2,1,0 -BRDA:55,3,0,0 -BRDA:55,3,1,0 -BRDA:55,4,0,0 -BRDA:55,4,1,0 -BRDA:55,5,0,0 -BRDA:55,5,1,0 -BRDA:63,6,0,0 -BRDA:66,7,0,0 -BRDA:83,8,0,0 -BRDA:90,9,0,0 -BRDA:90,10,0,0 -BRDA:90,10,1,0 -BRDA:111,11,0,0 -BRDA:111,11,1,0 -BRDA:114,12,0,0 -BRDA:114,12,1,0 -BRDA:125,13,0,0 -BRDA:125,13,1,0 -BRDA:143,14,0,0 -BRDA:163,15,0,0 -BRDA:164,16,0,0 -BRDA:164,16,1,0 -BRDA:169,17,0,0 -BRDA:169,18,0,0 -BRDA:169,18,1,0 -BRDA:172,19,0,0 -BRDA:173,20,0,0 -BRDA:173,20,1,0 -BRDA:173,20,2,0 -BRDA:173,20,3,0 -BRDA:180,21,0,0 -BRDA:180,22,0,0 -BRDA:180,22,1,0 -BRF:37 -BRH:0 -end_of_record -TN: -SF:src/utilities/index.ts -FNF:0 -FNH:0 -DA:1,1 -DA:2,1 -DA:3,1 -DA:4,1 -LF:4 -LH:4 -BRF:0 -BRH:0 -end_of_record -TN: -SF:src/utilities/legacySafelistingTransform.ts -FN:14,addTypeNameFieldForLegacySafelisting -FN:16,(anonymous_1) -FN:25,(anonymous_2) -FN:34,(anonymous_3) -FNF:4 -FNH:0 -FNDA:0,addTypeNameFieldForLegacySafelisting -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -DA:1,1 -DA:9,1 -DA:14,1 -DA:15,0 -DA:17,0 -DA:20,0 -DA:22,0 -DA:26,0 -DA:35,0 -DA:42,0 -DA:44,0 -DA:46,0 -LF:12 -LH:3 -BRDA:17,0,0,0 -BRDA:17,0,1,0 -BRDA:27,1,0,0 -BRDA:27,1,1,0 -BRDA:35,2,0,0 -BRDA:37,3,0,0 -BRDA:37,3,1,0 -BRDA:37,3,2,0 -BRDA:44,4,0,0 -BRF:9 -BRH:0 -end_of_record -TN: -SF:src/utilities/nodeHelpers.ts -FN:3,nameNode -FN:10,stringNode -FN:17,inputValueDefinitionNode -FN:26,definitionNode -FN:32,(anonymous_4) -FN:33,(anonymous_5) -FN:37,typeNode -FN:44,nonNullNode -FNF:8 -FNH:8 -FNDA:108,nameNode -FNDA:44,stringNode -FNDA:24,inputValueDefinitionNode -FNDA:12,definitionNode -FNDA:24,(anonymous_4) -FNDA:24,(anonymous_5) -FNDA:28,typeNode -FNDA:4,nonNullNode -DA:1,1 -DA:3,1 -DA:4,108 -DA:10,1 -DA:11,44 -DA:17,1 -DA:18,24 -DA:26,1 -DA:27,12 -DA:32,24 -DA:33,24 -DA:37,1 -DA:38,28 -DA:44,1 -DA:45,4 -LF:15 -LH:15 -BRDA:29,0,0,12 -BRDA:29,0,1,0 -BRF:2 -BRH:1 -end_of_record -TN: -SF:src/utilities/predicates.ts -FN:1,isNotNullOrUndefined -FN:7,isObject -FNF:2 -FNH:0 -FNDA:0,isNotNullOrUndefined -FNDA:0,isObject -DA:1,1 -DA:4,0 -DA:7,1 -DA:8,0 -LF:4 -LH:2 -BRDA:4,0,0,0 -BRDA:4,0,1,0 -BRDA:9,1,0,0 -BRDA:9,1,1,0 -BRDA:9,1,2,0 -BRDA:9,1,3,0 -BRF:6 -BRH:0 -end_of_record -TN: -SF:src/utilities/typePolicyDirective.ts -FN:24,matchDirectiveArguments -FN:30,(anonymous_1) -FN:36,(anonymous_2) -FN:44,typePolicyDirectiveFor -FN:53,(anonymous_4) -FN:94,validateKeyFields -FN:147,keyFieldsFor -FN:154,(anonymous_7) -FN:167,addTypePolicyDirectivesToSchema -FNF:9 -FNH:4 -FNDA:0,matchDirectiveArguments -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:101,typePolicyDirectiveFor -FNDA:12,(anonymous_4) -FNDA:0,validateKeyFields -FNDA:97,keyFieldsFor -FNDA:0,(anonymous_7) -FNDA:12,addTypePolicyDirectivesToSchema -DA:1,1 -DA:15,1 -DA:17,1 -DA:28,0 -DA:31,0 -DA:37,0 -DA:47,101 -DA:48,0 -DA:51,101 -DA:52,12 -DA:53,12 -DA:55,12 -DA:56,0 -DA:61,101 -DA:62,5 -DA:63,0 -DA:64,0 -DA:68,101 -DA:69,101 -DA:70,4 -DA:71,4 -DA:73,0 -DA:74,0 -DA:75,0 -DA:76,0 -DA:77,0 -DA:82,0 -DA:91,101 -DA:98,0 -DA:100,0 -DA:101,0 -DA:104,0 -DA:106,0 -DA:107,0 -DA:108,0 -DA:109,0 -DA:115,0 -DA:116,0 -DA:117,0 -DA:123,0 -DA:124,0 -DA:134,0 -DA:135,0 -DA:147,1 -DA:148,97 -DA:149,97 -DA:150,97 -DA:153,0 -DA:154,0 -DA:156,0 -DA:157,0 -DA:160,0 -DA:162,0 -DA:164,0 -DA:167,1 -DA:168,12 -DA:170,12 -DA:171,158 -DA:173,158 -DA:174,97 -LF:60 -LH:25 -BRDA:29,0,0,0 -BRDA:29,0,1,0 -BRDA:29,1,0,0 -BRDA:29,1,1,0 -BRDA:35,2,0,0 -BRDA:35,2,1,0 -BRDA:35,3,0,0 -BRDA:35,3,1,0 -BRDA:47,4,0,0 -BRDA:51,5,0,101 -BRDA:51,5,1,0 -BRDA:51,6,0,101 -BRDA:51,6,1,101 -BRDA:52,7,0,0 -BRDA:52,7,1,12 -BRDA:52,8,0,12 -BRDA:52,8,1,12 -BRDA:55,9,0,0 -BRDA:61,10,0,5 -BRDA:61,10,1,96 -BRDA:61,11,0,101 -BRDA:61,11,1,101 -BRDA:61,12,0,72 -BRDA:61,12,1,29 -BRDA:61,13,0,101 -BRDA:61,13,1,101 -BRDA:62,14,0,0 -BRDA:68,15,0,101 -BRDA:71,16,0,4 -BRDA:73,17,0,0 -BRDA:73,17,1,0 -BRDA:75,18,0,0 -BRDA:76,19,0,0 -BRDA:76,19,1,0 -BRDA:100,20,0,0 -BRDA:104,21,0,0 -BRDA:104,21,1,0 -BRDA:108,22,0,0 -BRDA:116,23,0,0 -BRDA:119,24,0,0 -BRDA:119,24,1,0 -BRDA:123,25,0,0 -BRDA:127,26,0,0 -BRDA:127,26,1,0 -BRDA:134,27,0,0 -BRDA:138,28,0,0 -BRDA:138,28,1,0 -BRDA:149,29,0,97 -BRDA:153,30,0,0 -BRDA:153,30,1,0 -BRDA:153,31,0,0 -BRDA:153,31,1,0 -BRDA:153,32,0,0 -BRDA:153,32,1,0 -BRDA:153,33,0,0 -BRDA:153,33,1,0 -BRDA:153,34,0,0 -BRDA:153,34,1,0 -BRDA:153,35,0,0 -BRDA:153,35,1,0 -BRDA:156,36,0,0 -BRDA:156,37,0,0 -BRDA:156,37,1,0 -BRDA:173,38,0,97 -BRDA:173,39,0,158 -BRDA:173,39,1,66 -BRF:66 -BRH:20 -end_of_record diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json index 8f6638efe..17a4a97ff 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json @@ -16,7 +16,7 @@ "@rollup/plugin-node-resolve": "16.0.1", "@rollup/plugin-replace": "6.0.2", "@rollup/plugin-terser": "0.4.4", - "@rollup/plugin-typescript": "12.1.2", + "@rollup/plugin-typescript": "12.1.4", "@types/common-tags": "1.8.4", "@types/jest": "30.0.0", "common-tags": "1.8.2", @@ -47,7 +47,6 @@ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", @@ -58,32 +57,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.5.tgz", - "integrity": "sha512-KiRAp/VoJaWkkte84TvUd9qjdbZAdiqyvMxrGl1N6vzFogKmaLgoM3L1kgtLicp2HP5fBJS8JrZKLVIZGVJAVg==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.0.tgz", + "integrity": "sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz", - "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.3.tgz", + "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, - "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.3", + "@babel/generator": "^7.28.3", "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-module-transforms": "^7.27.3", - "@babel/helpers": "^7.27.4", - "@babel/parser": "^7.27.4", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.3", + "@babel/parser": "^7.28.3", "@babel/template": "^7.27.2", - "@babel/traverse": "^7.27.4", - "@babel/types": "^7.27.3", + "@babel/traverse": "^7.28.3", + "@babel/types": "^7.28.2", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -99,16 +96,15 @@ } }, "node_modules/@babel/generator": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.5.tgz", - "integrity": "sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.3.tgz", + "integrity": "sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/parser": "^7.27.5", - "@babel/types": "^7.27.3", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", + "@babel/parser": "^7.28.3", + "@babel/types": "^7.28.2", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" }, "engines": { @@ -120,7 +116,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/compat-data": "^7.27.2", "@babel/helper-validator-option": "^7.27.1", @@ -132,12 +127,20 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-module-imports": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", "dev": true, - "license": "MIT", "dependencies": { "@babel/traverse": "^7.27.1", "@babel/types": "^7.27.1" @@ -147,15 +150,14 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.27.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz", - "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.27.3" + "@babel/traverse": "^7.28.3" }, "engines": { "node": ">=6.9.0" @@ -169,7 +171,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -179,7 +180,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -189,7 +189,6 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -199,33 +198,30 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.6.tgz", - "integrity": "sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.3.tgz", + "integrity": "sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/template": "^7.27.2", - "@babel/types": "^7.27.6" + "@babel/types": "^7.28.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.27.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.5.tgz", - "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.3.tgz", + "integrity": "sha512-7+Ey1mAgYqFAx2h0RuoxcQT5+MlG3GTV0TQrgr7/ZliKsm/MNDxVVutlWaziMq7wJNAz8MTqz55XLpWvva6StA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/types": "^7.27.3" + "@babel/types": "^7.28.2" }, "bin": { "parser": "bin/babel-parser.js" @@ -275,7 +271,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -291,7 +286,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz", "integrity": "sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -331,7 +325,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -419,7 +412,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -450,7 +442,6 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, @@ -466,7 +457,6 @@ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/parser": "^7.27.2", @@ -477,30 +467,28 @@ } }, "node_modules/@babel/traverse": { - "version": "7.27.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz", - "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.3.tgz", + "integrity": "sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.3", - "@babel/parser": "^7.27.4", + "@babel/generator": "^7.28.3", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.3", "@babel/template": "^7.27.2", - "@babel/types": "^7.27.3", - "debug": "^4.3.1", - "globals": "^11.1.0" + "@babel/types": "^7.28.2", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz", - "integrity": "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q==", + "version": "7.28.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.2.tgz", + "integrity": "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" @@ -513,15 +501,13 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emnapi/core": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.5.tgz", "integrity": "sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "@emnapi/wasi-threads": "1.0.4", @@ -533,7 +519,6 @@ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.5.tgz", "integrity": "sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -544,7 +529,6 @@ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.4.tgz", "integrity": "sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -555,7 +539,6 @@ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, - "license": "ISC", "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -598,7 +581,6 @@ "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.0.5.tgz", "integrity": "sha512-xY6b0XiL0Nav3ReresUarwl2oIz1gTnxGbGpho9/rbUWsLH0f1OD/VT84xs8c7VmH7MChnLb0pag6PhZhAdDiA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@types/node": "*", @@ -611,12 +593,31 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/@jest/console/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/core": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.0.5.tgz", "integrity": "sha512-fKD0OulvRsXF1hmaFgHhVJzczWzA1RXMMo9LTPuFXo9q/alDbME3JIyWYqovWsUBWSoBcsHaGPSLF9rz4l9Qeg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "30.0.5", "@jest/pattern": "30.0.1", @@ -659,12 +660,31 @@ } } }, + "node_modules/@jest/core/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/diff-sequences": { "version": "30.0.1", "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.0.1.tgz", "integrity": "sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==", "dev": true, - "license": "MIT", "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } @@ -674,7 +694,6 @@ "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.0.5.tgz", "integrity": "sha512-aRX7WoaWx1oaOkDQvCWImVQ8XNtdv5sEWgk4gxR6NXb7WBUnL5sRak4WRzIQRZ1VTWPvV4VI4mgGjNL9TeKMYA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/fake-timers": "30.0.5", "@jest/types": "30.0.5", @@ -690,7 +709,6 @@ "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.0.5.tgz", "integrity": "sha512-6udac8KKrtTtC+AXZ2iUN/R7dp7Ydry+Fo6FPFnDG54wjVMnb6vW/XNlf7Xj8UDjAE3aAVAsR4KFyKk3TCXmTA==", "dev": true, - "license": "MIT", "dependencies": { "expect": "30.0.5", "jest-snapshot": "30.0.5" @@ -700,11 +718,22 @@ } }, "node_modules/@jest/expect-utils": { + "version": "30.1.1", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.1.1.tgz", + "integrity": "sha512-5YUHr27fpJ64dnvtu+tt11ewATynrHkGYD+uSFgRr8V2eFJis/vEXgToyLwccIwqBihVfz9jwio+Zr1ab1Zihw==", + "dev": true, + "dependencies": { + "@jest/get-type": "30.1.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect/node_modules/@jest/expect-utils": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.0.5.tgz", "integrity": "sha512-F3lmTT7CXWYywoVUGTCmom0vXq3HTTkaZyTAzIy+bXSBizB7o5qzlC9VCtq0arOa8GqmNsbg/cE9C6HLn7Szew==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.0.1" }, @@ -712,12 +741,87 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/@jest/expect/node_modules/@jest/get-type": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", + "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", + "dev": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect/node_modules/expect": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.0.5.tgz", + "integrity": "sha512-P0te2pt+hHI5qLJkIR+iMvS+lYUZml8rKKsohVHAGY+uClp9XVbdyYNJOIjSRpHVp8s8YqxJCiHUkSYZGr8rtQ==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "30.0.5", + "@jest/get-type": "30.0.1", + "jest-matcher-utils": "30.0.5", + "jest-message-util": "30.0.5", + "jest-mock": "30.0.5", + "jest-util": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect/node_modules/jest-diff": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.0.5.tgz", + "integrity": "sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A==", + "dev": true, + "dependencies": { + "@jest/diff-sequences": "30.0.1", + "@jest/get-type": "30.0.1", + "chalk": "^4.1.2", + "pretty-format": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect/node_modules/jest-matcher-utils": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.0.5.tgz", + "integrity": "sha512-uQgGWt7GOrRLP1P7IwNWwK1WAQbq+m//ZY0yXygyfWp0rJlksMSLQAA4wYQC3b6wl3zfnchyTx+k3HZ5aPtCbQ==", + "dev": true, + "dependencies": { + "@jest/get-type": "30.0.1", + "chalk": "^4.1.2", + "jest-diff": "30.0.5", + "pretty-format": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/expect/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/fake-timers": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.0.5.tgz", "integrity": "sha512-ZO5DHfNV+kgEAeP3gK3XlpJLL4U3Sz6ebl/n68Uwt64qFFs5bv4bfEEjyRGK5uM0C90ewooNgFuKMdkbEoMEXw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@sinonjs/fake-timers": "^13.0.0", @@ -730,10 +834,30 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/@jest/fake-timers/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/get-type": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", - "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", + "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", "dev": true, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -744,7 +868,6 @@ "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.0.5.tgz", "integrity": "sha512-7oEJT19WW4oe6HR7oLRvHxwlJk2gev0U9px3ufs8sX9PoD1Eza68KF0/tlN7X0dq/WVsBScXQGgCldA1V9Y/jA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "30.0.5", "@jest/expect": "30.0.5", @@ -773,7 +896,6 @@ "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.0.5.tgz", "integrity": "sha512-mafft7VBX4jzED1FwGC1o/9QUM2xebzavImZMeqnsklgcyxBto8mV4HzNSzUrryJ+8R9MFOM3HgYuDradWR+4g==", "dev": true, - "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "30.0.5", @@ -811,12 +933,31 @@ } } }, + "node_modules/@jest/reporters/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/schemas": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", "integrity": "sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==", "dev": true, - "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.34.0" }, @@ -829,7 +970,6 @@ "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.0.5.tgz", "integrity": "sha512-XcCQ5qWHLvi29UUrowgDFvV4t7ETxX91CbDczMnoqXPOIcZOxyNdSjm6kV5XMc8+HkxfRegU/MUmnTbJRzGrUQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "chalk": "^4.1.2", @@ -845,7 +985,6 @@ "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.0.1.tgz", "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==", "dev": true, - "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "callsites": "^3.1.0", @@ -860,7 +999,6 @@ "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.0.5.tgz", "integrity": "sha512-wPyztnK0gbDMQAJZ43tdMro+qblDHH1Ru/ylzUo21TBKqt88ZqnKKK2m30LKmLLoKtR2lxdpCC/P3g1vfKcawQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "30.0.5", "@jest/types": "30.0.5", @@ -876,7 +1014,6 @@ "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.0.5.tgz", "integrity": "sha512-Aea/G1egWoIIozmDD7PBXUOxkekXl7ueGzrsGGi1SbeKgQqCYCIf+wfbflEbf2LiPxL8j2JZGLyrzZagjvW4YQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/test-result": "30.0.5", "graceful-fs": "^4.2.11", @@ -892,7 +1029,6 @@ "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.0.5.tgz", "integrity": "sha512-Vk8amLQCmuZyy6GbBht1Jfo9RSdBtg7Lks+B0PecnjI8J+PCLQPGh7uI8Q/2wwpW2gLdiAfiHNsmekKlywULqg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@jest/types": "30.0.5", @@ -919,7 +1055,6 @@ "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.0.5.tgz", "integrity": "sha512-aREYa3aku9SSnea4aX6bhKn4bgv3AXkgijoQgbYV3yvbiGt6z+MQ85+6mIhx9DsKW2BuB/cLR/A+tcMThx+KLQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/pattern": "30.0.1", "@jest/schemas": "30.0.5", @@ -934,17 +1069,13 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { @@ -956,19 +1087,10 @@ "node": ">=6.0.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", @@ -976,15 +1098,15 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "version": "0.3.30", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz", + "integrity": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -996,7 +1118,6 @@ "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz", "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "@emnapi/core": "^1.4.3", @@ -1009,7 +1130,6 @@ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, - "license": "MIT", "optional": true, "engines": { "node": ">=14" @@ -1020,7 +1140,6 @@ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "dev": true, - "license": "MIT", "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -1033,7 +1152,6 @@ "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.1.tgz", "integrity": "sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/resolve": "1.20.2", @@ -1058,7 +1176,6 @@ "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-6.0.2.tgz", "integrity": "sha512-7QaYCf8bqF04dOy7w/eHmJeNExxTYwvKAmlSAH/EaWWUzbT0h5sbF6bktFoX/0F/0qwng5/dWFMyf3gzaM8DsQ==", "dev": true, - "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", "magic-string": "^0.30.3" @@ -1124,14 +1241,14 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", - "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.2.0.tgz", + "integrity": "sha512-qWJ2ZTbmumwiLFomfzTyt5Kng4hwPi9rwCYN4SHb6eaRU1KNO4ccxINHr/VhH4GgPlt1XfSTLX2LBTme8ne4Zw==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "picomatch": "^4.0.2" }, "engines": { "node": ">=14.0.0" @@ -1153,7 +1270,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1167,7 +1283,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1181,7 +1296,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1195,7 +1309,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1209,7 +1322,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1223,7 +1335,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1237,7 +1348,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1251,7 +1361,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1265,7 +1374,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1279,7 +1387,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1293,7 +1400,6 @@ "loong64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1307,7 +1413,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1321,7 +1426,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1335,7 +1439,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1349,7 +1452,6 @@ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1363,7 +1465,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1377,7 +1478,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1391,7 +1491,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1405,7 +1504,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1419,25 +1517,22 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@sinclair/typebox": { - "version": "0.34.38", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.38.tgz", - "integrity": "sha512-HpkxMmc2XmZKhvaKIZZThlHmx1L0I/V1hWK1NubtlFnr6ZqdiOpV72TKudZUNQjZNsyDBay72qFEhEvb+bcwcA==", - "dev": true, - "license": "MIT" + "version": "0.34.40", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.40.tgz", + "integrity": "sha512-gwBNIP8ZAYev/ORDWW0QvxdwPXwxBtLsdsJgSc7eDIRt8ubP+rxUBzPsrwnu16fgEF8Bx4lh/+mvQvJzcTM6Kw==", + "dev": true }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "type-detect": "4.0.8" } @@ -1447,7 +1542,6 @@ "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^3.0.1" } @@ -1457,7 +1551,6 @@ "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.0.tgz", "integrity": "sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==", "dev": true, - "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -1496,12 +1589,12 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.7.tgz", - "integrity": "sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", "dev": true, "dependencies": { - "@babel/types": "^7.20.7" + "@babel/types": "^7.28.2" } }, "node_modules/@types/common-tags": { @@ -1551,12 +1644,12 @@ } }, "node_modules/@types/node": { - "version": "20.14.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", - "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.0.tgz", + "integrity": "sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==", "dev": true, "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~7.10.0" } }, "node_modules/@types/resolve": { @@ -1576,7 +1669,6 @@ "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, - "license": "MIT", "dependencies": { "@types/yargs-parser": "*" } @@ -1601,7 +1693,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1615,7 +1706,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -1629,7 +1719,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1643,7 +1732,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -1657,7 +1745,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1671,7 +1758,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1685,7 +1771,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1699,7 +1784,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1713,7 +1797,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1727,7 +1810,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1741,7 +1823,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1755,7 +1836,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1769,7 +1849,6 @@ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1783,7 +1862,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1797,7 +1875,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -1811,7 +1888,6 @@ "wasm32" ], "dev": true, - "license": "MIT", "optional": true, "dependencies": { "@napi-rs/wasm-runtime": "^0.2.11" @@ -1828,7 +1904,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1842,7 +1917,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -1856,16 +1930,15 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1890,11 +1963,10 @@ } }, "node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.0.tgz", + "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -1930,6 +2002,18 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1940,9 +2024,9 @@ } }, "node_modules/async": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", - "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "dev": true }, "node_modules/babel-jest": { @@ -1950,7 +2034,6 @@ "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.0.5.tgz", "integrity": "sha512-mRijnKimhGDMsizTvBTWotwNpzrkHr+VvZUQBof2AufXKB8NXrL1W69TG20EvOz7aevx6FTJIaBuBkYxS8zolg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/transform": "30.0.5", "@types/babel__core": "^7.20.5", @@ -1998,11 +2081,10 @@ } }, "node_modules/babel-preset-current-node-syntax": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", - "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", @@ -2021,7 +2103,7 @@ "@babel/plugin-syntax-top-level-await": "^7.14.5" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.0.0 || ^8.0.0-0" } }, "node_modules/babel-preset-jest": { @@ -2047,13 +2129,12 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -2069,9 +2150,9 @@ } }, "node_modules/browserslist": { - "version": "4.25.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", - "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", + "version": "4.25.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.3.tgz", + "integrity": "sha512-cDGv1kkDI4/0e5yON9yM5G/0A5u8sf5TnmdX5C9qHzI9PPu++sQ9zjm1k9NiOrf3riY4OkK0zSGqfvJyJsgCBQ==", "dev": true, "funding": [ { @@ -2087,10 +2168,9 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001718", - "electron-to-chromium": "^1.5.160", + "caniuse-lite": "^1.0.30001735", + "electron-to-chromium": "^1.5.204", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -2133,7 +2213,6 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -2148,9 +2227,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001723", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001723.tgz", - "integrity": "sha512-1R/elMjtehrFejxwmexeXAtae5UO9iSyFn6G/I806CYC/BLyyBk1EPhrKBkWhy6wM6Xnm47dSJQec+tLJ39WHw==", + "version": "1.0.30001737", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001737.tgz", + "integrity": "sha512-BiloLiXtQNrY5UyF0+1nSJLXUENuhka2pzy2Fx5pGxqavdrxSCW4U6Pn/PoG3Efspi2frRbHpBV2XsrPE6EDlw==", "dev": true, "funding": [ { @@ -2165,8 +2244,7 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" + ] }, "node_modules/chalk": { "version": "4.1.2", @@ -2189,15 +2267,14 @@ "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/ci-info": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.2.0.tgz", - "integrity": "sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.0.tgz", + "integrity": "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==", "dev": true, "funding": [ { @@ -2213,8 +2290,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.1.0.tgz", "integrity": "sha512-UX0OwmYRYQQetfrLEZeewIFFI+wSTofC+pMBLNuH3RUuu/xzG1oz84UCEDOSoQlN3fZ4+AzmV50ZYvGqkMh9yA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/cliui": { "version": "8.0.1", @@ -2293,7 +2369,6 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, - "license": "MIT", "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -2303,8 +2378,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/color-convert": { "version": "2.0.1", @@ -2356,7 +2430,6 @@ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2367,12 +2440,12 @@ } }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -2388,7 +2461,6 @@ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.6.0.tgz", "integrity": "sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==", "dev": true, - "license": "MIT", "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -2412,7 +2484,6 @@ "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -2421,8 +2492,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/ejs": { "version": "3.1.10", @@ -2440,18 +2510,16 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.167", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.167.tgz", - "integrity": "sha512-LxcRvnYO5ez2bMOFpbuuVuAI5QNeY1ncVytE/KXaL6ZNfzX1yPlAO0nSOyIHx2fVAuUprMqPs/TdVhUFZy7SIQ==", - "dev": true, - "license": "ISC" + "version": "1.5.209", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.209.tgz", + "integrity": "sha512-Xoz0uMrim9ZETCQt8UgM5FxQF9+imA7PBpokoGcZloA1uw2LeHzTlip5cb5KOAsXZLjh/moN2vReN3ZjJmjI9A==", + "dev": true }, "node_modules/emittery": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -2463,15 +2531,13 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } @@ -2481,7 +2547,6 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -2519,7 +2584,6 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, - "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -2542,8 +2606,7 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/exit-x": { "version": "0.2.2", @@ -2555,16 +2618,15 @@ } }, "node_modules/expect": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/expect/-/expect-30.0.5.tgz", - "integrity": "sha512-P0te2pt+hHI5qLJkIR+iMvS+lYUZml8rKKsohVHAGY+uClp9XVbdyYNJOIjSRpHVp8s8YqxJCiHUkSYZGr8rtQ==", + "version": "30.1.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.1.1.tgz", + "integrity": "sha512-OKe7cdic4qbfWd/CcgwJvvCrNX2KWfuMZee9AfJHL1gTYmvqjBjZG1a2NwfhspBzxzlXwsN75WWpKTYfsJpBxg==", "dev": true, - "license": "MIT", "dependencies": { - "@jest/expect-utils": "30.0.5", - "@jest/get-type": "30.0.1", - "jest-matcher-utils": "30.0.5", - "jest-message-util": "30.0.5", + "@jest/expect-utils": "30.1.1", + "@jest/get-type": "30.1.0", + "jest-matcher-utils": "30.1.1", + "jest-message-util": "30.1.0", "jest-mock": "30.0.5", "jest-util": "30.0.5" }, @@ -2596,15 +2658,6 @@ "minimatch": "^5.0.1" } }, - "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/filelist/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", @@ -2647,7 +2700,6 @@ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, - "license": "ISC", "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" @@ -2720,7 +2772,6 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -2733,7 +2784,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, - "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", @@ -2749,42 +2799,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2795,7 +2809,6 @@ "version": "17.0.0-alpha.9", "resolved": "https://registry.npmjs.org/graphql/-/graphql-17.0.0-alpha.9.tgz", "integrity": "sha512-jVK1BsvX5pUIEpRDlEgeKJr80GAxl3B8ISsFDjXHtl2xAxMXVGTEFF4Q4R8NH0Gw7yMwcHDndkNjoNT5CbwHKA==", - "license": "MIT", "engines": { "node": "^16.19.0 || ^18.14.0 || >=19.7.0" } @@ -2825,15 +2838,13 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": ">=10.17.0" } @@ -2887,13 +2898,12 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/is-core-module": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", - "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "dev": true, "dependencies": { "hasown": "^2.0.2" @@ -2919,7 +2929,6 @@ "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -2944,7 +2953,6 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -2956,8 +2964,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", @@ -3001,7 +3008,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -3016,7 +3022,6 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", @@ -3027,11 +3032,10 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -3045,7 +3049,6 @@ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, - "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -3057,15 +3060,14 @@ } }, "node_modules/jake": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz", - "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==", + "version": "10.9.4", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", + "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", "dev": true, "dependencies": { - "async": "^3.2.3", - "chalk": "^4.0.2", + "async": "^3.2.6", "filelist": "^1.0.4", - "minimatch": "^3.1.2" + "picocolors": "^1.1.1" }, "bin": { "jake": "bin/cli.js" @@ -3079,7 +3081,6 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-30.0.5.tgz", "integrity": "sha512-y2mfcJywuTUkvLm2Lp1/pFX8kTgMO5yyQGq/Sk/n2mN7XWYp4JsCZ/QXW34M8YScgk8bPZlREH04f6blPnoHnQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/core": "30.0.5", "@jest/types": "30.0.5", @@ -3106,7 +3107,6 @@ "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.0.5.tgz", "integrity": "sha512-bGl2Ntdx0eAwXuGpdLdVYVr5YQHnSZlQ0y9HVDu565lCUAe9sj6JOtBbMmBBikGIegne9piDDIOeiLVoqTkz4A==", "dev": true, - "license": "MIT", "dependencies": { "execa": "^5.1.1", "jest-util": "30.0.5", @@ -3121,7 +3121,6 @@ "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.0.5.tgz", "integrity": "sha512-h/sjXEs4GS+NFFfqBDYT7y5Msfxh04EwWLhQi0F8kuWpe+J/7tICSlswU8qvBqumR3kFgHbfu7vU6qruWWBPug==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "30.0.5", "@jest/expect": "30.0.5", @@ -3148,12 +3147,70 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/jest-circus/node_modules/@jest/get-type": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", + "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", + "dev": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-circus/node_modules/jest-diff": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.0.5.tgz", + "integrity": "sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A==", + "dev": true, + "dependencies": { + "@jest/diff-sequences": "30.0.1", + "@jest/get-type": "30.0.1", + "chalk": "^4.1.2", + "pretty-format": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-circus/node_modules/jest-matcher-utils": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.0.5.tgz", + "integrity": "sha512-uQgGWt7GOrRLP1P7IwNWwK1WAQbq+m//ZY0yXygyfWp0rJlksMSLQAA4wYQC3b6wl3zfnchyTx+k3HZ5aPtCbQ==", + "dev": true, + "dependencies": { + "@jest/get-type": "30.0.1", + "chalk": "^4.1.2", + "jest-diff": "30.0.5", + "pretty-format": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-circus/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-cli": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.0.5.tgz", "integrity": "sha512-Sa45PGMkBZzF94HMrlX4kUyPOwUpdZasaliKN3mifvDmkhLYqLLg8HQTzn6gq7vJGahFYMQjXgyJWfYImKZzOw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/core": "30.0.5", "@jest/test-result": "30.0.5", @@ -3186,7 +3243,6 @@ "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.0.5.tgz", "integrity": "sha512-aIVh+JNOOpzUgzUnPn5FLtyVnqc3TQHVMupYtyeURSb//iLColiMIR8TxCIDKyx9ZgjKnXGucuW68hCxgbrwmA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@jest/get-type": "30.0.1", @@ -3233,15 +3289,23 @@ } } }, + "node_modules/jest-config/node_modules/@jest/get-type": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", + "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", + "dev": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-diff": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.0.5.tgz", - "integrity": "sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A==", + "version": "30.1.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.1.1.tgz", + "integrity": "sha512-LUU2Gx8EhYxpdzTR6BmjL1ifgOAQJQELTHOiPv9KITaKjZvJ9Jmgigx01tuZ49id37LorpGc9dPBPlXTboXScw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/diff-sequences": "30.0.1", - "@jest/get-type": "30.0.1", + "@jest/get-type": "30.1.0", "chalk": "^4.1.2", "pretty-format": "30.0.5" }, @@ -3254,7 +3318,6 @@ "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.0.1.tgz", "integrity": "sha512-/vF78qn3DYphAaIc3jy4gA7XSAz167n9Bm/wn/1XhTLW7tTBIzXtCJpb/vcmc73NIIeeohCbdL94JasyXUZsGA==", "dev": true, - "license": "MIT", "dependencies": { "detect-newline": "^3.1.0" }, @@ -3267,7 +3330,6 @@ "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.0.5.tgz", "integrity": "sha512-dKjRsx1uZ96TVyejD3/aAWcNKy6ajMaN531CwWIsrazIqIoXI9TnnpPlkrEYku/8rkS3dh2rbH+kMOyiEIv0xQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.0.1", "@jest/types": "30.0.5", @@ -3279,12 +3341,20 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/jest-each/node_modules/@jest/get-type": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", + "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", + "dev": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-environment-node": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.0.5.tgz", "integrity": "sha512-ppYizXdLMSvciGsRsMEnv/5EFpvOdXBaXRBzFUDPWrsfmog4kYrOGWXarLllz6AXan6ZAA/kYokgDWuos1IKDA==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "30.0.5", "@jest/fake-timers": "30.0.5", @@ -3303,7 +3373,6 @@ "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.0.5.tgz", "integrity": "sha512-dkmlWNlsTSR0nH3nRfW5BKbqHefLZv0/6LCccG0xFCTWcJu8TuEwG+5Cm75iBfjVoockmO6J35o5gxtFSn5xeg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@types/node": "*", @@ -3328,7 +3397,6 @@ "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.0.5.tgz", "integrity": "sha512-3Uxr5uP8jmHMcsOtYMRB/zf1gXN3yUIc+iPorhNETG54gErFIiUhLvyY/OggYpSMOEYqsmRxmuU4ZOoX5jpRFg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.0.1", "pretty-format": "30.0.5" @@ -3337,16 +3405,24 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/jest-leak-detector/node_modules/@jest/get-type": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", + "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", + "dev": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-matcher-utils": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.0.5.tgz", - "integrity": "sha512-uQgGWt7GOrRLP1P7IwNWwK1WAQbq+m//ZY0yXygyfWp0rJlksMSLQAA4wYQC3b6wl3zfnchyTx+k3HZ5aPtCbQ==", + "version": "30.1.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.1.1.tgz", + "integrity": "sha512-SuH2QVemK48BNTqReti6FtjsMPFsSOD/ZzRxU1TttR7RiRsRSe78d03bb4Cx6D4bQC/80Q8U4VnaaAH9FlbZ9w==", "dev": true, - "license": "MIT", "dependencies": { - "@jest/get-type": "30.0.1", + "@jest/get-type": "30.1.0", "chalk": "^4.1.2", - "jest-diff": "30.0.5", + "jest-diff": "30.1.1", "pretty-format": "30.0.5" }, "engines": { @@ -3354,11 +3430,10 @@ } }, "node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.1.0.tgz", + "integrity": "sha512-HizKDGG98cYkWmaLUHChq4iN+oCENohQLb7Z5guBPumYs+/etonmNFlg1Ps6yN9LTPyZn+M+b/9BbnHx3WTMDg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", "@jest/types": "30.0.5", @@ -3379,7 +3454,6 @@ "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.0.5.tgz", "integrity": "sha512-Od7TyasAAQX/6S+QCbN6vZoWOMwlTtzzGuxJku1GhGanAjz9y+QsQkpScDmETvdc9aSXyJ/Op4rhpMYBWW91wQ==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@types/node": "*", @@ -3394,7 +3468,6 @@ "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" }, @@ -3421,7 +3494,6 @@ "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.0.5.tgz", "integrity": "sha512-d+DjBQ1tIhdz91B79mywH5yYu76bZuE96sSbxj8MkjWVx5WNdt1deEFRONVL4UkKLSrAbMkdhb24XN691yDRHg==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.1.2", "graceful-fs": "^4.2.11", @@ -3441,7 +3513,6 @@ "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.0.5.tgz", "integrity": "sha512-/xMvBR4MpwkrHW4ikZIWRttBBRZgWK4d6xt3xW1iRDSKt4tXzYkMkyPfBnSCgv96cpkrctfXs6gexeqMYqdEpw==", "dev": true, - "license": "MIT", "dependencies": { "jest-regex-util": "30.0.1", "jest-snapshot": "30.0.5" @@ -3455,7 +3526,6 @@ "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.0.5.tgz", "integrity": "sha512-JcCOucZmgp+YuGgLAXHNy7ualBx4wYSgJVWrYMRBnb79j9PD0Jxh0EHvR5Cx/r0Ce+ZBC4hCdz2AzFFLl9hCiw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/console": "30.0.5", "@jest/environment": "30.0.5", @@ -3484,12 +3554,31 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/jest-runner/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-runtime": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.0.5.tgz", "integrity": "sha512-7oySNDkqpe4xpX5PPiJTe5vEa+Ak/NnNz2bGYZrA1ftG3RL3EFlHaUkA1Cjx+R8IhK0Vg43RML5mJedGTPNz3A==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "30.0.5", "@jest/fake-timers": "30.0.5", @@ -3518,12 +3607,31 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/jest-runtime/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-snapshot": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.0.5.tgz", "integrity": "sha512-T00dWU/Ek3LqTp4+DcW6PraVxjk28WY5Ua/s+3zUKSERZSNyxTqhDXCWKG5p2HAJ+crVQ3WJ2P9YVHpj1tkW+g==", "dev": true, - "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@babel/generator": "^7.27.5", @@ -3551,12 +3659,99 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/jest-snapshot/node_modules/@jest/expect-utils": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.0.5.tgz", + "integrity": "sha512-F3lmTT7CXWYywoVUGTCmom0vXq3HTTkaZyTAzIy+bXSBizB7o5qzlC9VCtq0arOa8GqmNsbg/cE9C6HLn7Szew==", + "dev": true, + "dependencies": { + "@jest/get-type": "30.0.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/@jest/get-type": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", + "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", + "dev": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/expect": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.0.5.tgz", + "integrity": "sha512-P0te2pt+hHI5qLJkIR+iMvS+lYUZml8rKKsohVHAGY+uClp9XVbdyYNJOIjSRpHVp8s8YqxJCiHUkSYZGr8rtQ==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "30.0.5", + "@jest/get-type": "30.0.1", + "jest-matcher-utils": "30.0.5", + "jest-message-util": "30.0.5", + "jest-mock": "30.0.5", + "jest-util": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/jest-diff": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.0.5.tgz", + "integrity": "sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A==", + "dev": true, + "dependencies": { + "@jest/diff-sequences": "30.0.1", + "@jest/get-type": "30.0.1", + "chalk": "^4.1.2", + "pretty-format": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/jest-matcher-utils": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.0.5.tgz", + "integrity": "sha512-uQgGWt7GOrRLP1P7IwNWwK1WAQbq+m//ZY0yXygyfWp0rJlksMSLQAA4wYQC3b6wl3zfnchyTx+k3HZ5aPtCbQ==", + "dev": true, + "dependencies": { + "@jest/get-type": "30.0.1", + "chalk": "^4.1.2", + "jest-diff": "30.0.5", + "pretty-format": "30.0.5" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/jest-message-util": { + "version": "30.0.5", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", + "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.0.5", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "micromatch": "^4.0.8", + "pretty-format": "30.0.5", + "slash": "^3.0.0", + "stack-utils": "^2.0.6" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-snapshot/node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -3569,7 +3764,6 @@ "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.0.5.tgz", "integrity": "sha512-pvyPWssDZR0FlfMxCBoc0tvM8iUEskaRFALUtGQYzVEAqisAztmy+R8LnU14KT4XA0H/a5HMVTXat1jLne010g==", "dev": true, - "license": "MIT", "dependencies": { "@jest/types": "30.0.5", "@types/node": "*", @@ -3582,24 +3776,11 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-util/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/jest-validate": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.0.5.tgz", "integrity": "sha512-ouTm6VFHaS2boyl+k4u+Qip4TSH7Uld5tyD8psQ8abGgt2uYYB8VwVfAHWHjHc0NWmGGbwO5h0sCPOGHHevefw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/get-type": "30.0.1", "@jest/types": "30.0.5", @@ -3612,12 +3793,20 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/jest-validate/node_modules/@jest/get-type": { + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", + "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", + "dev": true, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/jest-validate/node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -3630,7 +3819,6 @@ "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.0.5.tgz", "integrity": "sha512-z9slj/0vOwBDBjN3L4z4ZYaA+pG56d6p3kTUhFRYGvXbXMWhXmb/FIxREZCD06DYUwDKKnj2T80+Pb71CQ0KEg==", "dev": true, - "license": "MIT", "dependencies": { "@jest/test-result": "30.0.5", "@jest/types": "30.0.5", @@ -3650,7 +3838,6 @@ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.0.5.tgz", "integrity": "sha512-ojRXsWzEP16NdUuBw/4H/zkZdHOa7MMYCk4E430l+8fELeLg/mqmMlRhjL7UNZvQrDmnovWZV4DxX03fZF48fQ==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*", "@ungap/structured-clone": "^1.3.0", @@ -3667,7 +3854,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -3682,8 +3868,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/js-yaml": { "version": "3.14.1", @@ -3703,7 +3888,6 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, - "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, @@ -3715,8 +3899,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/json5": { "version": "2.2.3", @@ -3735,7 +3918,6 @@ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -3744,8 +3926,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/locate-path": { "version": "5.0.0", @@ -3770,18 +3951,17 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "version": "0.30.18", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.18.tgz", + "integrity": "sha512-yi8swmWbO17qHhwIBNeeZxTceJMeBvWJaId6dyvTSOwTipqeHhMhOrz6513r1sOKnpvQ7zkhlG8tPrpilwTxHQ==", "dev": true, "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@jridgewell/sourcemap-codec": "^1.5.5" } }, "node_modules/make-dir": { @@ -3789,7 +3969,6 @@ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, - "license": "MIT", "dependencies": { "semver": "^7.5.3" }, @@ -3805,7 +3984,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -3839,7 +4017,6 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, - "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -3848,26 +4025,40 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minipass": { @@ -3875,23 +4066,21 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, - "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/napi-postinstall": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.2.tgz", - "integrity": "sha512-tWVJxJHmBWLy69PvO96TZMZDrzmw5KeiZBz3RHmiM2XZ9grBJ2WgMAFVVg25nqp3ZjTFUs2Ftw1JhscL3Teliw==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.3.tgz", + "integrity": "sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow==", "dev": true, - "license": "MIT", "bin": { "napi-postinstall": "lib/cli.js" }, @@ -3906,8 +4095,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/node-int64": { "version": "0.4.0", @@ -3919,8 +4107,7 @@ "version": "2.0.19", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/normalize-path": { "version": "3.0.0", @@ -3936,7 +4123,6 @@ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -3958,7 +4144,6 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -3974,7 +4159,6 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, - "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -4025,15 +4209,13 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" + "dev": true }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, - "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -4070,7 +4252,6 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4086,7 +4267,6 @@ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, - "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -4102,23 +4282,21 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -4129,7 +4307,6 @@ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 6" } @@ -4151,7 +4328,6 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.0.5.tgz", "integrity": "sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/schemas": "30.0.5", "ansi-styles": "^5.2.0", @@ -4166,7 +4342,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -4188,8 +4363,7 @@ "type": "opencollective", "url": "https://opencollective.com/fast-check" } - ], - "license": "MIT" + ] }, "node_modules/randombytes": { "version": "2.1.0", @@ -4216,18 +4390,21 @@ } }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "dev": true, "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4258,7 +4435,6 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.46.2.tgz", "integrity": "sha512-WMmLFI+Boh6xbop+OAGo9cQ3OgX9MIg7xOQjn+pTCwOkk+FNDAeAemXkJ3HzDJrVXleLOFVa1ipuc1AmEx1Dwg==", "dev": true, - "license": "MIT", "dependencies": { "@types/estree": "1.0.8" }, @@ -4336,7 +4512,6 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -4349,7 +4524,6 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4359,7 +4533,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "ISC", "engines": { "node": ">=14" }, @@ -4396,7 +4569,6 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, - "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -4425,7 +4597,6 @@ "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, - "license": "MIT", "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -4439,7 +4610,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4449,7 +4619,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4462,7 +4631,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, - "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -4481,7 +4649,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4496,7 +4663,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4505,15 +4671,13 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/string-width-cjs/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4526,7 +4690,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -4543,7 +4706,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4556,7 +4718,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4566,7 +4727,6 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4576,7 +4736,6 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -4586,7 +4745,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" }, @@ -4623,7 +4781,6 @@ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", "dev": true, - "license": "MIT", "dependencies": { "@pkgr/core": "^0.2.9" }, @@ -4635,13 +4792,13 @@ } }, "node_modules/terser": { - "version": "5.31.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz", - "integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==", + "version": "5.43.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.43.1.tgz", + "integrity": "sha512-+6erLbBm0+LROX2sPXlUYx/ux5PyE9K/a92Wrt6oA+WDAoFTdpHE5tCYCI5PNzq2y8df4rA+QgHLJuR4jNymsg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", + "acorn": "^8.14.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -4676,6 +4833,16 @@ "node": ">=8" } }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4697,6 +4864,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -4772,7 +4951,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "dev": true, - "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -4785,7 +4963,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" }, @@ -4794,16 +4971,15 @@ } }, "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, - "license": "MIT", "engines": { "node": ">=4" } @@ -4825,7 +5001,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -4835,9 +5010,9 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", + "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", "dev": true }, "node_modules/unrs-resolver": { @@ -4846,7 +5021,6 @@ "integrity": "sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg==", "dev": true, "hasInstallScript": true, - "license": "MIT", "dependencies": { "napi-postinstall": "^0.3.0" }, @@ -4894,7 +5068,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" @@ -4911,7 +5084,6 @@ "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, - "license": "ISC", "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -4935,7 +5107,6 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -4951,7 +5122,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -4970,7 +5140,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -4988,7 +5157,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -4997,15 +5165,13 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -5020,7 +5186,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5033,7 +5198,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" }, @@ -5073,8 +5237,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "license": "ISC" + "dev": true }, "node_modules/yargs": { "version": "17.7.2", @@ -5149,7 +5312,6 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts index 177e7e95e..47fc290b1 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/src/utilities/fieldPolicyDirective.ts @@ -191,37 +191,37 @@ function validateKeyArgPath( ); } - let curType: GraphQLInputType = base(arg.type); + let currentType: GraphQLInputType = getBaseInputType(arg.type); for (let i = 0; i < path.length; i++) { const segment = path[i]; - if (!isInputObjectType(curType)) { + if (!isInputObjectType(currentType)) { throw new GraphQLError( - `@fieldPolicy key "${keyArg}" traverses "${segment}" on non-object input type "${String(curType)}".`, + `@fieldPolicy key "${keyArg}" traverses "${segment}" on non-object input type "${String(currentType)}".`, { nodes: field.astNode } ); } - const fieldMap = curType.getFields(); + const fieldMap = currentType.getFields(); const nextField = fieldMap[segment]; if (!nextField) { const suggestions = Object.keys(fieldMap).join(", "); throw new GraphQLError( - `@fieldPolicy key "${keyArg}" refers to unknown input field "${segment}" on "${curType.name}". Known fields: ${suggestions}`, + `@fieldPolicy key "${keyArg}" refers to unknown input field "${segment}" on "${currentType.name}". Known fields: ${suggestions}`, { nodes: field.astNode } ); } - curType = base(nextField.type); + currentType = getBaseInputType(nextField.type); } - if (!parts.length || isInputObjectType(curType)) { + if (!parts.length || isInputObjectType(currentType)) { throw new GraphQLError( - `@fieldPolicy key "${keyArg}" must resolve to a leaf input type (scalar/enum), got "${String(curType)}".`, + `@fieldPolicy key "${keyArg}" must resolve to a leaf input type (scalar/enum), got "${String(currentType)}".`, { nodes: field.astNode } ); } } -function base(type: GraphQLInputType): GraphQLInputType { +function getBaseInputType(type: GraphQLInputType): GraphQLInputType { return getNamedType(type) as GraphQLInputType; } diff --git a/apollo-ios-codegen/Sources/IR/IR+Fields.swift b/apollo-ios-codegen/Sources/IR/IR+Fields.swift index 6c45878f8..8f54b3aa9 100644 --- a/apollo-ios-codegen/Sources/IR/IR+Fields.swift +++ b/apollo-ios-codegen/Sources/IR/IR+Fields.swift @@ -12,6 +12,8 @@ public class Field: Equatable, CustomDebugStringConvertible { public var responseKey: String { underlyingField.responseKey } public var type: GraphQLType { underlyingField.type } public var arguments: [CompilationResult.Argument]? { underlyingField.arguments } + + /// The `keyArgs` from the `@fieldPolicy` directive applied to this field in the schema public var fieldPolicyKeys: [String]? { underlyingField.fieldPolicyKeys } fileprivate init( diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 6745f5ec6..83f0431f6 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -73,39 +73,16 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, on object: Record ) throws -> AnyHashable? { - - let fieldTypename = typename(for: info.field) - - // Programmatic field policy checks - switch info.field.type { - case .nonNull(let innerType): - if case .list(_) = innerType.namedType { - if let cacheKeys = info.parentInfo.schema.configuration.cacheKeys(for: info.field, variables: info.parentInfo.variables, path: info.responsePath) { - return cacheKeys.map { "\($0.uniqueKeyGroup ?? fieldTypename):\($0.id)" }.map { object[$0] } - } - } - else { - if let cacheKey = info.parentInfo.schema.configuration.cacheKey(for: info.field, variables: info.parentInfo.variables, path: info.responsePath) { - return object["\(cacheKey.uniqueKeyGroup ?? fieldTypename):\(cacheKey.id)"] - } - } - case .list(_): - if let cacheKeys = info.parentInfo.schema.configuration.cacheKeys(for: info.field, variables: info.parentInfo.variables, path: info.responsePath) { - return cacheKeys.map { "\($0.uniqueKeyGroup ?? fieldTypename):\($0.id)" }.map { object[$0] } - } - default: - if let cacheKey = info.parentInfo.schema.configuration.cacheKey(for: info.field, variables: info.parentInfo.variables, path: info.responsePath) { - return object["\(cacheKey.uniqueKeyGroup ?? fieldTypename):\(cacheKey.id)"] - } - } - - // Directive based field policy checks - if let fieldPolicyResult = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables).resolveFieldPolicy() { + let fieldPolicyEvaluator = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables) + if let fieldPolicyResult = resolveProgrammaticFieldPolicy(with: info, and: info.field.type) ?? + fieldPolicyEvaluator.resolveFieldPolicy(), + let returnTypename = typename(for: info.field) { + switch fieldPolicyResult { case .single(let key): - return object["\(key.uniqueKeyGroup ?? fieldTypename):\(key.id)"] + return object[formatCacheKey(withInfo: key, andTypename: returnTypename)] case .list(let keys): - return keys.map { object["\($0.uniqueKeyGroup ?? fieldTypename):\($0.id)"] } + return keys.map { object[formatCacheKey(withInfo: $0, andTypename: returnTypename)] } } } @@ -113,14 +90,51 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { return object[key] } - private func typename(for field: Selection.Field) -> String { + private func resolveProgrammaticFieldPolicy( + with info: FieldExecutionInfo, + and type: Selection.Field.OutputType + ) -> FieldPolicyResult? { + guard let provider = info.parentInfo.schema.self as? (any FieldPolicyProvider.Type) else { + return nil + } + + switch type { + case .nonNull(let innerType): + return resolveProgrammaticFieldPolicy(with: info, and: innerType) + case .list(_): + if let keys = provider.cacheKeys( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .list(keys) + } + default: + if let key = provider.cacheKey( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .single(key) + } + } + return nil + } + + private func formatCacheKey( + withInfo info: CacheKeyInfo, + andTypename typename: String + ) -> String { + return "\(info.uniqueKeyGroup ?? typename):\(info.id)" + } + + private func typename(for field: Selection.Field) -> String? { switch field.type.namedType { case .object(let selectionSetType): return selectionSetType.__parentType.__typename default: - break + return nil } - return "" } private func deferredResolve(reference: CacheReference) -> PossiblyDeferred { diff --git a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift index 984f841fa..597908b31 100644 --- a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift +++ b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift @@ -24,69 +24,92 @@ struct FieldPolicyEvaluator { return nil } - struct ParsedKey { let name: String; let path: [String]? } + let keyArgs = parseKeyArgs(for: fieldPolicy) - let parsed: [ParsedKey] = fieldPolicy.keys.map { key in - if let dot = key.firstIndex(of: ".") { - let name = String(key[.. 1 { - listIndex = i - listValues = resolved + listArgIndex = index + listArgValues = resolved } else { guard let value = resolved.first else { return nil } - fixedParts[i] = value + singleValueArgs[index] = value } } - if let idx = listIndex { - var keys: [CacheKeyInfo] = [] - keys.reserveCapacity(listValues.count) - for item in listValues { - var parts = [String]() - parts.reserveCapacity(parsed.count) - for j in 0.. [CacheKeyInfo]? { + var keys: [CacheKeyInfo] = [] + keys.reserveCapacity(listArgValues.count) + for value in listArgValues { + var parts = [String]() + parts.reserveCapacity(keyArgs.count) + for keyIndex in 0.. [ParsedKey] { + fieldPolicy.keyArgs.map { key in + if let dot = key.firstIndex(of: ".") { + let name = String(key[.. + fileprivate func traverse( + to path: ArraySlice ) -> JSONValue? { guard let head = path.first else { return self } guard let next = self[head] else { return nil } if path.count == 1 { return next } if let nested = next as? JSONObject { - return nested.walk(path: path.dropFirst()) + return nested.traverse(to: path.dropFirst()) } return nil } @@ -168,22 +203,22 @@ extension InputValue { return values case .object(let dict): guard let keyPath, !keyPath.isEmpty else { return nil } - guard let targetValue = self.walk(dict: dict, path: keyPath[...]) else { return nil } + guard let targetValue = self.traverse(through: dict, to: keyPath[...]) else { return nil } return targetValue.resolveValue() default: return nil } } - fileprivate func walk( - dict: [String: InputValue], - path: ArraySlice + fileprivate func traverse( + through dict: [String: InputValue], + to path: ArraySlice ) -> InputValue? { guard let head = path.first else { return .object(dict) } guard let next = dict[head] else { return nil } if path.count == 1 { return next } if case .object(let nested) = next { - return walk(dict: nested, path: path.dropFirst()) + return traverse(through: nested, to: path.dropFirst()) } return nil } diff --git a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift new file mode 100644 index 000000000..ead011522 --- /dev/null +++ b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift @@ -0,0 +1,11 @@ +public protocol FieldPolicyProvider { + /// The entry point for resolving cache keys to read objects from the `NormalizedCache` when executing an operation, + /// prior to attempting to fetch data from the network. + /// + /// The default generated implementation always returns `nil`, disabling all cache normalization. + /// + /// This function returns an array containing 1 or more cache key strings depending on the return type of the given field. + static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? + + static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? +} diff --git a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift index b2f9fdd92..a448dea10 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift @@ -39,14 +39,4 @@ public protocol SchemaConfiguration { /// Represented as a ``ObjectData`` dictionary. /// - Returns: A ``CacheKeyInfo`` describing the computed cache key for the response object. static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? - - /// The entry point for resolving cache keys to read objects from the `NormalizedCache` when executing an operation, - /// prior to attempting to fetch data from the network. - /// - /// The default generated implementation always returns `nil`, disabling all cache normalization. - /// - /// This function returns an array containing 1 or more cache key strings depending on the return type of the given field. - static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? - - static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? } diff --git a/apollo-ios/Sources/ApolloAPI/Selection.swift b/apollo-ios/Sources/ApolloAPI/Selection.swift index fdebf6f1f..dc60e23ff 100644 --- a/apollo-ios/Sources/ApolloAPI/Selection.swift +++ b/apollo-ios/Sources/ApolloAPI/Selection.swift @@ -59,12 +59,12 @@ public enum Selection { } public struct FieldPolicy: Hashable { - public let keys: [String] + public let keyArgs: [String] public init( - keys: [String] + keyArgs: [String] ) { - self.keys = keys + self.keyArgs = keyArgs } } From 2292dfcdd232c961b43652200c0db071d2ba046e Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Wed, 27 Aug 2025 14:06:40 -0400 Subject: [PATCH 09/35] Fixing a couple tests --- .../ApolloTests/Cache/FieldPolicyTests.swift | 114 +++++++++--------- .../SchemaConfigurationTemplate.swift | 10 -- 2 files changed, 57 insertions(+), 67 deletions(-) diff --git a/Tests/ApolloTests/Cache/FieldPolicyTests.swift b/Tests/ApolloTests/Cache/FieldPolicyTests.swift index d9910aa01..e3c46a858 100644 --- a/Tests/ApolloTests/Cache/FieldPolicyTests.swift +++ b/Tests/ApolloTests/Cache/FieldPolicyTests.swift @@ -1137,62 +1137,62 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { // MARK: - FieldPolicyProvider Tests - func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["name": .variable("name")]) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - MockSchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in - return CacheKeyInfo(id: "Hero:Luke") - } - - let query = MockQuery() - query.__variables = ["name": "Luke"] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], - "Hero:Luke": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } +// func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["name": .variable("name")]) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// MockSchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in +// return CacheKeyInfo(id: "Hero:Luke") +// } +// +// let query = MockQuery() +// query.__variables = ["name": "Luke"] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], +// "Hero:Luke": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift index b9a3b6e44..2f48571c7 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift @@ -31,16 +31,6 @@ struct SchemaConfigurationTemplate: TemplateRenderer { } } - static func cacheKey(for field: \(config.ApolloAPITargetName).Selection.Field, variables: \(config.ApolloAPITargetName).GraphQLOperation.Variables?, path: \(config.ApolloAPITargetName).ResponsePath) -> \(config.ApolloAPITargetName).CacheKeyInfo? { - // Implement this function to configure cache key resolution for fields that return a single object/value - return nil - } - - static func cacheKeys(for field: \(config.ApolloAPITargetName).Selection.Field, variables: \(config.ApolloAPITargetName).GraphQLOperation.Variables?, path: \(config.ApolloAPITargetName).ResponsePath) -> [\(config.ApolloAPITargetName).CacheKeyInfo]? { - // Implement this function to configure cache key resolution for fields that return a list of objects/values - return nil - } - """ } } From fa8f597a4e88cea2752e17f91c4d73e28ead9382 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Thu, 28 Aug 2025 12:19:28 -0400 Subject: [PATCH 10/35] Add FieldPolicyProvider tests --- .../ApolloTests/Cache/FieldPolicyTests.swift | 206 +++++++++++++----- .../CacheDataExecutionSource.swift | 2 +- 2 files changed, 150 insertions(+), 58 deletions(-) diff --git a/Tests/ApolloTests/Cache/FieldPolicyTests.swift b/Tests/ApolloTests/Cache/FieldPolicyTests.swift index e3c46a858..f51126bd5 100644 --- a/Tests/ApolloTests/Cache/FieldPolicyTests.swift +++ b/Tests/ApolloTests/Cache/FieldPolicyTests.swift @@ -1137,62 +1137,154 @@ final class FieldPolicyTests: XCTestCase, CacheDependentTesting { // MARK: - FieldPolicyProvider Tests -// func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["name": .variable("name")]) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// MockSchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in -// return CacheKeyInfo(id: "Hero:Luke") -// } -// -// let query = MockQuery() -// query.__variables = ["name": "Luke"] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], -// "Hero:Luke": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } + func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name")]) + ]} + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + MockSchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in + return CacheKeyInfo(id: "Luke") + } + + let query = MockQuery() + query.__variables = ["name": "Luke"] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_schemaConfiguration_givenFieldPolicyProvider_returnsListOfCacheKeyInfo() throws { + class HeroSelectionSet: MockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names")]) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: MockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + MockSchemaMetadata.stub_cacheKeyForField_ListReturn { _, _, _ in + return [ + CacheKeyInfo(id: "Anakin"), + CacheKeyInfo(id: "Obi-Wan"), + CacheKeyInfo(id: "Ahsoka") + ] + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } } diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 83f0431f6..9bc294651 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -94,7 +94,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, and type: Selection.Field.OutputType ) -> FieldPolicyResult? { - guard let provider = info.parentInfo.schema.self as? (any FieldPolicyProvider.Type) else { + guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { return nil } From 12cf83dff10732c015caece0b5e1ad9d8c93bfdf Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:38:23 -0400 Subject: [PATCH 11/35] Adding a little documentation --- .../ApolloAPI/FieldPolicyProvider.swift | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift index ead011522..4aa8c86f1 100644 --- a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift +++ b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift @@ -1,11 +1,25 @@ +/// A protocol that can be added to the ``SchemaConfiguration`` in order to provide custom field policy configuration. +/// +/// This protocol should be applied to your existing ``SchemaConfiguration`` and provides a way to provide custom +/// field policy cache keys in lieu of using the @fieldPolicy directive. public protocol FieldPolicyProvider { - /// The entry point for resolving cache keys to read objects from the `NormalizedCache` when executing an operation, + /// The entry point for resolving a cache key to read an object from the `NormalizedCache` when executing an operation, /// prior to attempting to fetch data from the network. /// - /// The default generated implementation always returns `nil`, disabling all cache normalization. - /// - /// This function returns an array containing 1 or more cache key strings depending on the return type of the given field. + /// - Parameters: + /// - field: The ``Selection.Field`` of the operation being executed. + /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. + /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. + /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? + /// The entry point for resolving cache keys to read objects from the `NormalizedCache` when executing an operation, + /// prior to attempting to fetch data from the network. + /// + /// - Parameters: + /// - field: The ``Selection.Field`` of the operation being executed. + /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. + /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. + /// - Returns: Aan array of ``CacheKeyInfo`` describing the computed cache keys. static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? } From 4dc1acc8eb0ba92e6e47cd8faf7f2c8d6a3d2081 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Sat, 30 Aug 2025 02:09:16 -0400 Subject: [PATCH 12/35] Updating frontend bundle --- .../Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift index d6a05b13f..1c53b405a 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/ApolloCodegenFrontendBundle.swift @@ -1 +1 @@ -let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){throw new Error(t??"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${a}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return l+s([[a-1+" |",p[i-1]],[`${a} |`,d],["|","^".padStart(u)],[`${a+1} |`,p[i+1]]])}function s(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:c,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=a(Array.isArray(r)?r:r?[r]:void 0);const p=a(this.nodes?.map((e=>e.loc)).filter((e=>null!=e)));this.source=o??p?.[0]?.source,this.positions=s??p?.map((e=>e.start)),this.locations=s&&o?s.map((e=>i(o,e))):p?.map((e=>i(e.source,e.start)));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+o((t=n.loc).source,i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+o(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function a(e){return void 0===e||0===e.length?void 0:e}function c(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const u={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=new Set(Object.keys(u));function p(e){const t=e?.kind;return"string"==typeof t&&l.has(t)}const d={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},f={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION"},h="Name",m="Document",v="OperationDefinition",y="VariableDefinition",g="SelectionSet",T="Field",E="Argument",b="FragmentArgument",N="FragmentSpread",S="InlineFragment",w="FragmentDefinition",L="Variable",I="IntValue",O="FloatValue",k="StringValue",_="BooleanValue",A="NullValue",D="EnumValue",x="ListValue",$="ObjectValue",F="ObjectField",G="Directive",Q="NamedType",C="ListType",R="NonNullType",V="SchemaDefinition",j="OperationTypeDefinition",M="ScalarTypeDefinition",U="ObjectTypeDefinition",P="FieldDefinition",B="InputValueDefinition",J="InterfaceTypeDefinition",q="UnionTypeDefinition",K="EnumTypeDefinition",z="EnumValueDefinition",Y="InputObjectTypeDefinition",H="DirectiveDefinition",W="SchemaExtension",X="ScalarTypeExtension",Z="ObjectTypeExtension",ee="InterfaceTypeExtension",te="UnionTypeExtension",ne="EnumTypeExtension",re="InputObjectTypeExtension";var ie=Object.freeze({__proto__:null,ARGUMENT:E,BOOLEAN:_,DIRECTIVE:G,DIRECTIVE_DEFINITION:H,DOCUMENT:m,ENUM:D,ENUM_TYPE_DEFINITION:K,ENUM_TYPE_EXTENSION:ne,ENUM_VALUE_DEFINITION:z,FIELD:T,FIELD_DEFINITION:P,FLOAT:O,FRAGMENT_ARGUMENT:b,FRAGMENT_DEFINITION:w,FRAGMENT_SPREAD:N,INLINE_FRAGMENT:S,INPUT_OBJECT_TYPE_DEFINITION:Y,INPUT_OBJECT_TYPE_EXTENSION:re,INPUT_VALUE_DEFINITION:B,INT:I,INTERFACE_TYPE_DEFINITION:J,INTERFACE_TYPE_EXTENSION:ee,LIST:x,LIST_TYPE:C,NAME:h,NAMED_TYPE:Q,NON_NULL_TYPE:R,NULL:A,OBJECT:$,OBJECT_FIELD:F,OBJECT_TYPE_DEFINITION:U,OBJECT_TYPE_EXTENSION:Z,OPERATION_DEFINITION:v,OPERATION_TYPE_DEFINITION:j,SCALAR_TYPE_DEFINITION:M,SCALAR_TYPE_EXTENSION:X,SCHEMA_DEFINITION:V,SCHEMA_EXTENSION:W,SELECTION_SET:g,STRING:k,UNION_TYPE_DEFINITION:q,UNION_TYPE_EXTENSION:te,VARIABLE:L,VARIABLE_DEFINITION:y});function oe(e){return 9===e||32===e}function se(e){return e>=48&&e<=57}function ae(e){return e>=97&&e<=122||e>=65&&e<=90}function ce(e){return ae(e)||95===e}function ue(e){return ae(e)||se(e)||95===e}function le(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t))).slice(n??0,r+1)}function pe(e){let t=0;for(;t",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};class Lexer{constructor(e){const t=new Token(fe.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==fe.EOF)do{if(e.next)e=e.next;else{const t=Ee(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===fe.COMMENT);return e}}function he(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function me(e,t){return ve(e.charCodeAt(t))&&ye(e.charCodeAt(t+1))}function ve(e){return e>=55296&&e<=56319}function ye(e){return e>=56320&&e<=57343}function ge(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return fe.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Te(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function Ee(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _e(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw c(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ae(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const u=[];for(;oFe)return"[Array]";const n=Math.min($e,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>Fe)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+Qe(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const Ce=null!=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=Ge(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||xe(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||xe(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Re(e,t){const n=new Parser(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function Ve(e,t){const n=new Parser(e,t);n.expectToken(fe.SOF);const r=n.parseConstValueLiteral();return n.expectToken(fe.EOF),r}class Parser{constructor(e,t={}){const n=function(e){return Ce(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(fe.NAME);return this.node(e,{kind:h,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:m,definitions:this.many(fe.SOF,this.parseDefinition,fe.EOF)})}parseDefinition(){if(this.peek(fe.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===fe.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw c(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(fe.BRACE_L))return this.node(e,{kind:v,operation:d.QUERY,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(fe.NAME)&&(n=this.parseName()),this.node(e,{kind:v,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(fe.NAME);switch(e.value){case"query":return d.QUERY;case"mutation":return d.MUTATION;case"subscription":return d.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(fe.PAREN_L,this.parseVariableDefinition,fe.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:y,variable:this.parseVariable(),type:(this.expectToken(fe.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(fe.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(fe.DOLLAR),this.node(e,{kind:L,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:g,selections:this.many(fe.BRACE_L,this.parseSelection,fe.BRACE_R)})}parseSelection(){return this.peek(fe.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(fe.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:T,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(fe.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(fe.PAREN_L,t,fe.PAREN_R)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(fe.PAREN_L,e,fe.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:E,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(fe.COLON),this.node(e,{kind:b,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(fe.SPREAD);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(fe.NAME)){const t=this.parseFragmentName();return this.peek(fe.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(e,{kind:N,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:N,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:S,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:w,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:w,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case fe.BRACKET_L:return this.parseList(e);case fe.BRACE_L:return this.parseObject(e);case fe.INT:return this.advanceLexer(),this.node(t,{kind:I,value:t.value});case fe.FLOAT:return this.advanceLexer(),this.node(t,{kind:O,value:t.value});case fe.STRING:case fe.BLOCK_STRING:return this.parseStringLiteral();case fe.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_,value:!0});case"false":return this.node(t,{kind:_,value:!1});case"null":return this.node(t,{kind:A});default:return this.node(t,{kind:D,value:t.value})}case fe.DOLLAR:if(e){if(this.expectToken(fe.DOLLAR),this._lexer.token.kind===fe.NAME){const e=this._lexer.token.value;throw c(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:k,value:e.value,block:e.kind===fe.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:x,values:this.any(fe.BRACKET_L,(()=>this.parseValueLiteral(e)),fe.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:$,fields:this.any(fe.BRACE_L,(()=>this.parseObjectField(e)),fe.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(fe.COLON),this.node(t,{kind:F,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(fe.AT);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(fe.AT),this.node(t,{kind:G,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(fe.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(fe.BRACKET_R),t=this.node(e,{kind:C,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(fe.BANG)?this.node(e,{kind:R,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Q,name:this.parseName()})}peekDescription(){return this.peek(fe.STRING)||this.peek(fe.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);return this.node(e,{kind:V,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(fe.COLON);const n=this.parseNamedType();return this.node(e,{kind:j,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:M,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:U,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(fe.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseFieldDefinition,fe.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(fe.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:P,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(fe.PAREN_L,this.parseInputValueDef,fe.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(fe.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(fe.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:B,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:J,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:q,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(fe.EQUALS)?this.delimitedMany(fe.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:K,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(fe.BRACE_L,this.parseEnumValueDefinition,fe.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:z,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw c(this._lexer.source,this._lexer.token.start,`${je(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:Y,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(fe.BRACE_L,this.parseInputValueDef,fe.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===fe.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(fe.BRACE_L,this.parseOperationTypeDefinition,fe.BRACE_R);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:W,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:X,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Z,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ee,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:te,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ne,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:re,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(fe.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:H,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(fe.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(f,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw c(this._lexer.source,t.start,`Expected ${Me(e)}, found ${je(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==fe.NAME||t.value!==e)throw c(this._lexer.source,t.start,`Expected "${e}", found ${je(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===fe.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return c(this._lexer.source,t.start,`Unexpected ${je(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==fe.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw c(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function je(e){const t=e.value;return Me(e.kind)+(null!=t?` "${t}"`:"")}function Me(e){return function(e){return e===fe.BANG||e===fe.DOLLAR||e===fe.AMP||e===fe.PAREN_L||e===fe.PAREN_R||e===fe.SPREAD||e===fe.COLON||e===fe.EQUALS||e===fe.AT||e===fe.BRACKET_L||e===fe.BRACKET_R||e===fe.BRACE_L||e===fe.PIPE||e===fe.BRACE_R}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function Ue(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Pe(e){return Be("and",e)}function Be(e,t){switch(0!==t.length||n(),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}function Je(e){return"object"==typeof e&&"function"==typeof e?.[Symbol.iterator]}function qe(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function Ke(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function ze(e){return 0===e.length?"":` at ${e.map((e=>"number"==typeof e?`[${e}]`:`.${e}`)).join("")}`}const Ye=5;function He(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+Be("or",r.slice(0,Ye).map((e=>`"${e}"`)))+"?"}function We(e){return e}function Xe(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function Ze(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-et,o=t.charCodeAt(r)}while(nt(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const et=48,tt=57;function nt(e){return!isNaN(e)&&et<=e&&e<=tt}function rt(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:Ze(e,t)}))}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=it(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=it(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function it(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>mt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=yt("(",mt(e.variableDefinitions,", "),")"),n=mt([e.operation,mt([e.name,t]),mt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+yt(" = ",n)+yt(" ",mt(r," "))},SelectionSet:{leave:({selections:e})=>vt(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=mt([yt("",e,": "),t],"");return mt([Et(o,n),yt(" ",mt(r," ")),yt(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Et("..."+e,t)+yt(" ",mt(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>mt(["...",yt("on ",e),mt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${yt("(",mt(n,", "),")")} on ${t} ${yt("",mt(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every((e=>0===e.length||oe(e.charCodeAt(0)))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const p=r&&oe(e.charCodeAt(0));return(u&&!p||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(st,at)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+mt(e,", ")+"]";return t.length>80?"[\n"+gt(mt(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+mt(e,", ")+" }";return t.length>80?vt(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+yt("(",mt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>yt("",e,"\n")+mt(["schema",mt(t," "),vt(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt(["scalar",t,mt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["type",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>yt("",e,"\n")+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+": "+r+yt(" ",mt(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>yt("",e,"\n")+mt([t+": "+n,yt("= ",r),mt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>yt("",e,"\n")+mt(["interface",t,yt("implements ",mt(n," & ")),mt(r," "),vt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>yt("",e,"\n")+mt(["union",t,mt(n," "),yt("= ",mt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>yt("",e,"\n")+mt(["enum",t,mt(n," "),vt(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>yt("",e,"\n")+mt([t,mt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>yt("",e,"\n")+mt(["input",t,mt(n," "),vt(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>yt("",e,"\n")+"directive @"+t+(Tt(n)?yt("(\n",gt(mt(n,"\n")),"\n)"):yt("(",mt(n,", "),")"))+(r?" repeatable":"")+" on "+mt(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>mt(["extend schema",mt(e," "),vt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>mt(["extend scalar",e,mt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend type",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>mt(["extend interface",e,yt("implements ",mt(t," & ")),mt(n," "),vt(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>mt(["extend union",e,mt(t," "),yt("= ",mt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>mt(["extend enum",e,mt(t," "),vt(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>mt(["extend input",e,mt(t," "),vt(n)]," ")}};function mt(e,t=""){return e?.filter((e=>e)).join(t)??""}function vt(e){return yt("{\n",gt(mt(e,"\n")),"\n}")}function yt(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function gt(e){return yt(" ",e.replaceAll("\n","\n "))}function Tt(e){return e?.some((e=>e.includes("\n")))??!1}function Et(e,t){let n=e+yt("(",mt(t,", "),")");return n.length>80&&(n=e+yt("(\n",gt(mt(t,"\n")),"\n)")),n}function bt(e,t){switch(e.kind){case A:return null;case I:return parseInt(e.value,10);case O:return parseFloat(e.value);case k:case D:case _:return e.value;case x:return e.values.map((e=>bt(e,t)));case $:return Xe(e.fields,(e=>e.name.value),(e=>bt(e.value,t)));case L:return t?.[e.name.value]}}function Nt(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(bt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||xe(0,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&("function"==typeof e.coerceInputValue&&"function"==typeof e.coerceInputLiteral||xe(0,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Jt(e){return Pt(e??[])}function qt(e,t){return Ke(Bt(t),((t,n)=>new GraphQLField(e,n,t)))}class GraphQLField{constructor(e,t,n){this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type;const r=n.args;this.args=r?Object.entries(r).map((([e,t])=>new GraphQLArgument(this,e,t))):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}}class GraphQLArgument{constructor(e,t,n){this.parent=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function Kt(e){return xt(e.type)&&void 0===e.default&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=qt.bind(void 0,this,e.fields),this._interfaces=Jt.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ke(this.getFields(),(e=>e.toConfig())),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=zt.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function zt(e){return Pt(e)}class GraphQLEnumType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values="function"==typeof e.values?e.values:Object.entries(e.values).map((([e,t])=>new GraphQLEnumValue(this,e,t))),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Object.entries(this._values()).map((([e,t])=>new GraphQLEnumValue(this,e,t)))),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=qe(this.getValues(),(e=>e.name))),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map((e=>[e.value,e]))));const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${Ge(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if("string"!=typeof e){const n=Ge(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?"":Yt(this,n)))}const n=this.getValue(e);if(null==n)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==D){const n=ft(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?"":Yt(this,n)),{nodes:e})}const n=this.getValue(e.value);if(null==n){const n=ft(e);throw new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+(t?"":Yt(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if("string"==typeof e&&this.getValue(e))return{kind:D,value:e}}toConfig(){return{name:this.name,description:this.description,values:Xe(this.getValues(),(e=>e.name),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Yt(e,t){return He("the enum value",rt(t,e.getValues().map((e=>e.name))))}class GraphQLEnumValue{constructor(e,t,n){this.parentEnum=e,this.name=function(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError(`Enum values cannot be named: ${e}`);return Nt(e)}(t),this.description=n.description,this.value=void 0!==n.value?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class GraphQLInputObjectType{constructor(e){this.name=Nt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=Ht.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:Ke(this.getFields(),(e=>e.toConfig())),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Ht(e,t){return Ke(Bt(t),((t,n)=>new GraphQLInputField(e,n,t)))}class GraphQLInputField{constructor(e,t,n){!("resolve"in n)||xe(0,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.parentType=e,this.name=Nt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=ot(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function Wt(e){return xt(e.type)&&void 0===e.defaultValue&&void 0===e.default}function Xt(e,t){return e===t||(xt(e)&&xt(t)||!(!Dt(e)||!Dt(t)))&&Xt(e.ofType,t.ofType)}function Zt(e,t,n){return t===n||(xt(n)?!!xt(t)&&Zt(e,t.ofType,n.ofType):xt(t)?Zt(e,t.ofType,n):Dt(n)?!!Dt(t)&&Zt(e,t.ofType,n.ofType):!Dt(t)&&(Rt(n)&&(Ot(t)||Lt(t))&&e.isSubType(n,t)))}function en(e,t,n){return t===n||(Rt(t)?Rt(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!Rt(n)&&e.isSubType(n,t))}function tn(e,t,n){return{prev:e,key:t,typename:n}}function nn(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function rn(e,n){if(xt(n)){if(null==e)return;return rn(e,n.ofType)}if(null==e)return{kind:A};if(Dt(n)){if(!Je(e))return rn(e,n.ofType);const t=[];for(const r of e){const e=rn(r,n.ofType);if(!e)return;t.push(e)}return{kind:x,values:t}}if(At(n)){if(!t(e))return;const r=[],i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(n.getFields())){if(void 0===e[t.name]){if(Wt(t))return}else{const n=rn(e[t.name],t.type);if(!n)return;r.push({kind:F,name:{kind:h,value:t.name},value:n})}}return{kind:$,fields:r}}const r=Qt(n);if(r.valueToLiteral)try{return r.valueToLiteral(e)}catch(e){return}return on(e)}function on(e){if(null==e)return{kind:A};switch(typeof e){case"boolean":return{kind:_,value:e};case"string":return{kind:k,value:e,block:!1};case"number":{if(!Number.isFinite(e))return{kind:A};const t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:O,value:t}}case"object":{if(Je(e))return{kind:x,values:Array.from(e,on)};const t=e,n=[];for(const e of Object.keys(t)){const r=t[e];void 0!==r&&n.push({kind:F,name:{kind:h,value:e},value:on(r)})}return{kind:$,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${Ge(e)}.`)}function sn(e,t,n){switch(e.kind){case L:{const r=e.name.value,i=n?.sources[r];if(i){const e=i.value;if(void 0===e){const e=i.signature.default;return void 0!==e?e.literal:{kind:A}}return sn(e,t,i.fragmentVariableValues)}const o=t?.sources[r];if(null==o)return{kind:A};if(void 0===o.value){const e=o.signature.default;if(void 0!==e)return e.literal}return rn(o.value,o.signature.type)}case $:{const r=[];for(const i of e.fields){if(i.value.kind===L){const e=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(void 0===e?.value&&void 0===e?.signature.default)continue}const e=sn(i.value,t,n);r.push({...i,value:e})}return{...e,fields:r}}case x:{const r=[];for(const i of e.values){const e=sn(i,t,n);r.push(e)}return{...e,values:r}}default:return e}}function an(e,t,n,r){return cn(e,t,n,r,void 0)}function cn(e,n,r,i,o){if(xt(n))return void 0===e?void un(r,`Expected a value of non-null type "${n}" to be provided.`,o):null===e?void un(r,`Expected value of non-null type "${n}" not to be null.`,o):cn(e,n.ofType,r,i,o);if(null!=e)if(Dt(n))if(Je(e)){let t=0;for(const s of e)cn(s,n.ofType,r,i,tn(o,t++,void 0))}else cn(e,n.ofType,r,i,o);else if(At(n)){if(!t(e)||Array.isArray(e))return void un(r,`Expected value of type "${n}" to be an object, found: ${Ge(e)}.`,o);const s=n.getFields();for(const t of Object.values(s)){const s=e[t.name];void 0===s?Wt(t)&&un(r,`Expected value of type "${n}" to include required field "${t.name}", found: ${Ge(e)}.`,o):cn(s,t.type,r,i,tn(o,t.name,n.name))}const a=Object.keys(e);for(const t of a)if(!Object.hasOwn(s,t)){const i=He(rt(t,Object.keys(s)));un(r,`Expected value of type "${n}" not to include unknown field "${t}"${i?`.${i} Found`:", found"}: ${Ge(e)}.`,o)}if(n.isOneOf){1!==a.length&&un(r,`Exactly one key must be specified for OneOf type "${n}".`,o);const t=a[0];null===e[t]&&un(r,`Field "${t}" for OneOf type "${n}" must be non-null.`,o)}}else{let t,s;Qt(n);try{t=n.coerceInputValue(e,i)}catch(e){if(e instanceof GraphQLError)return void r(e,nn(o));s=e}void 0===t&&un(r,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${Ge(e)}.`,o,s)}}function un(e,t,n,r){e(new GraphQLError(t,{originalError:r}),nn(n))}function ln(e,t,n,r,i,o){return pn({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function pn(e,t,n,r,i){if(t.kind!==L){if(xt(n))return t.kind===A?void fn(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i):pn(e,t,n.ofType,r,i);if(t.kind!==A)if(Dt(n))if(t.kind!==x)pn(e,t,n.ofType,r,i);else{let o=0;for(const s of t.values)pn(e,s,n.ofType,r,tn(i,o++,void 0))}else if(At(n)){if(t.kind!==$)return void fn(e.onError,`Expected value of type "${n}" to be an object, found: ${ft(t)}.`,t,i);const o=n.getFields(),s=qe(t.fields,(e=>e.name.value));for(const a of Object.values(o)){const o=s[a.name];if(void 0===o)Wt(a)&&fn(e.onError,`Expected value of type "${n}" to include required field "${a.name}", found: ${ft(t)}.`,t,i);else{const s=o.value;if(s.kind===L&&!e.static){const r=dn(e,s),o=s.name.value,c=r?.coerced[o];if(n.isOneOf)void 0===c?fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):null===c&&fn(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(void 0===c&&!Wt(a))continue}pn(e,s,a.type,r,tn(i,a.name,n.name))}}const a=t.fields;for(const s of a){const a=s.name.value;if(!Object.hasOwn(o,a)){const c=r?"":He(rt(a,Object.keys(o)));fn(e.onError,`Expected value of type "${n}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ft(t)}.`,s,i)}}if(n.isOneOf){if(1!==a.length)return void fn(e.onError,`OneOf Input Object "${n}" must specify exactly one key.`,t,i);if(a[0].value.kind===A){const r=a[0].name.value;fn(e.onError,`Field "${n}.${r}" used for OneOf Input Object must be non-null.`,t,tn(i,r,void 0))}}}else{let o,s;Qt(n);try{o=n.coerceInputLiteral?n.coerceInputLiteral(sn(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(t){if(t instanceof GraphQLError)return void e.onError(t,nn(i));s=t}void 0===o&&fn(e.onError,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${ft(t)}.`,t,i,s)}}else{if(e.static)return;const r=dn(e,t),o=r?.coerced[t.name.value];xt(n)&&(void 0===o?fn(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):null===o&&fn(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i))}}function dn(e,t){const n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function fn(e,t,n,r,i){e(new GraphQLError(t,{nodes:n,originalError:i}),nn(r))}const hn=2147483647,mn=-2147483648,vn=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${Ge(t)}`);if(n>hn||nhn||ehn||t=mn)return{kind:I,value:String(e)}}}),yn=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(t)}`);return n},coerceInputValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new GraphQLError(`Float cannot represent non numeric value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==O&&e.kind!==I)throw new GraphQLError(`Float cannot represent non numeric value: ${ft(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){const t=on(e);if(t.kind===O||t.kind===I)return t}}),gn=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError(`String cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"!=typeof e)throw new GraphQLError(`String cannot represent a non string value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==k)throw new GraphQLError(`String cannot represent a non string value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===k)return t}}),Tn=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){const t=Sn(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(t)}`)},coerceInputValue(e){if("boolean"!=typeof e)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${Ge(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${ft(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=on(e);if(t.kind===_)return t}}),En=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){const t=Sn(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError(`ID cannot represent value: ${Ge(e)}`)},coerceInputLiteral(e){if(e.kind!==k&&e.kind!==I)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+ft(e),{nodes:e});return e.value},valueToLiteral(e){const t=Number.isInteger(e)?String(e):e;if("string"==typeof t)return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:I,value:t}:{kind:k,value:t,block:!1}}}),bn=Object.freeze([gn,vn,yn,Tn,En]);function Nn(e){return bn.some((({name:t})=>e.name===t))}function Sn(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function wn(e){return Ce(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Nt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=ot(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||xe(0,`@${this.name} locations must be an Array.`);const n=e.args??{};t(n)&&!Array.isArray(n)||xe(0,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(n).map((([e,t])=>new GraphQLArgument(this,e,t)))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Xe(this.args,(e=>e.name),(e=>e.toConfig())),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Ln=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Included when true."}}}),In=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[f.FIELD,f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Skipped when true."}}}),On=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[f.FRAGMENT_SPREAD,f.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(Tn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),kn=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[f.FIELD],args:{initialCount:{default:{value:0},type:new GraphQLNonNull(vn),description:"Number of items to return immediately"},if:{type:new GraphQLNonNull(Tn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:gn,description:"Unique name"}}}),_n="No longer supported",An=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[f.FIELD_DEFINITION,f.ARGUMENT_DEFINITION,f.INPUT_FIELD_DEFINITION,f.ENUM_VALUE],args:{reason:{type:new GraphQLNonNull(gn),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:_n}}}}),Dn=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[f.SCALAR],args:{url:{type:new GraphQLNonNull(gn),description:"The URL that specifies the behavior of this scalar."}}}),xn=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[f.INPUT_OBJECT],args:{}});new GraphQLDirective({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[f.QUERY,f.MUTATION,f.SUBSCRIPTION]});const $n=Object.freeze([Ln,In,An,Dn,xn]);function Fn(e){return $n.some((({name:t})=>t===e.name))}function Gn(e,r){if(xt(r)){const t=Gn(e,r.ofType);return t?.kind===A?null:t}if(null===e)return{kind:A};if(void 0===e)return null;if(Dt(r)){const t=r.ofType;if(Je(e)){const n=[];for(const r of e){const e=Gn(r,t);null!=e&&n.push(e)}return{kind:x,values:n}}return Gn(e,t)}if(At(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=Gn(e[t.name],t.type);r&&n.push({kind:F,name:{kind:h,value:t.name},value:r})}return{kind:$,fields:n}}if(Gt(r)){const t=r.coerceOutputValue(e);if(null==t)return null;if("boolean"==typeof t)return{kind:_,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return Qn.test(e)?{kind:I,value:e}:{kind:O,value:e}}if("string"==typeof t)return _t(r)?{kind:D,value:t}:r===En&&Qn.test(t)?{kind:I,value:t}:{kind:k,value:t};throw new TypeError(`Cannot convert value to AST: ${Ge(t)}.`)}n(0,"Unexpected input type: "+Ge(r))}const Qn=/^-?(?:0|[1-9][0-9]*)$/;function Cn(e){const t=e.type,r=e.default;if(r){const e=r.literal??rn(r.value,t);return null!=e||n(0,"Invalid default value"),e}const i=e.defaultValue;if(void 0!==i){const e=Gn(i,t);return null!=e||n(0,"Invalid default value"),e}}const Rn=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:gn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Mn))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(Mn),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Mn,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Mn,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Vn))),resolve:e=>e.getDirectives()}})}),Vn=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(Tn),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(jn))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))}})}),jn=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:f.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:f.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:f.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:f.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:f.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:f.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:f.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:f.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:f.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:f.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:f.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:f.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:f.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:f.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:f.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:f.UNION,description:"Location adjacent to a union definition."},ENUM:{value:f.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:f.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:f.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:f.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Mn=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(qn),resolve:e=>wt(e)?Jn.SCALAR:Lt(e)?Jn.OBJECT:Ot(e)?Jn.INTERFACE:kt(e)?Jn.UNION:_t(e)?Jn.ENUM:At(e)?Jn.INPUT_OBJECT:Dt(e)?Jn.LIST:xt(e)?Jn.NON_NULL:void n(0,`Unexpected type: "${Ge(e)}".`)},name:{type:gn,resolve:e=>"name"in e?e.name:void 0},description:{type:gn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:gn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(Un)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Lt(e)||Ot(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e){if(Lt(e)||Ot(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(Mn)),resolve(e,t,n,{schema:r}){if(Rt(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(Bn)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(_t(e)){const n=e.getValues();return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(Pn)),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(At(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:Mn,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:Tn,resolve:e=>{if(At(e))return e.isOneOf}}})}),Un=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(Pn))),args:{includeDeprecated:{type:new GraphQLNonNull(Tn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Pn=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},type:{type:new GraphQLNonNull(Mn),resolve:e=>e.type},defaultValue:{type:gn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const t=Cn(e);return t?ft(t):null}},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Bn=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(gn),resolve:e=>e.name},description:{type:gn,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(Tn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:gn,resolve:e=>e.deprecationReason}})}),Jn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},qn=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Jn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Jn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Jn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Jn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Jn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Jn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Jn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Jn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Kn=new GraphQLField(void 0,"__schema",{type:new GraphQLNonNull(Rn),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),zn=new GraphQLField(void 0,"__type",{type:Mn,description:"Request the type information of a single type.",args:{name:{type:new GraphQLNonNull(gn)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),Yn=new GraphQLField(void 0,"__typename",{type:new GraphQLNonNull(gn),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),Hn=Object.freeze([Rn,Vn,jn,Mn,Un,Pn,Bn,qn]);function Wn(e){return Hn.some((({name:t})=>e.name===t))}function Xn(e){if(!function(e){return Ce(e,GraphQLSchema)}(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.assumeValid=e.assumeValid??!1,this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??$n;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Zn(n,t);null!=this._queryType&&Zn(this._queryType,t),null!=this._mutationType&&Zn(this._mutationType,t),null!=this._subscriptionType&&Zn(this._subscriptionType,t);for(const e of this._directives)if(wn(e))for(const n of e.args)Zn(n.type,t);Zn(Rn,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Ot(e)){for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(Lt(e))for(const t of e.getInterfaces())if(Ot(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case d.QUERY:return this.getQueryType();case d.MUTATION:return this.getMutationType();case d.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return kt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(kt(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}getField(e,t){switch(t){case Kn.name:return this.getQueryType()===e?Kn:void 0;case zn.name:return this.getQueryType()===e?zn:void 0;case Yn.name:return Yn}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Zn(e,t){const n=Ut(e);if(!t.has(n))if(t.add(n),kt(n))for(const e of n.getTypes())Zn(e,t);else if(Lt(n)||Ot(n)){for(const e of n.getInterfaces())Zn(e,t);for(const e of Object.values(n.getFields())){Zn(e.type,t);for(const n of e.args)Zn(n.type,t)}}else if(At(n))for(const e of Object.values(n.getFields()))Zn(e.type,t);return t}function er(e){if(Xn(e),e.__validationErrors)return e.__validationErrors;const n=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(d)){const i=t.getRootType(r);if(null!=i)if(Lt(i))n.add(i,r);else{const n=Ue(r),o=Ge(i);e.reportError(r===d.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,tr(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=Pe(i);e.reportError(`All root types must be different, "${r}" type is used as ${n} root types.`,i.map((e=>tr(t,e))))}}(n),function(e){for(const t of e.schema.getDirectives())if(wn(t)){ir(e,t),0===t.locations.length&&e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}else e.reportError(`Expected directive but got: ${Ge(t)}.`,t?.astNode)}(n),function(e){const n=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(xt(t.type)&&At(t.type.ofType)){const s=t.type.ofType,a=r[s.name];if(n.push({fieldStr:`${o}.${t.name}`,astNode:t.astNode}),void 0===a)i(s);else{const t=n.slice(a),r=t.map((e=>e.fieldStr)).join(", ");e.reportError(`Invalid circular reference. The Input Object ${s} references itself ${t.length>1?"via the non-null fields:":"in the non-null field"} ${r}.`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),r=function(e){const n=Object.create(null),r=[],i=Object.create(null);return function(e){return o(e,Object.create(null))};function o(e,n){if(Je(n))for(const t of n)o(e,t);else if(t(n))for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?o(r,n[t.name]):a(t,r,`${e}.${t.name}`))}}function s(e,t){if(t.kind===x){for(const n of t.values)s(e,n);return}if(t.kind!==$)return;const n=qe(t.fields,(e=>e.name.value));for(const t of Object.values(e.getFields())){const r=Ut(t.type);At(r)&&(Object.hasOwn(n,t.name)?s(r,n[t.name].value):a(t,r,`${e}.${t.name}`))}}function a(t,a,c){const u=t.default;if(void 0===u)return;const l=i[c];void 0===l?void 0===n[c]&&(n[c]=!0,i[c]=r.push([c,t.astNode?.defaultValue]),u.literal?s(a,u.literal):o(a,u.value),r.pop(),i[c]=void 0):e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${le)).join(", ")}`:""}.`,r.slice(l-1).map((([,e])=>e)))}}(e),i=e.schema.getTypeMap();for(const t of Object.values(i))Mt(t)?(Wn(t)||ir(e,t),Lt(t)||Ot(t)?(or(e,t),sr(e,t)):kt(t)?ur(e,t):_t(t)?lr(e,t):At(t)&&(pr(e,t),n(t),r(t))):e.reportError(`Expected GraphQL named type but got: ${Ge(t)}.`,t.astNode)}(n);const r=n.getErrors();return e.__validationErrors=r,r}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function tr(e,t){return[e.astNode,...e.extensionASTNodes].flatMap((e=>e?.operationTypes??[])).find((e=>e.operation===t))?.type}function nr(e,t){const n=t.default;if(n)if(n.literal)ln(n.literal,t.type,((n,r)=>{e.reportError(`${t} has invalid default value${ze(r)}: ${n.message}`,n.nodes)}));else{const r=[];if(an(n.value,t.type,((e,t)=>{r.push([e,t])})),r.length>0)try{const r=rr(n.value,t.type),i=[];if(an(r,t.type,((e,t)=>{i.push([e,t])})),0===i.length)return void e.reportError(`${t} has invalid default value: ${Ge(n.value)}. Did you mean: ${Ge(r)}?`,t.astNode?.defaultValue)}catch(e){}for(const[n,i]of r)e.reportError(`${t} has invalid default value${ze(i)}: ${n.message}`,t.astNode?.defaultValue)}}function rr(e,r){if(xt(r))return rr(e,r.ofType);if(null===e)return null;if(Dt(r))return Je(e)?Array.from(e,(e=>rr(e,r.ofType))):[rr(e,r.ofType)];if(At(r)){t(e)||n();const i=r.getFields();return Ke(e,((e,t)=>(t in i||n(),rr(e,i[t].type))))}return Qt(r),r.coerceOutputValue(e)}function ir(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function or(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const t of n){ir(e,t),Ft(t.type)||e.reportError(`The type of ${t} must be Output Type but got: ${Ge(t.type)}.`,t.astNode?.type);for(const n of t.args)ir(e,n),$t(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${Ge(n.type)}.`,n.astNode?.type),Kt(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[mr(n.astNode),n.astNode?.type]),nr(e,n)}}function sr(e,t){const n=new Set;for(const r of t.getInterfaces())Ot(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t} can only implement ${r} once.`,fr(t,r)):(n.add(r.name),cr(e,t,r),ar(e,t,r)):e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,fr(t,r)):e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${Ge(r)}.`,fr(t,r))}function ar(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=r[i.name];if(null!=o){Zt(e.schema,o.type,i.type)||e.reportError(`Interface field ${i} expects type ${i.type} but ${o} is type ${o.type}.`,[i.astNode?.type,o.astNode?.type]);for(const t of i.args){const n=o.args.find((e=>e.name===t.name));n?Xt(t.type,n.type)||e.reportError(`Interface field argument ${t} expects type ${t.type} but ${n} is type ${n.type}.`,[t.astNode?.type,n.astNode?.type]):e.reportError(`Interface field argument ${t} expected but ${o} does not provide it.`,[t.astNode,o.astNode])}for(const t of o.args)if(Kt(t)){i.args.find((e=>e.name===t.name))||e.reportError(`Argument "${t}" must not be required type "${t.type}" if not provided by the Interface field "${i}".`,[t.astNode,i.astNode])}null!=o.deprecationReason&&null==i.deprecationReason&&e.reportError(`Interface field ${n.name}.${i.name} is not deprecated, so implementation field ${t.name}.${o.name} must not be deprecated.`,[mr(o.astNode),o.astNode?.type])}else e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function cr(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...fr(n,i),...fr(t,n)])}function ur(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t} can only include type ${i} once.`,hr(t,i.name)):(r.add(i.name),Lt(i)||e.reportError(`Union type ${t} can only include Object types, it cannot include ${Ge(i)}.`,hr(t,String(i))))}function lr(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)ir(e,t)}function pr(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)ir(e,r),$t(r.type)||e.reportError(`The type of ${r} must be Input Type but got: ${Ge(r.type)}.`,r.astNode?.type),Wt(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${r} cannot be deprecated.`,[mr(r.astNode),r.astNode?.type]),nr(e,r),t.isOneOf&&dr(t,r,e)}function dr(e,t,n){xt(t.type)&&n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type),void 0===t.default&&void 0===t.defaultValue||n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function fr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.interfaces??[])).filter((e=>e.name.value===t.name))}function hr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>e.types??[])).filter((e=>e.name.value===t))}function mr(e){return e?.directives?.find((e=>e.name.value===An.name))}function vr(e,t){switch(t.kind){case C:{const n=vr(e,t.type);return n&&new GraphQLList(n)}case R:{const n=vr(e,t.type);return n&&new GraphQLNonNull(n)}case Q:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t&&($t(t)&&this._inputTypeStack.push(t),Ct(t)&&this._parentTypeStack.push(t),Ft(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case m:{const t=function(e){const t=new Map;for(const n of e.definitions)if(n.kind===w){const e=new Map;if(n.variableDefinitions)for(const t of n.variableDefinitions)e.set(t.variable.name.value,t);const r={definition:n,variableDefinitions:e};t.set(n.name.value,r)}return t}(e);this._fragmentSignaturesByName=e=>t.get(e);break}case g:{const e=Ut(this.getType());this._parentTypeStack.push(Ct(e)?e:void 0);break}case T:{const n=this.getParentType();let r,i;n&&(r=t.getField(n,e.name.value),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Ft(i)?i:void 0);break}case G:this._directive=t.getDirective(e.name.value);break;case v:{const n=t.getRootType(e.operation);this._typeStack.push(Lt(n)?n:void 0);break}case N:this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break;case S:case w:{const n=e.typeCondition,r=n?vr(t,n):Ut(this.getType());this._typeStack.push(Ft(r)?r:void 0);break}case y:{const n=vr(t,e.type);this._inputTypeStack.push($t(n)?n:void 0);break}case E:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find((t=>t.name===e.name.value)),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?.default??t?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case b:{const t=this.getFragmentSignature(),n=t?.variableDefinitions.get(e.name.value);let r;this._fragmentArgument=n,n&&(r=vr(this._schema,n.type)),this._inputTypeStack.push($t(r)?r:void 0);break}case x:{const e=function(e){if(e)return xt(e)?e.ofType:e}(this.getInputType()),t=Dt(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push($t(t)?t:void 0);break}case F:{const t=Ut(this.getInputType());let n,r;At(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?.default??r?.defaultValue??void 0),this._inputTypeStack.push($t(n)?n:void 0);break}case D:{const t=Ut(this.getInputType());let n;_t(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case m:this._fragmentSignaturesByName=()=>null;break;case g:this._parentTypeStack.pop();break;case T:this._fieldDefStack.pop(),this._typeStack.pop();break;case G:this._directive=null;break;case N:this._fragmentSignature=null;break;case v:case S:case w:this._typeStack.pop();break;case y:this._inputTypeStack.pop();break;case E:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case b:this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case x:case F:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case D:this._enumValue=null}}}function yr(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=dt(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),p(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=dt(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function gr(e){const t=e.arguments?.find((e=>"if"===e.name.value));if(!t)return!1;if(t.value.kind===_){if(t.value.value)return!1}else if(t.value.kind!==L)return!1;return!0}function Tr(e){return e.kind===v||e.kind===w}function Er(e){return e.kind===M||e.kind===U||e.kind===J||e.kind===q||e.kind===K||e.kind===Y}function br(e){return e.kind===X||e.kind===Z||e.kind===ee||e.kind===te||e.kind===ne||e.kind===re}function Nr(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,e.args.map((e=>e.name)));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,n.map((e=>e.name.value)))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=rt(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+(e.hideSuggestions?"":He(o)),{nodes:t}))}}return!1}}}function Sr(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():$n;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===H&&t.set(e.name.value,e.locations.map((e=>e.value)));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(),t.kind){case v:return function(e){switch(e){case d.QUERY:return f.QUERY;case d.MUTATION:return f.MUTATION;case d.SUBSCRIPTION:return f.SUBSCRIPTION}}(t.operation);case T:return f.FIELD;case N:return f.FRAGMENT_SPREAD;case S:return f.INLINE_FRAGMENT;case w:return f.FRAGMENT_DEFINITION;case y:{const t=e[e.length-3];return"kind"in t||n(),t.kind===v?f.VARIABLE_DEFINITION:f.FRAGMENT_VARIABLE_DEFINITION}case V:case W:return f.SCHEMA;case M:case X:return f.SCALAR;case U:case Z:return f.OBJECT;case P:return f.FIELD_DEFINITION;case J:case ee:return f.INTERFACE;case q:case te:return f.UNION;case K:case ne:return f.ENUM;case z:return f.ENUM_VALUE;case Y:case re:return f.INPUT_OBJECT;case B:{const t=e.at(-3);return null!=t&&"kind"in t||n(),t.kind===Y?f.INPUT_FIELD_DEFINITION:f.ARGUMENT_DEFINITION}default:n(0,"Unexpected kind: "+Ge(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function wr(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Er).map((e=>e.name.value))]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===V||Er(e)||e.kind===H}(c)||function(e){return e.kind===W||br(e)}(c)));if(o&&Lr.has(a))return;const u=e.hideSuggestions?[]:rt(a,o?[...Lr,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+He(u),{nodes:t}))}var c}}}const Lr=new Set([...bn,...Hn].map((e=>e.name)));function Ir(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Or(e){switch(e.kind){case $:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:Or(e.value)}))).sort(((e,t)=>Ze(e.name.value,t.name.value))))};case x:return{...e,values:e.values.map(Or)};case I:case O:case k:case _:case A:case D:case L:return e}var t}function kr(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+kr(t))).join(" and "):e}function _r(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);const c=e.getFragment(a.node.name.value);if(!c)return;const[u,l]=Vr(e,n,c,a.varMap);if(s!==u){Dr(e,t,n,r,i,o,s,void 0,u,a.varMap);for(const a of l)_r(e,t,n,r,i,o,s,a)}}function Ar(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value&&!$r(s.node.arguments,s.varMap,a.node.arguments,a.varMap))return void e.reportError(new GraphQLError(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);const c=e.getFragment(s.node.name.value),u=e.getFragment(a.node.name.value);if(!c||!u)return;const[l,p]=Vr(e,n,c,s.varMap),[d,f]=Vr(e,n,u,a.varMap);Dr(e,t,n,r,i,o,l,s.varMap,d,a.varMap);for(const a of f)Ar(e,t,n,r,i,o,s,a);for(const s of p)Ar(e,t,n,r,i,o,s,a)}function Dr(e,t,n,r,i,o,s,a,c,u){for(const[l,p]of s.entries()){const s=c.get(l);if(null!=s)for(const c of p)for(const p of s){const s=xr(e,n,r,i,o,l,c,a,p,u);s&&t.push(s)}}}function xr(e,t,n,r,i,o,s,a,c,u){const[l,p,d]=s,[f,h,m]=c,v=i||l!==f&&Lt(l)&&Lt(f);if(!v){const e=p.name.value,t=h.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[p],[h]];if(!$r(p.arguments,a,h.arguments,u))return[[o,"they have differing arguments"],[p],[h]]}const y=function(e,t,n,r){const i=Qr(e),o=Qr(n);if(!i&&!o)return;if(i&&o)return $r(i.arguments,t,o.arguments,r)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives";return"they have overlapping stream directives"}(p.directives??[],a,h.directives??[],u);if(void 0!==y)return[[o,y],[p],[h]];const g=d?.type,T=m?.type;if(g&&T&&Cr(g,T))return[[o,`they return conflicting types "${Ge(g)}" and "${Ge(T)}"`],[p],[h]];const E=p.selectionSet,b=h.selectionSet;if(E&&b){const i=function(e,t,n,r,i,o,s,a,c,u,l){const p=[],[d,f]=Rr(e,t,o,s,a),[h,m]=Rr(e,t,c,u,l);Dr(e,p,t,n,r,i,d,a,h,l);for(const o of m)_r(e,p,t,n,r,i,d,o);for(const o of f)_r(e,p,t,n,r,i,h,o);for(const o of f)for(const s of m)Ar(e,p,t,n,r,i,o,s);return p}(e,t,n,r,v,Ut(g),E,a,Ut(T),b,u);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(i,o,p,h)}}function $r(e,t,n,r){if(void 0===e||0===e.length)return void 0===n||0===n.length;if(void 0===n||0===n.length)return!1;if(e.length!==n.length)return!1;const i=new Map(n.map((({name:e,value:t})=>[e.value,void 0===r?t:Fr(t,r)])));return e.every((e=>{let n=e.value;t&&(n=Fr(n,t));const r=i.get(e.name.value);return void 0!==r&&Gr(n)===Gr(r)}))}function Fr(e,t){switch(e.kind){case L:return t.get(e.name.value)??e;case x:return{...e,values:e.values.map((e=>Fr(e,t)))};case $:return{...e,fields:e.fields.map((e=>({...e,value:Fr(e.value,t)})))};default:return e}}function Gr(e){return ft(Or(e))}function Qr(e){return e.find((e=>"stream"===e.name.value))}function Cr(e,t){return Dt(e)?!Dt(t)||Cr(e.ofType,t.ofType):!!Dt(t)||(xt(e)?!xt(t)||Cr(e.ofType,t.ofType):!!xt(t)||!(!Gt(e)&&!Gt(t))&&e!==t)}function Rr(e,t,n,r,i){const o=t.get(r);if(o)return o;const s=new Map,a=new Map;jr(e,n,r,s,a,i);const c=[s,Array.from(a.values())];return t.set(r,c),c}function Vr(e,t,n,r){const i=t.get(n.selectionSet);if(i)return i;const o=vr(e.getSchema(),n.typeCondition);return Rr(e,t,o,n.selectionSet,r)}function jr(e,t,n,r,i,o){for(const s of n.selections)switch(s.kind){case T:{const e=s.name.value;let n;(Lt(t)||Ot(t))&&(n=t.getFields()[e]);const i=s.alias?s.alias.value:e;let o=r.get(i);null==o&&(o=[],r.set(i,o)),o.push([t,s,n]);break}case N:{const t=Mr(e,s,o);i.set(t.key,t);break}case S:{const n=s.typeCondition,a=n?vr(e.getSchema(),n):t;jr(e,a,s.selectionSet,r,i,o);break}}}function Mr(e,t,n){let r="";const i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(const e of t.arguments)s.set(e.name.value,e.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(const[e,t]of o.variableDefinitions){const o=s.get(e);o&&(r+=e+": "+ft(Or(o)));const a=s.get(e);void 0!==a?i.set(e,void 0!==n?Fr(a,n):a):t.defaultValue&&i.set(e,t.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){const r=this._data.get(e)?.get(t);return void 0!==r&&(!!n||n===r)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e[e.name,e]))));const i=e.getDocument().definitions;for(const e of i)if(e.kind===H){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(Br).map((e=>[e.name.value,e]))))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map((e=>e.name.value)));for(const[t,s]of i.entries())if(!o.has(t)){const i=St(s.type)?Ge(s.type):ft(s.type);e.reportError(new GraphQLError(`Argument "@${r}(${t}:)" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function Br(e){return e.type.kind===R&&null==e.defaultValue}function Jr(e,n){if(xt(n)){if(null==e)return;return Jr(e,n.ofType)}if(null==e)return null;if(Dt(n)){if(!Je(e)){const t=Jr(e,n.ofType);if(void 0===t)return;return[t]}const t=[];for(const r of e){const e=Jr(r,n.ofType);if(void 0===e)return;t.push(e)}return t}if(At(n)){if(!t(e)||Array.isArray(e))return;const r={},i=n.getFields();if(Object.keys(e).some((e=>!Object.hasOwn(i,e))))return;for(const t of Object.values(i)){const n=e[t.name];if(void 0===n){if(Wt(t))return;const e=zr(t);void 0!==e&&(r[t.name]=e)}else{const e=Jr(n,t.type);if(void 0===e)return;r[t.name]=e}}if(n.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}const r=Qt(n);try{return r.coerceInputValue(e)}catch(e){}}function qr(e,t,n,r){if(e.kind===L){const i=Kr(e,n,r);if(null==i&&xt(t))return;return i}if(xt(t)){if(e.kind===A)return;return qr(e,t.ofType,n,r)}if(e.kind===A)return null;if(Dt(t)){if(e.kind!==x){const i=qr(e,t.ofType,n,r);if(void 0===i)return;return[i]}const i=[];for(const o of e.values){let e=qr(o,t.ofType,n,r);if(void 0===e){if(o.kind!==L||null!=Kr(o,n,r)||xt(t.ofType))return;e=null}i.push(e)}return i}if(At(t)){if(e.kind!==$)return;const i={},o=t.getFields();if(e.fields.some((e=>!Object.hasOwn(o,e.name.value))))return;const s=new Map(e.fields.map((e=>[e.name.value,e])));for(const e of Object.values(o)){const t=s.get(e.name);if(!t||t.value.kind===L&&null==Kr(t.value,n,r)){if(Wt(e))return;const t=zr(e);void 0!==t&&(i[e.name]=t)}else{const o=qr(t.value,e.type,n,r);if(void 0===o)return;i[e.name]=o}}if(t.isOneOf){const e=Object.keys(i);if(1!==e.length)return;if(null===i[e[0]])return}return i}const i=Qt(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(sn(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(e){}}function Kr(e,t,n){const r=e.name.value;return void 0!==n?.sources[r]?n.coerced[r]:t?.coerced[r]}function zr(e){let t=e._memoizedCoercedDefaultValue;if(void 0!==t)return t;const r=e.default;if(void 0!==r)return t=r.literal?qr(r.literal,e.type):Jr(r.value,e.type),void 0!==t||n(),e._memoizedCoercedDefaultValue=t,t;const i=e.defaultValue;return void 0!==i&&(e._memoizedCoercedDefaultValue=i),i}function Yr(e,t,n,r,i){const o=e.arguments??[],s=new Map(o.map((e=>[e.name.value,e]))),a=Object.create(null),c=Object.create(null);for(const[o,u]of Object.entries(t)){a[o]={signature:u};const t=s.get(o);if(void 0!==t){const e=a[o];e.value=t.value,e.fragmentVariableValues=r}Wr(c,e,o,u,t,n,r,i)}return{sources:a,coerced:c}}function Hr(e,t,n,r,i){const o={},s=t.arguments??[],a=new Map(s.map((e=>[e.name.value,e])));for(const s of e.args){Wr(o,t,s.name,s,a.get(s.name),n,r,i)}return o}function Wr(e,t,r,i,o,s,a,c){const u=i.type;if(!o){if(Kt(i))throw new GraphQLError(`Argument "${It(i)?i:r}" of required type "${u}" was not provided.`,{nodes:t});const n=zr(i);return void(void 0!==n&&(e[r]=n))}const l=o.value;if(l.kind===L){const t=l.name.value,n=a?.sources[t]?a:s;if(!(null!=n&&Object.hasOwn(n.coerced,t)||Kt(i))){const t=zr(i);return void(void 0!==t&&(e[r]=t))}}const p=qr(l,u,s,a);void 0===p&&(ln(l,u,((e,t)=>{throw e.message=`Argument "${It(i)?i:i.name}" has invalid value${ze(t)}: ${e.message}`,e}),s,a,c),n(0,"Invalid argument")),e[r]=p}function Xr(e,t,n,r,i){const o=t.directives?.find((t=>t.name.value===e.name));if(o)return Hr(e,o,n,r,i)}function Zr(e,t,n,r,i,o,s=!1){const a=new AccumulatorMap,c=[],u={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Set,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return ei(u,i,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:u.forbiddenDirectiveInstances}}function ei(e,t,n,r,i,o){const{schema:s,fragments:a,variableValues:c,runtimeType:u,visitedFragmentNames:l,hideSuggestions:p}=e;for(const f of t.selections)switch(f.kind){case T:if(!ni(e,f,c,o))continue;n.add((d=f).alias?d.alias.value:d.name.value,{node:f,deferUsage:i,fragmentVariableValues:o});break;case S:{if(!ni(e,f,c,o)||!ri(s,f,u))continue;const t=ti(c,o,f,i);t?(r.push(t),ei(e,f.selectionSet,n,r,t,o)):ei(e,f.selectionSet,n,r,i,o);break}case N:{const t=f.name.value;if(l.has(t)||!ni(e,f,c,o))continue;const d=a[t];if(null==d||!ri(s,d.definition,u))continue;const h=ti(c,o,f,i),m=d.variableSignatures;let v;m&&(v=Yr(f,m,c,o,p)),h?(r.push(h),ei(e,d.definition.selectionSet,n,r,h,v)):(l.add(t),ei(e,d.definition.selectionSet,n,r,i,v));break}}var d}function ti(e,t,n,r){const i=Xr(On,n,e,t);if(i&&!1!==i.if)return{label:"string"==typeof i.label?i.label:void 0,parentDeferUsage:r}}function ni(e,t,n,r){const i=t.directives?.find((e=>e.name.value===In.name));if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;const o=i?Hr(In,i,n,r,e.hideSuggestions):void 0;if(!0===o?.if)return!1;const s=t.directives?.find((e=>e.name.value===Ln.name));if(s&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(s),!1;const a=s?Hr(Ln,s,n,r,e.hideSuggestions):void 0;return!1!==a?.if}function ri(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=vr(e,r);return i===n||!!Rt(i)&&e.isSubType(i,n)}function ii(e){return e.map((e=>e.node))}function oi(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function si(e){return{Field:t,Directive:t};function t(t){const n=oi(t.arguments??[],(e=>e.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map((e=>e.name))}))}}function ai(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():$n;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===H&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===V||n.kind===W)r=o;else if(Er(n)||br(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function ci(e,t){return!!(Lt(e)||Ot(e)||At(e))&&null!=e.getFields()[t]}function ui(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function li(e,t,n){return n&&ln(t,n,(t=>{e.reportError(t)}),void 0,void 0,e.hideSuggestions),!1}function pi(e,t,n,r,i){if(xt(r)&&!xt(t)){if(!(null!=n&&n.kind!==A)&&!(void 0!==i))return!1;return Zt(e,t,r.ofType)}return Zt(e,t,r)}const di=Object.freeze([function(e){function t(n,r=Object.create(null),i=0){if(n.kind===N){const o=n.name.value;if(!0===r[o])return!1;const s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===T&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}]),fi=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!Tr(n)){const t=n.kind===V||n.kind===W?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=e.getSchema();return{OperationDefinition(n){const r=n.operation;t.getRootType(r)||e.reportError(new GraphQLError(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===v)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===w&&(a[e.name.value]={definition:e});const{groupedFieldSet:c,forbiddenDirectiveInstances:u}=Zr(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(u.length>0)return void e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:u}));if(c.size>1){const t=[...c.values()].slice(1).flatMap((e=>ii(e)));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){ii(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ii(t)}))}}}}}},wr,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=vr(e.getSchema(),n);if(t&&!Ct(t)){const t=ft(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=vr(e.getSchema(),t.typeCondition);if(n&&!Ct(n)){const n=ft(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=vr(e.getSchema(),t.type);if(void 0!==n&&!$t(n)){const n=t.variable.name.value,r=ft(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(Gt(Ut(n))){if(r){const i=t.name.value,o=Ge(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=Ge(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=He("to use an inline fragment on",e.hideSuggestions?[]:function(e,t,n){if(!Rt(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort(((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Ot(t)&&e.isSubType(t,n)?-1:Ot(n)&&e.isSubType(n,t)?1:Ze(t.name,n.name)})).map((e=>e.name))}(r,n,i));""===o&&(o=He(e.hideSuggestions?[]:function(e,t){if(Lt(e)||Ot(e)){return rt(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},Ir,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(Ct(n)&&Ct(r)&&!en(e.getSchema(),n,r)){const i=Ge(r),o=Ge(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=vr(e.getSchema(),n.typeCondition);if(Ct(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!en(e.getSchema(),r,i)){const o=Ge(i),s=Ge(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=oi(t.variableDefinitions??[],(e=>e.variable.name.value));for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map((e=>e.variable.name))}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map((e=>e.variable.name.value))),r=e.getRecursiveVariableUsages(t);for(const{node:i,fragmentVariableDefinition:o}of r){if(o)continue;const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{FragmentDefinition(t){const n=e.getVariableUsages(t),r=new Set(n.map((({node:e})=>e.name.value))),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(`Variable "$${i}" is never used in fragment "${t.name.value}".`,{nodes:n}))}},OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set;for(const{node:e,fragmentVariableDefinition:t}of n){const n=e.name.value;t||r.add(n)}const i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Sr,ai,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===On.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i}".`,{nodes:t}))),i&&t.name.value===kn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===d.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===w&&t.has(a.name.value)||a.kind===v&&a.operation===d.SUBSCRIPTION)&&(n.name.value===On.name?gr(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===kn.name&&(gr(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===On.name||n.name.value===kn.name){const r=n.arguments?.find((e=>"label"===e.name.value)),i=r?.value;if(!i)return;if(i.kind!==k)return void e.reportError(new GraphQLError(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===kn.name&&!(Dt(n.type)||Vt(n.type)&&Dt(n.type.ofType))&&e.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}},function(e){return{...Nr(e),FragmentArgument(t){const n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){const r=t.name.value,i=e.hideSuggestions?[]:rt(r,Array.from(n.variableDefinitions.values()).map((e=>e.variable.name.value)));e.reportError(new GraphQLError(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+He(i),{nodes:t}))}}},Argument(t){const n=e.getArgument(),r=e.getFieldDef();if(!n&&r){const n=t.name.value,i=e.hideSuggestions?[]:rt(n,r.args.map((e=>e.name)));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${r}".`+He(i),{nodes:t}))}}}},si,function(e){return{NullValue:t=>li(e,t,e.getInputType()),ListValue:t=>li(e,t,e.getParentInputType()),ObjectValue:t=>li(e,t,e.getInputType()),EnumValue:t=>li(e,t,e.getInputType()),IntValue:t=>li(e,t,e.getInputType()),FloatValue:t=>li(e,t,e.getInputType()),StringValue:t=>li(e,t,e.getInputType()),BooleanValue:t=>li(e,t,e.getInputType())}},function(e){return{...Pr(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const i of n.args)!r.has(i.name)&&Kt(i)&&e.reportError(new GraphQLError(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){const n=e.getFragmentSignature();if(!n)return!1;const r=new Set(t.arguments?.map((e=>e.name.value)));for(const[i,o]of n.variableDefinitions)if(!r.has(i)&&Br(o)){const n=Ge(vr(e.getSchema(),o.type));e.reportError(new GraphQLError(`Fragment "${t.name.value}" argument "${i}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,parentType:o,defaultValue:s,fragmentVariableDefinition:a}of r){const r=n.name.value;let c=a;if(c||(c=t.get(r)),c&&i){const t=e.getSchema(),a=vr(t,c.type);a&&!pi(t,a,c.defaultValue,i,s)&&e.reportError(new GraphQLError(`Variable "$${r}" of type "${a}" used in position expecting type "${i}".`,{nodes:[c,n]})),At(o)&&o.isOneOf&&jt(a)&&e.reportError(new GraphQLError(`Variable "$${r}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[c,n]}))}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new OrderedPairSet,n=new PairSet,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const s=[],[a,c]=Rr(e,t,i,o,void 0);if(function(e,t,n,r,i,o){for(const[s,a]of o.entries())if(a.length>1)for(let o=0;o0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(_t(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(ci(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=oi(n,(e=>e.name.value));for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map((e=>e.name))}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},wr,Sr,ai,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)Er(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=Ur[s.kind]:a&&(c=function(e){if(wt(e))return X;if(Lt(e))return Z;if(Ot(e))return ee;if(kt(e))return te;if(_t(e))return ne;if(At(e))return re;n(0,"Unexpected type: "+Ge(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case X:return"scalar";case Z:return"object";case ee:return"interface";case te:return"union";case ne:return"enum";case re:return"input object";default:n(0,"Unexpected kind: "+Ge(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=[...r.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+He(rt(o,n)),{nodes:i.name}))}}},Nr,si,ui,Pr]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===w&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===N?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r,i){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===w?e:void 0;lt(e,yr(r,{VariableDefinition:()=>!1,Variable(e){let t;if(i){const o=r.getFragmentSignatureByName()(i.name.value);t=o?.variableDefinitions.get(e.name.value),n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:t})}else n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}function mi(e,t,n=fi,r){!function(e){const t=er(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}(e);const i=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),o=[],s=new TypeInfo(e),a=new ValidationContext(e,t,s,(e=>{if(o.length>=100)throw i;o.push(e)}),!1),c=pt(n.map((e=>e(a))));try{lt(t,yr(s,c))}catch(e){if(e!==i)throw e;o.push(i)}return o}function vi(e,n){t(e)&&t(e.__schema)||xe(0,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${Ge(e)}.`);const r=e.__schema,i=new Map(r.types.map((e=>[e.name,f(e)])));for(const e of[...bn,...Hn])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map((function(e){if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=Ge(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===Jn.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===Jn.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(function(e){if(!jt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL nullable type.`);return e}(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${Ge(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!Lt(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Ot(e))throw new Error(`Expected ${Ge(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){switch(e.kind){case Jn.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case Jn.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>m(n)});case Jn.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>m(t)});case Jn.UNION:return function(e){if(null==e.possibleTypes){const t=Ge(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case Jn.ENUM:return function(e){if(null==e.enumValues){const t=Ge(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:Xe(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case Jn.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=Ge(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t,n,r;throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${Ge(e)}.`)}function h(e){if(null===e.interfaces&&e.kind===Jn.INTERFACE)return[];if(null==e.interfaces){const t=Ge(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function m(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${Ge(e)}.`);return Xe(e.fields,(e=>e.name),v)}function v(e){const t=u(e.type);if(!Ft(t)){const e=Ge(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=Ge(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return Xe(e,(e=>e.name),g)}function g(e){const t=u(e.type);if(!$t(t)){const e=Ge(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}return{description:e.description,type:t,default:null!=e.defaultValue?{literal:Ve(e.defaultValue)}:void 0,deprecationReason:e.deprecationReason}}}const yi={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function gi(e,t){const r=t({getNamedType:u,setNamedType:function(e){i.set(e.name,e)},getNamedTypes:function(){return Array.from(i.values())}}),i=new Map;for(const t of e.types){const e=t.name,n=l(t);n&&i.set(e,n)}const o=[];for(const t of e.directives){if(Fn(t)){o.push(t);continue}const e=m(t.toConfig());e&&o.push(new GraphQLDirective(e))}const s={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(i.values()),directives:o},a=r[yi.SCHEMA];return null==a?s:a(s);function c(e){return Dt(e)?new GraphQLList(c(e.ofType)):xt(e)?new GraphQLNonNull(c(e.ofType)):u(e.name)}function u(e){const t=Ti.get(e)??i.get(e);return void 0!==t||n(0,`Unknown type: "${e}".`),t}function l(e){return Wn(e)||Nn(e)?e:wt(e)?function(e){let t=e.toConfig();const n=r[yi.SCALAR];return t=null==n?t:n(t),new GraphQLScalarType(t)}(e):Lt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[yi.OBJECT];return n=null==i?n:i(n),new GraphQLObjectType(n)}(e):Ot(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map((e=>u(e.name))),fields:()=>p(t.fields,e.name)};const i=r[yi.INTERFACE];return n=null==i?n:i(n),new GraphQLInterfaceType(n)}(e):kt(e)?function(e){const t=e.toConfig();let n={...t,types:()=>t.types.map((e=>u(e.name)))};const i=r[yi.UNION];return n=null==i?n:i(n),new GraphQLUnionType(n)}(e):_t(e)?function(e){const t=e.toConfig();let n={...t,values:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.values)){const t=f(i,r,e.name);n[r]=t}return n}};const i=r[yi.ENUM];return n=null==i?n:i(n),new GraphQLEnumType(n)}(e):At(e)?function(e){const t=e.toConfig();let n={...t,fields:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.fields)){const t=h(i,r,e.name);n[r]=t}return n}};const i=r[yi.INPUT_OBJECT];return n=null==i?n:i(n),new GraphQLInputObjectType(n)}(e):void n(0,"Unexpected type: "+Ge(e))}function p(e,t){const n=Object.create(null);for(const[i,o]of Object.entries(e)){let e={...o,type:c(o.type),args:d(o.args,t,i)};const s=r[yi.FIELD];s&&(e=s(e,t)),n[i]=e}return n}function d(e,t,n){const i=Object.create(null);for(const[o,s]of Object.entries(e)){let e={...s,type:c(s.type)};const a=r[yi.ARGUMENT];a&&(e=a(e,t,n)),i[o]=e}return i}function f(e,t,n){const i={...e},o=r[yi.ENUM_VALUE];return null==o?i:o(i,t,n)}function h(e,t,n){const i={...e,type:c(e.type)},o=r[yi.INPUT_FIELD];return null==o?i:o(i,t,n)}function m(e){const t={...e,args:d(e.args,e.name,void 0)},n=r[yi.DIRECTIVE];return null==n?t:n(t)}}const Ti=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ei(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let h=!1;for(const e of t.definitions){switch(e.kind){case V:d=e;break;case W:f.push(e);break;case H:p.push(e);break;case M:case U:case J:case q:case K:case Y:i.push(e);break;case X:o.add(e.name.value,e);break;case Z:s.add(e.name.value,e);break;case ee:a.add(e.name.value,e);break;case te:c.add(e.name.value,e);break;case ne:u.add(e.name.value,e);break;case re:l.add(e.name.value,e);break;default:continue}h=!0}return h?gi(e,(e=>{const{getNamedType:t,setNamedType:h,getNamedTypes:m}=e;return{[yi.SCHEMA]:e=>{for(const e of i){const t=bi.get(e.name.value)??I(e);h(t)}const n={query:e.query&&t(e.query.name),mutation:e.mutation&&t(e.mutation.name),subscription:e.subscription&&t(e.subscription.name),...d&&v([d]),...v(f)};return{description:d?.description?.value??e.description,...n,types:m(),directives:[...e.directives,...p.map(T)],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1}},[yi.INPUT_OBJECT]:e=>{const t=l.get(e.name)??[];return{...e,fields:()=>({...e.fields(),...N(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.ENUM]:e=>{const t=u.get(e.name)??[];return{...e,values:()=>({...e.values(),...S(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.SCALAR]:e=>{const t=o.get(e.name)??[];let n=e.specifiedByURL;for(const e of t)n=Si(e)??n;return{...e,specifiedByURL:n,extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.OBJECT]:e=>{const t=s.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...w(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.INTERFACE]:e=>{const t=a.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...w(t)],fields:()=>({...e.fields(),...E(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[yi.UNION]:e=>{const t=c.get(e.name)??[];return{...e,types:()=>[...e.types(),...L(t)],extensionASTNodes:e.extensionASTNodes.concat(t)}}};function v(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=y(n.type)}return t}function y(e){const r=e.name.value,i=t(r);return void 0!==i||n(0,`Unknown type: "${r}".`),i}function g(e){return e.kind===C?new GraphQLList(g(e.type)):e.kind===R?new GraphQLNonNull(g(e.type)):y(e)}function T(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:b(e.arguments),astNode:e})}function E(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:g(n.type),description:n.description?.value,args:b(n.arguments),deprecationReason:Ni(n),astNode:n}}return t}function b(e){const t=e??[],n=Object.create(null);for(const e of t){const t=g(e.type);n[e.name.value]={type:t,description:e.description?.value,default:e.defaultValue&&{literal:e.defaultValue},deprecationReason:Ni(e),astNode:e}}return n}function N(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=g(n.type);t[n.name.value]={type:e,description:n.description?.value,default:n.defaultValue&&{literal:n.defaultValue},deprecationReason:Ni(n),astNode:n}}}return t}function S(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:Ni(n),astNode:n}}return t}function w(e){return e.flatMap((e=>e.interfaces?.map(y)??[]))}function L(e){return e.flatMap((e=>e.types?.map(y)??[]))}function I(e){const t=e.name.value;switch(e.kind){case U:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>w(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case J:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>w(r),fields:()=>E(r),astNode:e,extensionASTNodes:n})}case K:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:()=>S(r),astNode:e,extensionASTNodes:n})}case q:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>L(r),astNode:e,extensionASTNodes:n})}case M:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:Si(e),astNode:e,extensionASTNodes:n})}case Y:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>N(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(Xr(xn,n)))})}}var n}})):e}const bi=new Map([...bn,...Hn].map((e=>[e.name,e])));function Ni(e){const t=Xr(An,e);return t?.reason}function Si(e){const t=Xr(Dn,e);return t?.url}function wi(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[Ii(e),...i.map((e=>function(e){return $i(e)+`directive ${e}`+Ai(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...o.map((e=>function(e){if(wt(e))return function(e){return $i(e)+`scalar ${e}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${ft({kind:k,value:e.specifiedByURL})})`}(e)}(e);if(Lt(e))return function(e){return $i(e)+`type ${e}`+Oi(e)+ki(e)}(e);if(Ot(e))return function(e){return $i(e)+`interface ${e}`+Oi(e)+ki(e)}(e);if(kt(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return $i(e)+`union ${e.name}`+n}(e);if(_t(e))return function(e){const t=e.getValues().map(((e,t)=>$i(e," ",!t)+" "+e.name+xi(e.deprecationReason)));return $i(e)+`enum ${e}`+_i(t)}(e);if(At(e))return function(e){const t=Object.values(e.getFields()).map(((e,t)=>$i(e," ",!t)+" "+Di(e)));return $i(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+_i(t)}(e);n(0,"Unexpected type: "+Ge(e))}(e)))].filter(Boolean).join("\n\n")}(e,(e=>!Fn(e)),Li)}function Li(e){return!Nn(e)&&!Wn(e)}function Ii(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:$i(e)+"schema {\n"+(t?` query: ${t}\n`:"")+(n?` mutation: ${n}\n`:"")+(r?` subscription: ${r}\n`:"")+"}"}function Oi(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function ki(e){return _i(Object.values(e.getFields()).map(((e,t)=>$i(e," ",!t)+" "+e.name+Ai(e.args," ")+": "+String(e.type)+xi(e.deprecationReason))))}function _i(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function Ai(e,t=""){return 0===e.length?"":e.every((e=>null==e.description))?"("+e.map(Di).join(", ")+")":"(\n"+e.map(((e,n)=>$i(e," "+t,!n)+" "+t+Di(e))).join("\n")+"\n"+t+")"}function Di(e){let t=e.name+": "+String(e.type);const n=Cn(e);return n&&(t+=` = ${ft(n)}`),t+xi(e.deprecationReason)}function xi(e){if(null==e)return"";if(e!==_n){return` @deprecated(reason: ${ft({kind:k,value:e})})`}return" @deprecated"}function $i(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+ft({kind:k,value:r,block:de(r)}).replaceAll("\n","\n"+t)+"\n"}function Fi(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:m,definitions:t}}const Gi=[Ir];function Qi(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[Ci,Ri,Vi,ji,...n?[n]:[],...r?[r]:[],...fi.filter((e=>!Gi.includes(e)))]}function Ci(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function Ri(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function Vi(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==On.name&&null==t.typeCondition&&e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",{nodes:t}))}}}function ji(e){return{InlineFragment(t){var n;if(t.directives)for(const r of t.directives)r.name.value!=On.name||(null===(n=r.arguments)||void 0===n?void 0:n.find((e=>"label"==e.name.value)))||e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",{nodes:t}))}}}function Mi(e){return{kind:h,value:e}}function Ui(e){return{kind:k,value:e}}function Pi(e){return{kind:H,description:e.description?Ui(e.description):void 0,name:Mi(e.name),repeatable:!1,locations:e.locations.map((e=>Mi(e))),arguments:e.args.map((e=>function(e){return{kind:B,description:Ui(e.description),name:Mi(e.name),type:Bi(Ut(e.type))}}(e)))}}function Bi(e){return{kind:Q,name:Mi(e.name)}}function Ji(e){return{kind:R,type:e}}const qi={kind:H,description:Ui("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:Mi("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[Mi("QUERY"),Mi("MUTATION"),Mi("SUBSCRIPTION"),Mi("FRAGMENT_DEFINITION")]},Ki={kind:H,description:Ui("Attach extra information to a given type."),name:Mi("typePolicy"),arguments:[{kind:B,description:Ui("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),name:Mi("keyFields"),type:Ji(Bi(gn))}],repeatable:!1,locations:[Mi("OBJECT"),Mi("INTERFACE")]},zi={kind:H,description:Ui("A directive used by Apollo iOS to map query input data to cache keys of objects."),name:Mi("fieldPolicy"),arguments:[{kind:B,description:Ui("The field you are setting the @fieldPolicy for."),name:Mi("forField"),type:Ji(Bi(gn))},{kind:B,description:Ui("Set of fields used to compute the cache key."),name:Mi("keyArgs"),type:Ji(Bi(gn))}],repeatable:!0,locations:[Mi("OBJECT"),Mi("INTERFACE")]},Yi={kind:H,description:Ui("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),name:Mi("import"),arguments:[{kind:B,description:Ui("The name of the module to import."),name:Mi("module"),type:Ji(Bi(gn))}],repeatable:!0,locations:[Mi("QUERY"),Mi("MUTATION"),Mi("SUBSCRIPTION"),Mi("FRAGMENT_DEFINITION")]},Hi=[qi,Yi,Ki,zi];const Wi={kind:T,name:{kind:h,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map((e=>e.message)).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Xi(e){const t=function(e,t,n=hi){const r=[],i=new SDLValidationContext(e,t,(e=>{r.push(e)}));return lt(e,pt(n.map((e=>e(i))))),r}(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Zi(e){const t=er(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function eo(e){return e.startsWith("__")}function to(e){if(!e)return!1;for(const t of e)if(t.name.value==qi.name.value)return!0;return!1}const no={kind:T,name:{kind:h,value:"__typename"}};function ro(e,t){return t&&(e=function(e){return lt(e,{enter:e=>e.kind!==g?void 0:{...e,selections:e.selections.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)))},leave(e){if((e.kind===T||e.kind===w||e.kind===S)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[Wi,...e.selectionSet.selections]}}}})}(e)),lt(e,{SelectionSet:{leave:(e,t,n)=>p(n)&&![T,w].includes(n.kind)?e:function(e){const t=e.selections.find((e=>e.kind==no.kind&&e.name.value==no.name.value));return t?e:{...e,selections:[no,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==no.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){const t=[qi,Yi];for(const n of t)if(e.name.value==n.name.value)return null;return e}(e)}})}function io(e){return null!=e}function oo(e){switch(e.kind){case L:return{kind:e.kind,value:e.name.value};case x:return{kind:e.kind,value:e.values.map(oo)};case $:return{kind:e.kind,value:e.fields.reduce(((e,t)=>(e[t.name.value]=oo(t.value),e)),{})};default:return e}}function so(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function ao(e,t,n,r,i){var o,s,a;const c=new Map;for(const e of t.definitions)e.kind===w&&c.set(e.name.value,e);const u=[],l=new Map,p=new Set,d=r,f=e.getQueryType();if(void 0===f)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const h={queryType:f,mutationType:null!==(o=e.getMutationType())&&void 0!==o?o:void 0,subscriptionType:null!==(s=e.getSubscriptionType())&&void 0!==s?s:void 0};for(const e of t.definitions)e.kind===v&&u.push(g(e));for(const[e,t]of c.entries())l.set(e,E(t));return{rootTypes:h,operations:u,fragments:Array.from(l.values()),referencedTypes:Array.from(p.values()),schemaDocumentation:null!==(a=e.description)&&void 0!==a?a:void 0};function m(t){if(!p.has(t)){if(p.add(t),Ot(t)){const n=e.getPossibleTypes(t);t._implementingObjects=n;for(const e of n)d&&!y(e)||m(Ut(e))}if(kt(t)){const e=t.getTypes();for(t of e)m(Ut(t))}if(At(t)&&function(e){const t=e.getFields();for(const e in t){m(Ut(t[e].type))}}(t),Lt(t))for(const e of t.getInterfaces())m(Ut(e))}}function y(e){var t,n;const r=Ki.name.value;for(const i of null!==(n=null===(t=e.astNode)||void 0===t?void 0:t.directives)&&void 0!==n?n:[])if(i.name.value===r)return!0;return!1}function g(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=so(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map((t=>{const n=t.variable.name.value,r=t.defaultValue?oo(t.defaultValue):void 0,i=vr(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return m(Ut(i)),{name:n,type:i,defaultValue:r}})),u=ft(ro(t,n)),l=e.getRootType(s),[p]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(l);const d=I(t.selectionSet,l,a),f=Array.from(a.values());return to(t.directives)&&b(f),{name:o,operationType:s,variables:c,rootType:l,selectionSet:d,directives:p,referencedFragments:f,source:u,filePath:i}}function E(t){var r;const i=t.name.value,o=so(t),s=ft(ro(t,n)),a=new Set,c=vr(e,t.typeCondition),[u]=null!==(r=k(t.directives))&&void 0!==r?r:[void 0,void 0];m(Ut(c));const l=I(t.selectionSet,c,a),p=Array.from(a.values());return to(t.directives)&&b(p),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:l,directives:u,referencedFragments:p,overrideAsLocalCacheMutation:!1}}function b(e){e.forEach((e=>{e.overrideAsLocalCacheMutation=!0,b(e.referencedFragments)}))}function I(t,n,r){return{parentType:n,selections:t.selections.map((t=>function(t,n,r){var o,s,a,u;const[p,d]=null!==(o=k(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case T:{const f=t.name.value;if("__typename"==f)return;const h=null===(s=t.alias)||void 0===s?void 0:s.value,v=function(e,t,n){return n===Kn.name&&e.getQueryType()===t?Kn:n===zn.name&&e.getQueryType()===t?zn:n===Yn.name&&(Lt(t)||Ot(t)||kt(t))?Yn:Lt(t)||Ot(t)?t.getFields()[n]:void 0}(e,n,f);if(!v)throw new GraphQLError(`Cannot query field "${f}" on type "${String(n)}"`,{nodes:t});const y=v.type,g=Ut(v.type);m(Ut(g));const{description:b,deprecationReason:w}=v;let L={kind:"Field",name:f,alias:h,type:y,arguments:O(v,t.arguments),inclusionConditions:d,description:!eo(f)&&b?b:void 0,deprecationReason:w||void 0,directives:p,fieldPolicyKeys:v._apolloFieldPolicies||void 0};function _(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Dt(y)||xt(y)&&Dt(y.ofType)?_(t,null===(a=i.disallowedFieldNames)||void 0===a?void 0:a.entityList,i.schemaNamespace):Ct(g)&&_(t,null===(u=i.disallowedFieldNames)||void 0===u?void 0:u.entity,i.schemaNamespace),Ct(g)){const A=t.selectionSet;if(!A)throw new GraphQLError(`Composite field "${f}" on type "${String(n)}" requires selection set`,{nodes:t});L.selectionSet=I(A,g,r)}return L}case S:{const D=t.typeCondition,x=D?vr(e,D):n;return m(x),{kind:"InlineFragment",selectionSet:I(t.selectionSet,x,r),inclusionConditions:d,directives:p}}case N:{const $=t.name.value,F=function(e){let t=l.get(e);if(t)return t;const n=c.get(e);return n?(c.delete(e),t=E(n),l.set(e,t),t):void 0}($);if(!F)throw new GraphQLError(`Unknown fragment "${$}".`,{nodes:t.name});r.add(F);return{kind:"FragmentSpread",fragment:F,inclusionConditions:d,directives:p}}}}(t,n,r))).filter(io)}}function O(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map((e=>{var n;const r=e.name.value,i=t.find((t=>t.name===e.name.value)),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:oo(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}})):void 0}function k(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:O(o,i.arguments)});const s=A(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function A(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case _:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case L:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function co(e){return e.kind===H&&e.name.value===On.name}function uo(){return{kind:m,definitions:[Pi(On)]}}const lo=Ki.name.value;function po(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()}function fo(e){var t,n,r,i;if(kt(e))return;for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const t=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===lo));if(t)return{directive:t,source:e}}let o;for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])if(t.name.value===lo){o={directive:t,source:e};break}if("getInterfaces"in e)for(const t of e.getInterfaces()){const n=fo(t);if(n)if(o){if(!po(o.directive,n.directive))throw o.source===e?new GraphQLError(`Type "${e.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${n.source.name}".`,{nodes:e.astNode}):new GraphQLError(`Type "${e.name}" inherits conflicting @typePolicy directives from interfaces "${o.source.name}" and "${n.source.name}".`,{nodes:e.astNode})}else o=n}return o}function ho(e){var t,n,r;const i=fo(e);if(!i)return[];const o=null===(r=null===(n=null===(t=i.directive)||void 0===t?void 0:t.arguments)||void 0===n?void 0:n.find((e=>"keyFields"===e.name.value)))||void 0===r?void 0:r.value;if(!o||o.kind!==k)return[];const s=o.value.split(" ");return function(e,t){const{directive:n,source:r}=e;if(kt(r))return;const i=Ot(r)?"interface":"object";var o=r.getFields();for(const e of t){if(!e)throw new GraphQLError("Key fields must be a space-separated list of identifiers.",{nodes:n});const t=o[e];if(!t)throw new GraphQLError(`Key field "${e}" does not exist on ${i} "${r.name}".`,{nodes:r.astNode?[r.astNode,n]:n});if(!xt(t.type))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be non-nullable.`,{nodes:t.astNode?[t.astNode,n]:n});if(!wt(t.type.ofType))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be a scalar type, got ${t.type}.`,{nodes:t.astNode?[t.astNode,n]:n})}}(i,s),s}function mo(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&(n._apolloKeyFields=ho(n))}}const vo=zi.name.value;function yo(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&go(n)}}function go(e){var t,n,r,i,o,s;const a=To(e);if(!a||kt(e))return;const c=e.getFields();for(const l of a){const a=null===(n=null===(t=l.arguments)||void 0===t?void 0:t.find((e=>"forField"===e.name.value)))||void 0===n?void 0:n.value;let p;if((null==a?void 0:a.kind)===k&&(p=a.value),!p)throw new GraphQLError("@fieldPolicy directive must have a 'forField' value.",{nodes:l});const d=null===(i=null===(r=l.arguments)||void 0===r?void 0:r.find((e=>"keyArgs"===e.name.value)))||void 0===i?void 0:i.value;let f=[];if((null==d?void 0:d.kind)===k){const e=d.value.split(/\s+/);f=[...new Set(e.filter(Boolean))]}if(0===f.length)throw new GraphQLError("'keyArgs' must be a space-separated list of identifiers.",{nodes:l});const h=c[p];if(!h)throw new GraphQLError(`Field "${p}" does not exist on type "${e.name}".`,{nodes:e.astNode?[e.astNode,l]:l});const m=null===(o=h.astNode)||void 0===o?void 0:o.arguments,v=new Set(null!==(s=null==m?void 0:m.map((e=>e.name.value)))&&void 0!==s?s:[]);for(const e of f)if(!v.has(e))throw new GraphQLError(`@fieldPolicy key argument "${e}" does not exist as an input argument of field "${h.name}".`,{nodes:h.astNode});if(m){var u=0;const e=Dt(h.type);for(const e of m)"ListType"==e.type.kind&&(u+=1);if(u>1)throw new GraphQLError("@fieldPolicy can only have at most 1 List type input parameter.",{nodes:h.astNode});if(e&&1!=u||1==u&&!e)throw new GraphQLError("@fieldPolicy requires either both a List return type and 1 List input parameter, or neither.",{nodes:h.astNode})}h._apolloFieldPolicies=f}}function To(e){var t,n,r,i;if(!Lt(e)&&!Ot(e))return;const o=[];for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const e=null===(n=r.directives)||void 0===n?void 0:n.find((e=>e.name.value===vo));e&&o.push(e)}for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])t.name.value===vo&&o.push(t);if("getInterfaces"in e)for(const t of e.getInterfaces()){const e=To(t);if(e)for(const t of e){var s=!1;for(const e of o)if(Eo(e,t)){s=!0;break}s||o.push(t)}}return o}function Eo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map((e=>JSON.stringify([e.name.value,bt(e.value)]))).sort().toString()}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r,i){return ao(e,t,n,r,i)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(Re(r));var r=function(e){const t=Hi.filter((t=>!e.definitions.some((e=>e.kind==H&&e.name.value==t.name.value))));return Fi([e,{kind:m,definitions:t}])}(Fi(n));if(t){var i=function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=vi(t);return n}(t.body);return r=function(e,t){const n=e.getDirective(On.name);return n?function(e,t){return e.isRepeatable===t.isRepeatable&&e.locations.slice(0).sort().toString()===t.locations.slice(0).sort().toString()&&e.args.map((e=>e.name)).sort().toString()===t.args.map((e=>e.name)).sort().toString()}(n,On)?t:(console.warn(`Unsupported ${n.name} directive found. It will be replaced with a supported definition instead.`),Fi([t,uo()])):Fi([t,uo()])}(i,r),mo(i=function(e,t,n){Xn(e);const r=e.toConfig(),i=Ei(r,t,n);return r===i?e:new GraphQLSchema(i)}(i,r,{assumeValid:!0})),yo(i),Zi(i),i}{Xi(r=function(e){const t=e.definitions.find(co);if(!t)return Fi([e,uo()]);const n=t;if(!function(e,t){var n;return e.repeatable===t.isRepeatable&&e.locations.map((e=>e.value)).sort().toString()===t.locations.slice(0).sort().toString()&&(null===(n=e.arguments)||void 0===n?void 0:n.map((e=>e.name.value)).sort().toString())===t.args.map((e=>e.name)).sort().toString()}(n,On))return console.warn(`Unsupported ${n.name.value} directive found. It will be replaced with a supported definition instead.`),{kind:m,definitions:e.definitions.filter((e=>co(e)?void 0:e)).concat(Pi(On))};return e}(r));const e=function(e,t){const n=Ei({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...$n.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new GraphQLSchema({...n,directives:r})}(r,{assumeValid:!0});return mo(e),yo(e),Zi(e),e}},e.mergeDocuments=function(e){return Fi(e)},e.parseOperationDocument=function(e){return Re(e)},e.printSchemaToSDL=function(e){return wi(e)},e.validateDocument=function(e,t,n){return mi(e,t,Qi(n))},e}({});"# \ No newline at end of file +let ApolloCodegenFrontendBundle: String = #"var ApolloCodegenFrontend=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e}function n(e,t){throw new Error(t??"Unexpected invariant triggered.")}const r=/\r\n|[\n\r]/g;function i(e,t){let i=0,o=1;for(const s of e.body.matchAll(r)){if("number"==typeof s.index||n(),s.index>=t)break;i=s.index+s[0].length,o+=1}return{line:o,column:t+1-i}}function o(e){return s(e.source,i(e.source,e.start))}function s(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,c=1===t.line?n:0,u=t.column+c,l=`${e.name}:${s}:${u}\n`,p=r.split(/\r\n|[\n\r]/g),d=p[i];if(d.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return l+a([[s-1+" |",p[i-1]],[`${s} |`,d],["|","^".padStart(u)],[`${s+1} |`,p[i+1]]])}function a(e){const t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}class GraphQLError extends Error{constructor(e,n={}){const{nodes:r,source:o,positions:s,path:a,originalError:u,extensions:l}=n;super(e),this.name="GraphQLError",this.path=a??void 0,this.originalError=u??void 0,this.nodes=c(Array.isArray(r)?r:r?[r]:void 0);const p=c(this.nodes?.map(e=>e.loc).filter(e=>null!=e));this.source=o??p?.[0]?.source,this.positions=s??p?.map(e=>e.start),this.locations=s&&o?s.map(e=>i(o,e)):p?.map(e=>i(e.source,e.start));const d=t(u?.extensions)?u?.extensions:void 0;this.extensions=l??d??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u?.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+o(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+s(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function c(e){return void 0===e||0===e.length?void 0:e}function u(e,t,n){return new GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Location{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Token{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const l={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},p=new Set(Object.keys(l));function d(e){const t=e?.kind;return"string"==typeof t&&p.has(t)}const f={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"},h={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION"},m="Name",v="Document",y="OperationDefinition",g="VariableDefinition",T="SelectionSet",b="Field",E="Argument",N="FragmentArgument",w="FragmentSpread",S="InlineFragment",I="FragmentDefinition",L="Variable",k="IntValue",O="FloatValue",_="StringValue",x="BooleanValue",D="NullValue",$="EnumValue",A="ListValue",G="ObjectValue",F="ObjectField",Q="Directive",V="NamedType",C="ListType",j="NonNullType",R="SchemaDefinition",M="OperationTypeDefinition",U="ScalarTypeDefinition",P="ObjectTypeDefinition",B="FieldDefinition",q="InputValueDefinition",J="InterfaceTypeDefinition",K="UnionTypeDefinition",z="EnumTypeDefinition",Y="EnumValueDefinition",H="InputObjectTypeDefinition",W="DirectiveDefinition",X="SchemaExtension",Z="ScalarTypeExtension",ee="ObjectTypeExtension",te="InterfaceTypeExtension",ne="UnionTypeExtension",re="EnumTypeExtension",ie="InputObjectTypeExtension";var oe=Object.freeze({__proto__:null,ARGUMENT:E,BOOLEAN:x,DIRECTIVE:Q,DIRECTIVE_DEFINITION:W,DOCUMENT:v,ENUM:$,ENUM_TYPE_DEFINITION:z,ENUM_TYPE_EXTENSION:re,ENUM_VALUE_DEFINITION:Y,FIELD:b,FIELD_DEFINITION:B,FLOAT:O,FRAGMENT_ARGUMENT:N,FRAGMENT_DEFINITION:I,FRAGMENT_SPREAD:w,INLINE_FRAGMENT:S,INPUT_OBJECT_TYPE_DEFINITION:H,INPUT_OBJECT_TYPE_EXTENSION:ie,INPUT_VALUE_DEFINITION:q,INT:k,INTERFACE_TYPE_DEFINITION:J,INTERFACE_TYPE_EXTENSION:te,LIST:A,LIST_TYPE:C,NAME:m,NAMED_TYPE:V,NON_NULL_TYPE:j,NULL:D,OBJECT:G,OBJECT_FIELD:F,OBJECT_TYPE_DEFINITION:P,OBJECT_TYPE_EXTENSION:ee,OPERATION_DEFINITION:y,OPERATION_TYPE_DEFINITION:M,SCALAR_TYPE_DEFINITION:U,SCALAR_TYPE_EXTENSION:Z,SCHEMA_DEFINITION:R,SCHEMA_EXTENSION:X,SELECTION_SET:T,STRING:_,UNION_TYPE_DEFINITION:K,UNION_TYPE_EXTENSION:ne,VARIABLE:L,VARIABLE_DEFINITION:g});function se(e){return 9===e||32===e}function ae(e){return e>=48&&e<=57}function ce(e){return e>=97&&e<=122||e>=65&&e<=90}function ue(e){return ce(e)||95===e}function le(e){return ce(e)||ae(e)||95===e}function pe(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i0===n?e:e.slice(t)).slice(n??0,r+1)}function de(e){let t=0;for(;t=0&&e<=55295||e>=57344&&e<=1114111}function Ve(e,t){return Ce(e.charCodeAt(t))&&je(e.charCodeAt(t+1))}function Ce(e){return e>=55296&&e<=56319}function je(e){return e>=56320&&e<=57343}function Re(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return me;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Me(e,t,n,r,i){const o=e.line,s=1+n-e.lineStart;return new Token(t,n,r,o,s,i)}function Ue(e,t){const n=e.source.body,r=n.length;let i=t;for(;i=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function We(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw u(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Xe(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,s=o,a="";const c=[];for(;o2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map(([e,n])=>e+": "+nt(n,t));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const rt=null!=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){const n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){const t=tt(e);throw new Error(`Cannot use ${n} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class Source{constructor(e,t="GraphQL request",n={line:1,column:1}){this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||et(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||et(0,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function it(e,t){const n=new Parser(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function ot(e,t){const n=new Parser(e,t);n.expectToken(he);const r=n.parseConstValueLiteral();return n.expectToken(me),r}class Parser{constructor(e,t={}){const n=function(e){return rt(e,Source)}(e)?e:new Source(e);this._lexer=new Lexer(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(xe);return this.node(e,{kind:m,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:v,definitions:this.many(he,this.parseDefinition,me)})}parseDefinition(){if(this.peek(ke))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===xe){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw u(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(ke))return this.node(e,{kind:y,operation:f.QUERY,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(xe)&&(n=this.parseName()),this.node(e,{kind:y,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(xe);switch(e.value){case"query":return f.QUERY;case"mutation":return f.MUTATION;case"subscription":return f.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Te,this.parseVariableDefinition,be)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:g,variable:this.parseVariable(),type:(this.expectToken(Ne),this.parseTypeReference()),defaultValue:this.expectOptionalToken(we)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(ye),this.node(e,{kind:L,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:T,selections:this.many(ke,this.parseSelection,_e)})}parseSelection(){return this.peek(Ee)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Ne)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:b,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ke)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Te,t,be)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(Te,e,be)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ne),this.node(t,{kind:E,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(Ne),this.node(e,{kind:N,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(Ee);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(xe)){const t=this.parseFragmentName();return this.peek(Te)&&this._options.experimentalFragmentArguments?this.node(e,{kind:w,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:w,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:S,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:I,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:I,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Ie:return this.parseList(e);case ke:return this.parseObject(e);case De:return this.advanceLexer(),this.node(t,{kind:k,value:t.value});case $e:return this.advanceLexer(),this.node(t,{kind:O,value:t.value});case Ae:case Ge:return this.parseStringLiteral();case xe:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:x,value:!0});case"false":return this.node(t,{kind:x,value:!1});case"null":return this.node(t,{kind:D});default:return this.node(t,{kind:$,value:t.value})}case ye:if(e){if(this.expectToken(ye),this._lexer.token.kind===xe){const e=this._lexer.token.value;throw u(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:_,value:e.value,block:e.kind===Ge})}parseList(e){return this.node(this._lexer.token,{kind:A,values:this.any(Ie,()=>this.parseValueLiteral(e),Le)})}parseObject(e){return this.node(this._lexer.token,{kind:G,fields:this.any(ke,()=>this.parseObjectField(e),_e)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ne),this.node(t,{kind:F,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Se);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Se),this.node(t,{kind:Q,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Ie)){const n=this.parseTypeReference();this.expectToken(Le),t=this.node(e,{kind:C,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(ve)?this.node(e,{kind:j,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:V,name:this.parseName()})}peekDescription(){return this.peek(Ae)||this.peek(Ge)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(ke,this.parseOperationTypeDefinition,_e);return this.node(e,{kind:R,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Ne);const n=this.parseNamedType();return this.node(e,{kind:M,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:U,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:P,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(ge,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(ke,this.parseFieldDefinition,_e)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Ne);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:B,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Te,this.parseInputValueDef,be)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Ne);const r=this.parseTypeReference();let i;this.expectOptionalToken(we)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:q,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:J,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:K,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(we)?this.delimitedMany(Oe,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:z,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(ke,this.parseEnumValueDefinition,_e)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Y,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw u(this._lexer.source,this._lexer.token.start,`${st(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:H,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(ke,this.parseInputValueDef,_e)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===xe)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(ke,this.parseOperationTypeDefinition,_e);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:X,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:Z,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ee,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:te,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ne,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:re,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ie,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Se);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:W,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Oe,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(h,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw u(this._lexer.source,t.start,`Expected ${at(e)}, found ${st(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==xe||t.value!==e)throw u(this._lexer.source,t.start,`Expected "${e}", found ${st(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===xe&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return u(this._lexer.source,t.start,`Unexpected ${st(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==me&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw u(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}}function st(e){const t=e.value;return at(e.kind)+(null!=t?` "${t}"`:"")}function at(e){return function(e){return e===ve||e===ye||e===ge||e===Te||e===be||e===Ee||e===Ne||e===we||e===Se||e===Ie||e===Le||e===ke||e===Oe||e===_e}(e)?`"${e}"`:e}class AccumulatorMap extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(e,t){const n=this.get(e);void 0===n?this.set(e,[t]):n.push(t)}}function ct(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function ut(e){return lt("and",e)}function lt(e,t){switch(0!==t.length||n(),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}const r=t.slice(0,-1),i=t.at(-1);return r.join(", ")+", "+e+" "+i}function pt(e){return"object"==typeof e&&"function"==typeof e?.[Symbol.iterator]}function dt(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function ft(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function ht(e){return 0===e.length?"":` at ${e.map(e=>"number"==typeof e?`[${e}]`:`.${e}`).join("")}`}function mt(e,t){const[n,r]=t?[e,t]:[void 0,e];if(0===r.length)return"";let i=" Did you mean ";null!=n&&(i+=n+" ");return i+lt("or",r.slice(0,5).map(e=>`"${e}"`))+"?"}function vt(e){return e}function yt(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function gt(e,t){let n=0,r=0;for(;n0);let a=0;do{++r,a=10*a+o-Tt,o=t.charCodeAt(r)}while(Et(o)&&a>0);if(sa)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}const Tt=48,bt=57;function Et(e){return!isNaN(e)&&Tt<=e&&e<=bt}function Nt(e,t){const n=Object.create(null),r=new LexicalDistance(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{const r=n[e]-n[t];return 0!==r?r:gt(e,t)})}class LexicalDistance{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=wt(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=wt(n),i=this._inputArray;if(r.lengtht)return;const a=this._rows;for(let e=0;e<=s;e++)a[0][e]=e;for(let e=1;e<=o;e++){const n=a[(e-1)%3],o=a[e%3];let c=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=a[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const c=a[o%3][s];return c<=t?c:void 0}}function wt(e){const t=e.length,n=new Array(t);for(let r=0;re.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Gt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Qt("(",Gt(e.variableDefinitions,", "),")"),n=Gt([e.operation,Gt([e.name,t]),Gt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Qt(" = ",n)+Qt(" ",Gt(r," "))},SelectionSet:{leave:({selections:e})=>Ft(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=Gt([Qt("",e,": "),t],"");return Gt([jt(o,n),Qt(" ",Gt(r," ")),Qt(" ",i)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>jt("..."+e,t)+Qt(" ",Gt(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Gt(["...",Qt("on ",e),Gt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Qt("(",Gt(n,", "),")")} on ${t} ${Qt("",Gt(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every(e=>0===e.length||se(e.charCodeAt(0))),o=t.endsWith('\\"""'),s=e.endsWith('"')&&!o,a=e.endsWith("\\"),c=s||a,u=!r||e.length>70||c||i||o;let l="";const p=r&&se(e.charCodeAt(0));return(u&&!p||i)&&(l+="\n"),l+=t,(u||c)&&(l+="\n"),'"""'+l+'"""'}(e):`"${e.replace(It,Lt)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+Gt(e,", ")+"]";return t.length>80?"[\n"+Vt(Gt(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+Gt(e,", ")+" }";return t.length>80?Ft(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Qt("(",Gt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Qt("",e,"\n")+Gt(["schema",Gt(t," "),Ft(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Qt("",e,"\n")+Gt(["scalar",t,Gt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qt("",e,"\n")+Gt(["type",t,Qt("implements ",Gt(n," & ")),Gt(r," "),Ft(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Qt("",e,"\n")+t+(Ct(n)?Qt("(\n",Vt(Gt(n,"\n")),"\n)"):Qt("(",Gt(n,", "),")"))+": "+r+Qt(" ",Gt(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Qt("",e,"\n")+Gt([t+": "+n,Qt("= ",r),Gt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Qt("",e,"\n")+Gt(["interface",t,Qt("implements ",Gt(n," & ")),Gt(r," "),Ft(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Qt("",e,"\n")+Gt(["union",t,Gt(n," "),Qt("= ",Gt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Qt("",e,"\n")+Gt(["enum",t,Gt(n," "),Ft(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Qt("",e,"\n")+Gt([t,Gt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Qt("",e,"\n")+Gt(["input",t,Gt(n," "),Ft(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Qt("",e,"\n")+"directive @"+t+(Ct(n)?Qt("(\n",Vt(Gt(n,"\n")),"\n)"):Qt("(",Gt(n,", "),")"))+(r?" repeatable":"")+" on "+Gt(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Gt(["extend schema",Gt(e," "),Ft(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Gt(["extend scalar",e,Gt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Gt(["extend type",e,Qt("implements ",Gt(t," & ")),Gt(n," "),Ft(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Gt(["extend interface",e,Qt("implements ",Gt(t," & ")),Gt(n," "),Ft(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Gt(["extend union",e,Gt(t," "),Qt("= ",Gt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Gt(["extend enum",e,Gt(t," "),Ft(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Gt(["extend input",e,Gt(t," "),Ft(n)]," ")}};function Gt(e,t=""){return e?.filter(e=>e).join(t)??""}function Ft(e){return Qt("{\n",Vt(Gt(e,"\n")),"\n}")}function Qt(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Vt(e){return Qt(" ",e.replaceAll("\n","\n "))}function Ct(e){return e?.some(e=>e.includes("\n"))??!1}function jt(e,t){let n=e+Qt("(",Gt(t,", "),")");return n.length>80&&(n=e+Qt("(\n",Vt(Gt(t,"\n")),"\n)")),n}function Rt(e,t){switch(e.kind){case D:return null;case k:return parseInt(e.value,10);case O:return parseFloat(e.value);case _:case $:case x:return e.value;case A:return e.values.map(e=>Rt(e,t));case G:return yt(e.fields,e=>e.name.value,e=>Rt(e.value,t));case L:return t?.[e.name.value]}}function Mt(e){if(0===e.length)throw new GraphQLError("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(Rt(e,t))),this.coerceOutputValue=e.coerceOutputValue??this.serialize,this.coerceInputValue=e.coerceInputValue??this.parseValue,this.coerceInputLiteral=e.coerceInputLiteral,this.valueToLiteral=e.valueToLiteral,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||et(0,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),e.coerceInputLiteral&&("function"==typeof e.coerceInputValue&&"function"==typeof e.coerceInputLiteral||et(0,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=fn.bind(void 0,this,e.fields),this._interfaces=dn.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ft(this.getFields(),e=>e.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function dn(e){return ln(e??[])}function fn(e,t){return ft(pn(t),(t,n)=>new GraphQLField(e,n,t))}class GraphQLField{constructor(e,t,n){this.parentType=e,this.name=Mt(t),this.description=n.description,this.type=n.type;const r=n.args;this.args=r?Object.entries(r).map(([e,t])=>new GraphQLArgument(this,e,t)):[],this.resolve=n.resolve,this.subscribe=n.subscribe,this.deprecationReason=n.deprecationReason,this.extensions=St(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:yt(this.args,e=>e.name,e=>e.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}}class GraphQLArgument{constructor(e,t,n){this.parent=e,this.name=Mt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=St(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}}function hn(e){return Wt(e.type)&&void 0===e.default&&void 0===e.defaultValue}class GraphQLInterfaceType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=fn.bind(void 0,this,e.fields),this._interfaces=dn.bind(void 0,e.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ft(this.getFields(),e=>e.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=mn.bind(void 0,e.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function mn(e){return ln(e)}class GraphQLEnumType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values="function"==typeof e.values?e.values:Object.entries(e.values).map(([e,t])=>new GraphQLEnumValue(this,e,t)),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Object.entries(this._values()).map(([e,t])=>new GraphQLEnumValue(this,e,t))),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=dt(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){return this.coerceOutputValue(e)}coerceOutputValue(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));const t=this._valueLookup.get(e);if(void 0===t)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${tt(e)}`);return t.name}parseValue(e,t){return this.coerceInputValue(e,t)}coerceInputValue(e,t){if("string"!=typeof e){const n=tt(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+(t?"":vn(this,n)))}const n=this.getValue(e);if(null==n)throw new GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+(t?"":vn(this,e)));return n.value}parseLiteral(e,t,n){return this.coerceInputLiteral(e,n)}coerceInputLiteral(e,t){if(e.kind!==$){const n=$t(e);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+(t?"":vn(this,n)),{nodes:e})}const n=this.getValue(e.value);if(null==n){const n=$t(e);throw new GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+(t?"":vn(this,n)),{nodes:e})}return n.value}valueToLiteral(e){if("string"==typeof e&&this.getValue(e))return{kind:$,value:e}}toConfig(){return{name:this.name,description:this.description,values:yt(this.getValues(),e=>e.name,e=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function vn(e,t){return mt("the enum value",Nt(t,e.getValues().map(e=>e.name)))}class GraphQLEnumValue{constructor(e,t,n){this.parentEnum=e,this.name=function(e){if("true"===e||"false"===e||"null"===e)throw new GraphQLError(`Enum values cannot be named: ${e}`);return Mt(e)}(t),this.description=n.description,this.value=void 0!==n.value?n.value:t,this.deprecationReason=n.deprecationReason,this.extensions=St(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}}class GraphQLInputObjectType{constructor(e){this.name=Mt(e.name),this.description=e.description,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=yn.bind(void 0,this,e.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:ft(this.getFields(),e=>e.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function yn(e,t){return ft(pn(t),(t,n)=>new GraphQLInputField(e,n,t))}class GraphQLInputField{constructor(e,t,n){!("resolve"in n)||et(0,`${e}.${t} field has a resolve property, but Input Types cannot define resolvers.`),this.parentType=e,this.name=Mt(t),this.description=n.description,this.type=n.type,this.defaultValue=n.defaultValue,this.default=n.default,this.deprecationReason=n.deprecationReason,this.extensions=St(n.extensions),this.astNode=n.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}}function gn(e){return Wt(e.type)&&void 0===e.defaultValue&&void 0===e.default}function Tn(e,t){return e===t||(Wt(e)&&Wt(t)||!(!Ht(e)||!Ht(t)))&&Tn(e.ofType,t.ofType)}function bn(e,t,n){return t===n||(Wt(n)?!!Wt(t)&&bn(e,t.ofType,n.ofType):Wt(t)?bn(e,t.ofType,n):Ht(n)?!!Ht(t)&&bn(e,t.ofType,n.ofType):!Ht(t)&&(rn(n)&&(Jt(t)||Bt(t))&&e.isSubType(n,t)))}function En(e,t,n){return t===n||(rn(t)?rn(n)?e.getPossibleTypes(t).some(t=>e.isSubType(n,t)):e.isSubType(t,n):!!rn(n)&&e.isSubType(n,t))}function Nn(e,t,n){return{prev:e,key:t,typename:n}}function wn(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Sn(e,n){if(Wt(n)){if(null==e)return;return Sn(e,n.ofType)}if(null==e)return{kind:D};if(Ht(n)){if(!pt(e))return Sn(e,n.ofType);const t=[];for(const r of e){const e=Sn(r,n.ofType);if(!e)return;t.push(e)}return{kind:A,values:t}}if(Yt(n)){if(!t(e))return;const r=[],i=n.getFields();if(Object.keys(e).some(e=>!Object.hasOwn(i,e)))return;for(const t of Object.values(n.getFields())){if(void 0===e[t.name]){if(gn(t))return}else{const n=Sn(e[t.name],t.type);if(!n)return;r.push({kind:F,name:{kind:m,value:t.name},value:n})}}return{kind:G,fields:r}}const r=tn(n);if(r.valueToLiteral)try{return r.valueToLiteral(e)}catch(e){return}return In(e)}function In(e){if(null==e)return{kind:D};switch(typeof e){case"boolean":return{kind:x,value:e};case"string":return{kind:_,value:e,block:!1};case"number":{if(!Number.isFinite(e))return{kind:D};const t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:k,value:t}:{kind:O,value:t}}case"object":{if(pt(e))return{kind:A,values:Array.from(e,In)};const t=e,n=[];for(const e of Object.keys(t)){const r=t[e];void 0!==r&&n.push({kind:F,name:{kind:m,value:e},value:In(r)})}return{kind:G,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${tt(e)}.`)}function Ln(e,t,n){switch(e.kind){case L:{const r=e.name.value,i=n?.sources[r];if(i){const e=i.value;if(void 0===e){const e=i.signature.default;return void 0!==e?e.literal:{kind:D}}return Ln(e,t,i.fragmentVariableValues)}const o=t?.sources[r];if(null==o)return{kind:D};if(void 0===o.value){const e=o.signature.default;if(void 0!==e)return e.literal}return Sn(o.value,o.signature.type)}case G:{const r=[];for(const i of e.fields){if(i.value.kind===L){const e=n?.sources[i.value.name.value]??t?.sources[i.value.name.value];if(void 0===e?.value&&void 0===e?.signature.default)continue}const e=Ln(i.value,t,n);r.push({...i,value:e})}return{...e,fields:r}}case A:{const r=[];for(const i of e.values){const e=Ln(i,t,n);r.push(e)}return{...e,values:r}}default:return e}}function kn(e,t,n,r){return On(e,t,n,r,void 0)}function On(e,n,r,i,o){if(Wt(n))return void 0===e?void _n(r,`Expected a value of non-null type "${n}" to be provided.`,o):null===e?void _n(r,`Expected value of non-null type "${n}" not to be null.`,o):On(e,n.ofType,r,i,o);if(null!=e)if(Ht(n))if(pt(e)){let t=0;for(const s of e)On(s,n.ofType,r,i,Nn(o,t++,void 0))}else On(e,n.ofType,r,i,o);else if(Yt(n)){if(!t(e)||Array.isArray(e))return void _n(r,`Expected value of type "${n}" to be an object, found: ${tt(e)}.`,o);const s=n.getFields();for(const t of Object.values(s)){const s=e[t.name];void 0===s?gn(t)&&_n(r,`Expected value of type "${n}" to include required field "${t.name}", found: ${tt(e)}.`,o):On(s,t.type,r,i,Nn(o,t.name,n.name))}const a=Object.keys(e);for(const t of a)if(!Object.hasOwn(s,t)){const i=mt(Nt(t,Object.keys(s)));_n(r,`Expected value of type "${n}" not to include unknown field "${t}"${i?`.${i} Found`:", found"}: ${tt(e)}.`,o)}if(n.isOneOf){1!==a.length&&_n(r,`Exactly one key must be specified for OneOf type "${n}".`,o);const t=a[0];null===e[t]&&_n(r,`Field "${t}" for OneOf type "${n}" must be non-null.`,o)}}else{let t,s;tn(n);try{t=n.coerceInputValue(e,i)}catch(e){if(e instanceof GraphQLError)return void r(e,wn(o));s=e}void 0===t&&_n(r,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${tt(e)}.`,o,s)}}function _n(e,t,n,r){e(new GraphQLError(t,{originalError:r}),wn(n))}function xn(e,t,n,r,i,o){return Dn({static:!r&&!i,onError:n,variables:r,fragmentVariableValues:i},e,t,o,void 0)}function Dn(e,t,n,r,i){if(t.kind===L){if(e.static)return;const r=$n(e,t),o=r?.coerced[t.name.value];return void(Wt(n)&&(void 0===o?An(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,i):null===o&&An(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,i)))}if(Wt(n))return t.kind===D?void An(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,i):Dn(e,t,n.ofType,r,i);if(t.kind!==D)if(Ht(n))if(t.kind!==A)Dn(e,t,n.ofType,r,i);else{let o=0;for(const s of t.values)Dn(e,s,n.ofType,r,Nn(i,o++,void 0))}else if(Yt(n)){if(t.kind!==G)return void An(e.onError,`Expected value of type "${n}" to be an object, found: ${$t(t)}.`,t,i);const o=n.getFields(),s=dt(t.fields,e=>e.name.value);for(const a of Object.values(o)){const o=s[a.name];if(void 0===o)gn(a)&&An(e.onError,`Expected value of type "${n}" to include required field "${a.name}", found: ${$t(t)}.`,t,i);else{const s=o.value;if(s.kind===L&&!e.static){const r=$n(e,s),o=s.name.value,c=r?.coerced[o];if(n.isOneOf)void 0===c?An(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,i):null===c&&An(e.onError,`Expected variable "$${o}" provided to field "${a.name}" for OneOf Input Object type "${n}" not to be null.`,t,i);else if(void 0===c&&!gn(a))continue}Dn(e,s,a.type,r,Nn(i,a.name,n.name))}}const a=t.fields;for(const s of a){const a=s.name.value;if(!Object.hasOwn(o,a)){const c=r?"":mt(Nt(a,Object.keys(o)));An(e.onError,`Expected value of type "${n}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${$t(t)}.`,s,i)}}if(n.isOneOf){if(1!==a.length)return void An(e.onError,`OneOf Input Object "${n}" must specify exactly one key.`,t,i);if(a[0].value.kind===D){const r=a[0].name.value;An(e.onError,`Field "${n}.${r}" used for OneOf Input Object must be non-null.`,t,Nn(i,r,void 0))}}}else{let o,s;tn(n);try{o=n.coerceInputLiteral?n.coerceInputLiteral(Ln(t,e.variables,e.fragmentVariableValues),r):n.parseLiteral(t,void 0,r)}catch(t){if(t instanceof GraphQLError)return void e.onError(t,wn(i));s=t}void 0===o&&An(e.onError,`Expected value of type "${n}"${null!=s?`, but encountered error "${null!=s.message&&""!==s.message?s.message:s}"; found`:", found"}: ${$t(t)}.`,t,i,s)}}function $n(e,t){const n=t.name.value,{fragmentVariableValues:r,variables:i}=e;return r?.sources[n]?r:i}function An(e,t,n,r,i){e(new GraphQLError(t,{nodes:n,originalError:i}),wn(r))}const Gn=2147483647,Fn=-2147483648,Qn=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){const t=Pn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new GraphQLError(`Int cannot represent non-integer value: ${tt(t)}`);if(n>Gn||nGn||eGn||t=Fn)return{kind:k,value:String(e)}}}),Vn=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){const t=Pn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new GraphQLError(`Float cannot represent non numeric value: ${tt(t)}`);return n},coerceInputValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new GraphQLError(`Float cannot represent non numeric value: ${tt(e)}`);return e},coerceInputLiteral(e){if(e.kind!==O&&e.kind!==k)throw new GraphQLError(`Float cannot represent non numeric value: ${$t(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){const t=In(e);if(t.kind===O||t.kind===k)return t}}),Cn=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){const t=Pn(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new GraphQLError(`String cannot represent value: ${tt(e)}`)},coerceInputValue(e){if("string"!=typeof e)throw new GraphQLError(`String cannot represent a non string value: ${tt(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_)throw new GraphQLError(`String cannot represent a non string value: ${$t(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=In(e);if(t.kind===_)return t}}),jn=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){const t=Pn(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${tt(t)}`)},coerceInputValue(e){if("boolean"!=typeof e)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${tt(e)}`);return e},coerceInputLiteral(e){if(e.kind!==x)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${$t(e)}`,{nodes:e});return e.value},valueToLiteral(e){const t=In(e);if(t.kind===x)return t}}),Rn=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){const t=Pn(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new GraphQLError(`ID cannot represent value: ${tt(e)}`)},coerceInputValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new GraphQLError(`ID cannot represent value: ${tt(e)}`)},coerceInputLiteral(e){if(e.kind!==_&&e.kind!==k)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+$t(e),{nodes:e});return e.value},valueToLiteral(e){const t=Number.isInteger(e)?String(e):e;if("string"==typeof t)return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:k,value:t}:{kind:_,value:t,block:!1}}}),Mn=Object.freeze([Cn,Qn,Vn,jn,Rn]);function Un(e){return Mn.some(({name:t})=>e.name===t)}function Pn(e){if(t(e)){if("function"==typeof e.valueOf){const n=e.valueOf();if(!t(n))return n}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Bn(e){return rt(e,GraphQLDirective)}class GraphQLDirective{constructor(e){this.name=Mt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=St(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||et(0,`@${this.name} locations must be an Array.`);const n=e.args??{};t(n)&&!Array.isArray(n)||et(0,`@${this.name} args must be an object with argument names as keys.`),this.args=Object.entries(n).map(([e,t])=>new GraphQLArgument(this,e,t))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:yt(this.args,e=>e.name,e=>e.toConfig()),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const qn=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[h.FIELD,h.FRAGMENT_SPREAD,h.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(jn),description:"Included when true."}}}),Jn=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[h.FIELD,h.FRAGMENT_SPREAD,h.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(jn),description:"Skipped when true."}}}),Kn=new GraphQLDirective({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[h.FRAGMENT_SPREAD,h.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(jn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:Cn,description:"Unique name"}}}),zn=new GraphQLDirective({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[h.FIELD],args:{initialCount:{default:{value:0},type:new GraphQLNonNull(Qn),description:"Number of items to return immediately"},if:{type:new GraphQLNonNull(jn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:Cn,description:"Unique name"}}}),Yn="No longer supported",Hn=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[h.FIELD_DEFINITION,h.ARGUMENT_DEFINITION,h.INPUT_FIELD_DEFINITION,h.ENUM_VALUE],args:{reason:{type:new GraphQLNonNull(Cn),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:Yn}}}}),Wn=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[h.SCALAR],args:{url:{type:new GraphQLNonNull(Cn),description:"The URL that specifies the behavior of this scalar."}}}),Xn=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[h.INPUT_OBJECT],args:{}});new GraphQLDirective({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[h.QUERY,h.MUTATION,h.SUBSCRIPTION]});const Zn=Object.freeze([qn,Jn,Hn,Wn,Xn]);function er(e){return Zn.some(({name:t})=>t===e.name)}function tr(e,r){if(Wt(r)){const t=tr(e,r.ofType);return t?.kind===D?null:t}if(null===e)return{kind:D};if(void 0===e)return null;if(Ht(r)){const t=r.ofType;if(pt(e)){const n=[];for(const r of e){const e=tr(r,t);null!=e&&n.push(e)}return{kind:A,values:n}}return tr(e,t)}if(Yt(r)){if(!t(e))return null;const n=[];for(const t of Object.values(r.getFields())){const r=tr(e[t.name],t.type);r&&n.push({kind:F,name:{kind:m,value:t.name},value:r})}return{kind:G,fields:n}}if(en(r)){const t=r.coerceOutputValue(e);if(null==t)return null;if("boolean"==typeof t)return{kind:x,value:t};if("number"==typeof t&&Number.isFinite(t)){const e=String(t);return nr.test(e)?{kind:k,value:e}:{kind:O,value:e}}if("string"==typeof t)return zt(r)?{kind:$,value:t}:r===Rn&&nr.test(t)?{kind:k,value:t}:{kind:_,value:t};throw new TypeError(`Cannot convert value to AST: ${tt(t)}.`)}n(0,"Unexpected input type: "+tt(r))}const nr=/^-?(?:0|[1-9][0-9]*)$/;function rr(e){const t=e.type,r=e.default;if(r){const e=r.literal??Sn(r.value,t);return null!=e||n(0,"Invalid default value"),e}const i=e.defaultValue;if(void 0!==i){const e=tr(i,t);return null!=e||n(0,"Invalid default value"),e}}const ir=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Cn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(ar))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(ar),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:ar,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:ar,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(or))),resolve:e=>e.getDirectives()}})}),or=new GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new GraphQLNonNull(Cn),resolve:e=>e.name},description:{type:Cn,resolve:e=>e.description},isRepeatable:{type:new GraphQLNonNull(jn),resolve:e=>e.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(sr))),resolve:e=>e.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(ur))),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter(e=>null==e.deprecationReason)}})}),sr=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:h.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:h.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:h.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:h.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:h.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:h.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:h.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:h.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:h.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:h.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:h.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:h.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:h.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:h.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:h.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:h.UNION,description:"Location adjacent to a union definition."},ENUM:{value:h.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:h.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:h.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:h.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),ar=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(dr),resolve:e=>Pt(e)?pr.SCALAR:Bt(e)?pr.OBJECT:Jt(e)?pr.INTERFACE:Kt(e)?pr.UNION:zt(e)?pr.ENUM:Yt(e)?pr.INPUT_OBJECT:Ht(e)?pr.LIST:Wt(e)?pr.NON_NULL:void n(0,`Unexpected type: "${tt(e)}".`)},name:{type:Cn,resolve:e=>"name"in e?e.name:void 0},description:{type:Cn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:Cn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(cr)),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Bt(e)||Jt(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(ar)),resolve(e){if(Bt(e)||Jt(e))return e.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(ar)),resolve(e,t,n,{schema:r}){if(rn(e))return r.getPossibleTypes(e)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(lr)),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(zt(e)){const n=e.getValues();return!0===t?n:n.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(ur)),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Yt(e)){const n=Object.values(e.getFields());return!0===t?n:n.filter(e=>null==e.deprecationReason)}}},ofType:{type:ar,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:jn,resolve:e=>{if(Yt(e))return e.isOneOf}}})}),cr=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(Cn),resolve:e=>e.name},description:{type:Cn,resolve:e=>e.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(ur))),args:{includeDeprecated:{type:new GraphQLNonNull(jn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>!0===t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new GraphQLNonNull(ar),resolve:e=>e.type},isDeprecated:{type:new GraphQLNonNull(jn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Cn,resolve:e=>e.deprecationReason}})}),ur=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(Cn),resolve:e=>e.name},description:{type:Cn,resolve:e=>e.description},type:{type:new GraphQLNonNull(ar),resolve:e=>e.type},defaultValue:{type:Cn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const t=rr(e);return t?$t(t):null}},isDeprecated:{type:new GraphQLNonNull(jn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Cn,resolve:e=>e.deprecationReason}})}),lr=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(Cn),resolve:e=>e.name},description:{type:Cn,resolve:e=>e.description},isDeprecated:{type:new GraphQLNonNull(jn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:Cn,resolve:e=>e.deprecationReason}})}),pr={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},dr=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:pr.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:pr.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:pr.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:pr.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:pr.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:pr.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:pr.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:pr.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),fr=new GraphQLField(void 0,"__schema",{type:new GraphQLNonNull(ir),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:r})=>r}),hr=new GraphQLField(void 0,"__type",{type:ar,description:"Request the type information of a single type.",args:{name:{type:new GraphQLNonNull(Cn)}},resolve:(e,{name:t},n,{schema:r})=>r.getType(t)}),mr=new GraphQLField(void 0,"__typename",{type:new GraphQLNonNull(Cn),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:r})=>r.name}),vr=Object.freeze([ir,or,sr,ar,cr,ur,lr,dr]);function yr(e){return vr.some(({name:t})=>e.name===t)}function gr(e){if(!function(e){return rt(e,GraphQLSchema)}(e))throw new Error(`Expected ${tt(e)} to be a GraphQL schema.`);return e}class GraphQLSchema{constructor(e){this.assumeValid=e.assumeValid??!1,this.__validationErrors=!0===e.assumeValid?[]:void 0,this.description=e.description,this.extensions=St(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??Zn;const t=new Set(e.types);if(null!=e.types)for(const n of e.types)t.delete(n),Tr(n,t);null!=this._queryType&&Tr(this._queryType,t),null!=this._mutationType&&Tr(this._mutationType,t),null!=this._subscriptionType&&Tr(this._subscriptionType,t);for(const e of this._directives)if(Bn(e))for(const n of e.args)Tr(n.type,t);Tr(ir,t),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(const e of t){if(null==e)continue;const t=e.name;if(void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Jt(e)){for(const t of e.getInterfaces())if(Jt(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(Bt(e))for(const t of e.getInterfaces())if(Jt(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case f.QUERY:return this.getQueryType();case f.MUTATION:return this.getMutationType();case f.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Kt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap.get(e);if(void 0===n){if(Kt(e))n=new Set(e.getTypes());else{const t=this.getImplementations(e);n=new Set([...t.objects,...t.interfaces])}this._subTypeMap.set(e,n)}return n.has(t)}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}getField(e,t){switch(t){case fr.name:return this.getQueryType()===e?fr:void 0;case hr.name:return this.getQueryType()===e?hr:void 0;case mr.name:return mr}if("getFields"in e)return e.getFields()[t]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}}function Tr(e,t){const n=un(e);if(!t.has(n))if(t.add(n),Kt(n))for(const e of n.getTypes())Tr(e,t);else if(Bt(n)||Jt(n)){for(const e of n.getInterfaces())Tr(e,t);for(const e of Object.values(n.getFields())){Tr(e.type,t);for(const n of e.args)Tr(n.type,t)}}else if(Yt(n))for(const e of Object.values(n.getFields()))Tr(e.type,t);return t}function br(e){if(gr(e),e.__validationErrors)return e.__validationErrors;const n=new SchemaValidationContext(e);!function(e){const t=e.schema;null==t.getQueryType()&&e.reportError("Query root type must be provided.",t.astNode);const n=new AccumulatorMap;for(const r of Object.values(f)){const i=t.getRootType(r);if(null!=i)if(Bt(i))n.add(i,r);else{const n=ct(r),o=tt(i);e.reportError(r===f.QUERY?`${n} root type must be Object type, it cannot be ${o}.`:`${n} root type must be Object type if provided, it cannot be ${o}.`,Er(t,r)??i.astNode)}}for(const[r,i]of n)if(i.length>1){const n=ut(i);e.reportError(`All root types must be different, "${r}" type is used as ${n} root types.`,i.map(e=>Er(t,e)))}}(n),function(e){for(const t of e.schema.getDirectives())if(Bn(t)){Sr(e,t),0===t.locations.length&&e.reportError(`Directive ${t} must include 1 or more locations.`,t.astNode);for(const n of t.args)Sr(e,n),Xt(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${tt(n.type)}.`,n.astNode),hn(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[Fr(n.astNode),n.astNode?.type]),Nr(e,n)}else e.reportError(`Expected directive but got: ${tt(t)}.`,t?.astNode)}(n),function(e){const n=function(e){const t=new Set,n=[],r=Object.create(null);return i;function i(o){if(t.has(o))return;t.add(o),r[o.name]=n.length;const s=Object.values(o.getFields());for(const t of s)if(Wt(t.type)&&Yt(t.type.ofType)){const s=t.type.ofType,a=r[s.name];if(n.push({fieldStr:`${o}.${t.name}`,astNode:t.astNode}),void 0===a)i(s);else{const t=n.slice(a),r=t.map(e=>e.fieldStr).join(", ");e.reportError(`Invalid circular reference. The Input Object ${s} references itself ${t.length>1?"via the non-null fields:":"in the non-null field"} ${r}.`,t.map(e=>e.astNode))}n.pop()}r[o.name]=void 0}}(e),r=function(e){const n=Object.create(null),r=[],i=Object.create(null);return function(e){return o(e,Object.create(null))};function o(e,n){if(pt(n))for(const t of n)o(e,t);else if(t(n))for(const t of Object.values(e.getFields())){const r=un(t.type);Yt(r)&&(Object.hasOwn(n,t.name)?o(r,n[t.name]):a(t,r,`${e}.${t.name}`))}}function s(e,t){if(t.kind===A){for(const n of t.values)s(e,n);return}if(t.kind!==G)return;const n=dt(t.fields,e=>e.name.value);for(const t of Object.values(e.getFields())){const r=un(t.type);Yt(r)&&(Object.hasOwn(n,t.name)?s(r,n[t.name].value):a(t,r,`${e}.${t.name}`))}}function a(t,a,c){const u=t.default;if(void 0===u)return;const l=i[c];void 0===l?void 0===n[c]&&(n[c]=!0,i[c]=r.push([c,t.astNode?.defaultValue]),u.literal?s(a,u.literal):o(a,u.value),r.pop(),i[c]=void 0):e.reportError(`Invalid circular reference. The default value of Input Object field ${c} references itself${le).join(", ")}`:""}.`,r.slice(l-1).map(([,e])=>e))}}(e),i=e.schema.getTypeMap();for(const t of Object.values(i))cn(t)?(yr(t)||Sr(e,t),Bt(t)||Jt(t)?(Ir(e,t),Lr(e,t)):Kt(t)?_r(e,t):zt(t)?xr(e,t):Yt(t)&&(Dr(e,t),n(t),r(t))):e.reportError(`Expected GraphQL named type but got: ${tt(t)}.`,t.astNode)}(n);const r=n.getErrors();return e.__validationErrors=r,r}class SchemaValidationContext{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function Er(e,t){return[e.astNode,...e.extensionASTNodes].flatMap(e=>e?.operationTypes??[]).find(e=>e.operation===t)?.type}function Nr(e,t){const n=t.default;if(n)if(n.literal)xn(n.literal,t.type,(n,r)=>{e.reportError(`${t} has invalid default value${ht(r)}: ${n.message}`,n.nodes)});else{const r=[];if(kn(n.value,t.type,(e,t)=>{r.push([e,t])}),r.length>0)try{const r=wr(n.value,t.type),i=[];if(kn(r,t.type,(e,t)=>{i.push([e,t])}),0===i.length)return void e.reportError(`${t} has invalid default value: ${tt(n.value)}. Did you mean: ${tt(r)}?`,t.astNode?.defaultValue)}catch(e){}for(const[n,i]of r)e.reportError(`${t} has invalid default value${ht(i)}: ${n.message}`,t.astNode?.defaultValue)}}function wr(e,r){if(Wt(r))return wr(e,r.ofType);if(null===e)return null;if(Ht(r))return pt(e)?Array.from(e,e=>wr(e,r.ofType)):[wr(e,r.ofType)];if(Yt(r)){t(e)||n();const i=r.getFields();return ft(e,(e,t)=>(t in i||n(),wr(e,i[t].type)))}return tn(r),r.coerceOutputValue(e)}function Sr(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Ir(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const t of n){Sr(e,t),Zt(t.type)||e.reportError(`The type of ${t} must be Output Type but got: ${tt(t.type)}.`,t.astNode?.type);for(const n of t.args)Sr(e,n),Xt(n.type)||e.reportError(`The type of ${n} must be Input Type but got: ${tt(n.type)}.`,n.astNode?.type),hn(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${n} cannot be deprecated.`,[Fr(n.astNode),n.astNode?.type]),Nr(e,n)}}function Lr(e,t){const n=new Set;for(const r of t.getInterfaces())Jt(r)?t!==r?n.has(r.name)?e.reportError(`Type ${t} can only implement ${r} once.`,Ar(t,r)):(n.add(r.name),Or(e,t,r),kr(e,t,r)):e.reportError(`Type ${t} cannot implement itself because it would create a circular reference.`,Ar(t,r)):e.reportError(`Type ${t} must only implement Interface types, it cannot implement ${tt(r)}.`,Ar(t,r))}function kr(e,t,n){const r=t.getFields();for(const i of Object.values(n.getFields())){const o=r[i.name];if(null!=o){bn(e.schema,o.type,i.type)||e.reportError(`Interface field ${i} expects type ${i.type} but ${o} is type ${o.type}.`,[i.astNode?.type,o.astNode?.type]);for(const t of i.args){const n=o.args.find(e=>e.name===t.name);n?Tn(t.type,n.type)||e.reportError(`Interface field argument ${t} expects type ${t.type} but ${n} is type ${n.type}.`,[t.astNode?.type,n.astNode?.type]):e.reportError(`Interface field argument ${t} expected but ${o} does not provide it.`,[t.astNode,o.astNode])}for(const t of o.args)if(hn(t)){i.args.find(e=>e.name===t.name)||e.reportError(`Argument "${t}" must not be required type "${t.type}" if not provided by the Interface field "${i}".`,[t.astNode,i.astNode])}null!=o.deprecationReason&&null==i.deprecationReason&&e.reportError(`Interface field ${n.name}.${i.name} is not deprecated, so implementation field ${t.name}.${o.name} must not be deprecated.`,[Fr(o.astNode),o.astNode?.type])}else e.reportError(`Interface field ${i} expected but ${t} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes])}}function Or(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t} cannot implement ${n} because it would create a circular reference.`:`Type ${t} must implement ${i} because it is implemented by ${n}.`,[...Ar(n,i),...Ar(t,n)])}function _r(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=new Set;for(const i of n)r.has(i.name)?e.reportError(`Union type ${t} can only include type ${i} once.`,Gr(t,i.name)):(r.add(i.name),Bt(i)||e.reportError(`Union type ${t} can only include Object types, it cannot include ${tt(i)}.`,Gr(t,String(i))))}function xr(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)Sr(e,t)}function Dr(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)Sr(e,r),Xt(r.type)||e.reportError(`The type of ${r} must be Input Type but got: ${tt(r.type)}.`,r.astNode?.type),gn(r)&&null!=r.deprecationReason&&e.reportError(`Required input field ${r} cannot be deprecated.`,[Fr(r.astNode),r.astNode?.type]),Nr(e,r),t.isOneOf&&$r(t,r,e)}function $r(e,t,n){Wt(t.type)&&n.reportError(`OneOf input field ${e}.${t.name} must be nullable.`,t.astNode?.type),void 0===t.default&&void 0===t.defaultValue||n.reportError(`OneOf input field ${e}.${t.name} cannot have a default value.`,t.astNode)}function Ar(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap(e=>e.interfaces??[]).filter(e=>e.name.value===t.name)}function Gr(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap(e=>e.types??[]).filter(e=>e.name.value===t)}function Fr(e){return e?.directives?.find(e=>e.name.value===Hn.name)}function Qr(e,t){switch(t.kind){case C:{const n=Qr(e,t.type);return n&&new GraphQLList(n)}case j:{const n=Qr(e,t.type);return n&&new GraphQLNonNull(n)}case V:return e.getType(t.name.value)}}class TypeInfo{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._fragmentSignaturesByName=n??(()=>null),this._fragmentSignature=null,this._fragmentArgument=null,t&&(Xt(t)&&this._inputTypeStack.push(t),nn(t)&&this._parentTypeStack.push(t),Zt(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){return this._typeStack.at(-1)}getParentType(){return this._parentTypeStack.at(-1)}getInputType(){return this._inputTypeStack.at(-1)}getParentInputType(){return this._inputTypeStack.at(-2)}getFieldDef(){return this._fieldDefStack.at(-1)}getDefaultValue(){return this._defaultValueStack.at(-1)}getDirective(){return this._directive}getArgument(){return this._argument}getFragmentSignature(){return this._fragmentSignature}getFragmentSignatureByName(){return this._fragmentSignaturesByName}getFragmentArgument(){return this._fragmentArgument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case v:{const t=function(e){const t=new Map;for(const n of e.definitions)if(n.kind===I){const e=new Map;if(n.variableDefinitions)for(const t of n.variableDefinitions)e.set(t.variable.name.value,t);const r={definition:n,variableDefinitions:e};t.set(n.name.value,r)}return t}(e);this._fragmentSignaturesByName=e=>t.get(e);break}case T:{const e=un(this.getType());this._parentTypeStack.push(nn(e)?e:void 0);break}case b:{const n=this.getParentType();let r,i;n&&(r=t.getField(n,e.name.value),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Zt(i)?i:void 0);break}case Q:this._directive=t.getDirective(e.name.value);break;case y:{const n=t.getRootType(e.operation);this._typeStack.push(Bt(n)?n:void 0);break}case w:this._fragmentSignature=this.getFragmentSignatureByName()(e.name.value);break;case S:case I:{const n=e.typeCondition,r=n?Qr(t,n):un(this.getType());this._typeStack.push(Zt(r)?r:void 0);break}case g:{const n=Qr(t,e.type);this._inputTypeStack.push(Xt(n)?n:void 0);break}case E:{let t,n;const r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find(t=>t.name===e.name.value),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?.default??t?.defaultValue??void 0),this._inputTypeStack.push(Xt(n)?n:void 0);break}case N:{const t=this.getFragmentSignature(),n=t?.variableDefinitions.get(e.name.value);let r;this._fragmentArgument=n,n&&(r=Qr(this._schema,n.type)),this._inputTypeStack.push(Xt(r)?r:void 0);break}case A:{const e=an(this.getInputType()),t=Ht(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Xt(t)?t:void 0);break}case F:{const t=un(this.getInputType());let n,r;Yt(t)&&(r=t.getFields()[e.name.value],null!=r&&(n=r.type)),this._defaultValueStack.push(r?.default??r?.defaultValue??void 0),this._inputTypeStack.push(Xt(n)?n:void 0);break}case $:{const t=un(this.getInputType());let n;zt(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case v:this._fragmentSignaturesByName=()=>null;break;case T:this._parentTypeStack.pop();break;case b:this._fieldDefStack.pop(),this._typeStack.pop();break;case Q:this._directive=null;break;case w:this._fragmentSignature=null;break;case y:case S:case I:this._typeStack.pop();break;case g:this._inputTypeStack.pop();break;case E:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case N:this._fragmentArgument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case A:case F:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case $:this._enumValue=null}}}function Vr(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=Dt(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),d(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=Dt(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function Cr(e){const t=e.arguments?.find(e=>"if"===e.name.value);if(!t)return!1;if(t.value.kind===x){if(t.value.value)return!1}else if(t.value.kind!==L)return!1;return!0}function jr(e){return e.kind===y||e.kind===I}function Rr(e){return e.kind===U||e.kind===P||e.kind===J||e.kind===K||e.kind===z||e.kind===H}function Mr(e){return e.kind===Z||e.kind===ee||e.kind===te||e.kind===ne||e.kind===re||e.kind===ie}function Ur(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():Zn;for(const e of r)t.set(e.name,e.args.map(e=>e.name));const i=e.getDocument().definitions;for(const e of i)if(e.kind===W){const n=e.arguments??[];t.set(e.name.value,n.map(e=>e.name.value))}return{Directive(n){const r=n.name.value,i=t.get(r);if(null!=n.arguments&&null!=i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=Nt(n,i);e.reportError(new GraphQLError(`Unknown argument "${n}" on directive "@${r}".`+(e.hideSuggestions?"":mt(o)),{nodes:t}))}}return!1}}}function Pr(e){const t=new Map,r=e.getSchema(),i=r?r.getDirectives():Zn;for(const e of i)t.set(e.name,e.locations);const o=e.getDocument().definitions;for(const e of o)e.kind===W&&t.set(e.name.value,e.locations.map(e=>e.value));return{Directive(r,i,o,s,a){const c=r.name.value,u=t.get(c);if(null==u)return void e.reportError(new GraphQLError(`Unknown directive "@${c}".`,{nodes:r}));const l=function(e){const t=e.at(-1);switch(null!=t&&"kind"in t||n(),t.kind){case y:return function(e){switch(e){case f.QUERY:return h.QUERY;case f.MUTATION:return h.MUTATION;case f.SUBSCRIPTION:return h.SUBSCRIPTION}}(t.operation);case b:return h.FIELD;case w:return h.FRAGMENT_SPREAD;case S:return h.INLINE_FRAGMENT;case I:return h.FRAGMENT_DEFINITION;case g:{const t=e[e.length-3];return"kind"in t||n(),t.kind===y?h.VARIABLE_DEFINITION:h.FRAGMENT_VARIABLE_DEFINITION}case R:case X:return h.SCHEMA;case U:case Z:return h.SCALAR;case P:case ee:return h.OBJECT;case B:return h.FIELD_DEFINITION;case J:case te:return h.INTERFACE;case K:case ne:return h.UNION;case z:case re:return h.ENUM;case Y:return h.ENUM_VALUE;case H:case ie:return h.INPUT_OBJECT;case q:{const t=e.at(-3);return null!=t&&"kind"in t||n(),t.kind===H?h.INPUT_FIELD_DEFINITION:h.ARGUMENT_DEFINITION}default:n(0,"Unexpected kind: "+tt(t.kind))}}(a);null==l||u.includes(l)||e.reportError(new GraphQLError(`Directive "@${c}" may not be used on ${l}.`,{nodes:r}))}}}function Br(e){const{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},r=new Set([...Object.keys(n),...t.filter(Rr).map(e=>e.name.value)]);return{NamedType(t,n,i,o,s){const a=t.name.value;if(!r.has(a)){const n=s[2]??i,o=null!=n&&("kind"in(c=n)&&(function(e){return e.kind===R||Rr(e)||e.kind===W}(c)||function(e){return e.kind===X||Mr(e)}(c)));if(o&&qr.has(a))return;const u=e.hideSuggestions?[]:Nt(a,o?[...qr,...r]:[...r]);e.reportError(new GraphQLError(`Unknown type "${a}".`+mt(u),{nodes:t}))}var c}}}const qr=new Set([...Mn,...vr].map(e=>e.name));function Jr(e){const t=new Set,n=[];return{OperationDefinition(n){for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value);return!1},FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){for(const r of n){const n=r.name.value;t.has(n)||e.reportError(new GraphQLError(`Fragment "${n}" is never used.`,{nodes:r}))}}}}}function Kr(e){switch(e.kind){case G:return{...e,fields:(t=e.fields,t.map(e=>({...e,value:Kr(e.value)})).sort((e,t)=>gt(e.name.value,t.name.value)))};case A:return{...e,values:e.values.map(Kr)};case k:case O:case _:case x:case D:case $:case L:return e}var t}function zr(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+zr(t)).join(" and "):e}function Yr(e,t,n,r,i,o,s,a){if(r.has(s,a.key,o))return;r.add(s,a.key,o);const c=e.getFragment(a.node.name.value);if(!c)return;const[u,l]=oi(e,n,c,a.varMap);if(s!==u){Wr(e,t,n,r,i,o,s,void 0,u,a.varMap);for(const a of l)Yr(e,t,n,r,i,o,s,a)}}function Hr(e,t,n,r,i,o,s,a){if(s.key===a.key)return;if(s.node.name.value===a.node.name.value&&!Zr(s.node.arguments,s.varMap,a.node.arguments,a.varMap))return void e.reportError(new GraphQLError(`Spreads "${s.node.name.value}" conflict because ${s.key} and ${a.key} have different fragment arguments.`,{nodes:[s.node,a.node]}));if(i.has(s.key,a.key,o))return;i.add(s.key,a.key,o);const c=e.getFragment(s.node.name.value),u=e.getFragment(a.node.name.value);if(!c||!u)return;const[l,p]=oi(e,n,c,s.varMap),[d,f]=oi(e,n,u,a.varMap);Wr(e,t,n,r,i,o,l,s.varMap,d,a.varMap);for(const a of f)Hr(e,t,n,r,i,o,s,a);for(const s of p)Hr(e,t,n,r,i,o,s,a)}function Wr(e,t,n,r,i,o,s,a,c,u){for(const[l,p]of s.entries()){const s=c.get(l);if(null!=s)for(const c of p)for(const p of s){const s=Xr(e,n,r,i,o,l,c,a,p,u);s&&t.push(s)}}}function Xr(e,t,n,r,i,o,s,a,c,u){const[l,p,d]=s,[f,h,m]=c,v=i||l!==f&&Bt(l)&&Bt(f);if(!v){const e=p.name.value,t=h.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[p],[h]];if(!Zr(p.arguments,a,h.arguments,u))return[[o,"they have differing arguments"],[p],[h]]}const y=function(e,t,n,r){const i=ni(e),o=ni(n);if(!i&&!o)return;if(i&&o)return Zr(i.arguments,t,o.arguments,r)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives";return"they have overlapping stream directives"}(p.directives??[],a,h.directives??[],u);if(void 0!==y)return[[o,y],[p],[h]];const g=d?.type,T=m?.type;if(g&&T&&ri(g,T))return[[o,`they return conflicting types "${tt(g)}" and "${tt(T)}"`],[p],[h]];const b=p.selectionSet,E=h.selectionSet;if(b&&E){const i=function(e,t,n,r,i,o,s,a,c,u,l){const p=[],[d,f]=ii(e,t,o,s,a),[h,m]=ii(e,t,c,u,l);Wr(e,p,t,n,r,i,d,a,h,l);for(const o of m)Yr(e,p,t,n,r,i,d,o);for(const o of f)Yr(e,p,t,n,r,i,h,o);for(const o of f)for(const s of m)Hr(e,p,t,n,r,i,o,s);return p}(e,t,n,r,v,un(g),b,a,un(T),E,u);return function(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}(i,o,p,h)}}function Zr(e,t,n,r){if(void 0===e||0===e.length)return void 0===n||0===n.length;if(void 0===n||0===n.length)return!1;if(e.length!==n.length)return!1;const i=new Map(n.map(({name:e,value:t})=>[e.value,void 0===r?t:ei(t,r)]));return e.every(e=>{let n=e.value;t&&(n=ei(n,t));const r=i.get(e.name.value);return void 0!==r&&ti(n)===ti(r)})}function ei(e,t){switch(e.kind){case L:return t.get(e.name.value)??e;case A:return{...e,values:e.values.map(e=>ei(e,t))};case G:return{...e,fields:e.fields.map(e=>({...e,value:ei(e.value,t)}))};default:return e}}function ti(e){return $t(Kr(e))}function ni(e){return e.find(e=>"stream"===e.name.value)}function ri(e,t){return Ht(e)?!Ht(t)||ri(e.ofType,t.ofType):!!Ht(t)||(Wt(e)?!Wt(t)||ri(e.ofType,t.ofType):!!Wt(t)||!(!en(e)&&!en(t))&&e!==t)}function ii(e,t,n,r,i){const o=t.get(r);if(o)return o;const s=new Map,a=new Map;si(e,n,r,s,a,i);const c=[s,Array.from(a.values())];return t.set(r,c),c}function oi(e,t,n,r){const i=t.get(n.selectionSet);if(i)return i;const o=Qr(e.getSchema(),n.typeCondition);return ii(e,t,o,n.selectionSet,r)}function si(e,t,n,r,i,o){for(const s of n.selections)switch(s.kind){case b:{const e=s.name.value;let n;(Bt(t)||Jt(t))&&(n=t.getFields()[e]);const i=s.alias?s.alias.value:e;let o=r.get(i);null==o&&(o=[],r.set(i,o)),o.push([t,s,n]);break}case w:{const t=ai(e,s,o);i.set(t.key,t);break}case S:{const n=s.typeCondition,a=n?Qr(e.getSchema(),n):t;si(e,a,s.selectionSet,r,i,o);break}}}function ai(e,t,n){let r="";const i=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(const e of t.arguments)s.set(e.name.value,e.value);if(o?.variableDefinitions){r+=t.name.value+"(";for(const[e,t]of o.variableDefinitions){const o=s.get(e);o&&(r+=e+": "+$t(Kr(o)));const a=s.get(e);void 0!==a?i.set(e,void 0!==n?ei(a,n):a):t.defaultValue&&i.set(e,t.defaultValue)}r+=")"}return{key:r,node:t,varMap:i.size>0?i:void 0}}class OrderedPairSet{constructor(){this._data=new Map}has(e,t,n){const r=this._data.get(e)?.get(t);return void 0!==r&&(!!n||n===r)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(e,t,n){return e[e.name,e])));const i=e.getDocument().definitions;for(const e of i)if(e.kind===W){const n=e.arguments??[];t.set(e.name.value,new Map(n.filter(li).map(e=>[e.name.value,e])))}return{Directive:{leave(n){const r=n.name.value,i=t.get(r);if(null!=i){const t=n.arguments??[],o=new Set(t.map(e=>e.name.value));for(const[t,s]of i.entries())if(!o.has(t)){const i=Ut(s.type)?tt(s.type):$t(s.type);e.reportError(new GraphQLError(`Argument "@${r}(${t}:)" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function li(e){return e.type.kind===j&&null==e.defaultValue}function pi(e,n){if(Wt(n)){if(null==e)return;return pi(e,n.ofType)}if(null==e)return null;if(Ht(n)){if(!pt(e)){const t=pi(e,n.ofType);if(void 0===t)return;return[t]}const t=[];for(const r of e){const e=pi(r,n.ofType);if(void 0===e)return;t.push(e)}return t}if(Yt(n)){if(!t(e)||Array.isArray(e))return;const r={},i=n.getFields();if(Object.keys(e).some(e=>!Object.hasOwn(i,e)))return;for(const t of Object.values(i)){const n=e[t.name];if(void 0===n){if(gn(t))return;const e=hi(t);void 0!==e&&(r[t.name]=e)}else{const e=pi(n,t.type);if(void 0===e)return;r[t.name]=e}}if(n.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}const r=tn(n);try{return r.coerceInputValue(e)}catch(e){}}function di(e,t,n,r){if(e.kind===L){const i=fi(e,n,r);if(null==i&&Wt(t))return;return i}if(Wt(t)){if(e.kind===D)return;return di(e,t.ofType,n,r)}if(e.kind===D)return null;if(Ht(t)){if(e.kind!==A){const i=di(e,t.ofType,n,r);if(void 0===i)return;return[i]}const i=[];for(const o of e.values){let e=di(o,t.ofType,n,r);if(void 0===e){if(o.kind!==L||null!=fi(o,n,r)||Wt(t.ofType))return;e=null}i.push(e)}return i}if(Yt(t)){if(e.kind!==G)return;const i={},o=t.getFields();if(e.fields.some(e=>!Object.hasOwn(o,e.name.value)))return;const s=new Map(e.fields.map(e=>[e.name.value,e]));for(const e of Object.values(o)){const t=s.get(e.name);if(!t||t.value.kind===L&&null==fi(t.value,n,r)){if(gn(e))return;const t=hi(e);void 0!==t&&(i[e.name]=t)}else{const o=di(t.value,e.type,n,r);if(void 0===o)return;i[e.name]=o}}if(t.isOneOf){const e=Object.keys(i);if(1!==e.length)return;if(null===i[e[0]])return}return i}const i=tn(t);try{return i.coerceInputLiteral?i.coerceInputLiteral(Ln(e,n,r)):i.parseLiteral(e,n?.coerced)}catch(e){}}function fi(e,t,n){const r=e.name.value;return void 0!==n?.sources[r]?n.coerced[r]:t?.coerced[r]}function hi(e){let t=e._memoizedCoercedDefaultValue;if(void 0!==t)return t;const r=e.default;if(void 0!==r)return t=r.literal?di(r.literal,e.type):pi(r.value,e.type),void 0!==t||n(),e._memoizedCoercedDefaultValue=t,t;const i=e.defaultValue;return void 0!==i&&(e._memoizedCoercedDefaultValue=i),i}function mi(e,t,n,r,i){const o=e.arguments??[],s=new Map(o.map(e=>[e.name.value,e])),a=Object.create(null),c=Object.create(null);for(const[o,u]of Object.entries(t)){a[o]={signature:u};const t=s.get(o);if(void 0!==t){const e=a[o];e.value=t.value,e.fragmentVariableValues=r}yi(c,e,o,u,t,n,r,i)}return{sources:a,coerced:c}}function vi(e,t,n,r,i){const o={},s=t.arguments??[],a=new Map(s.map(e=>[e.name.value,e]));for(const s of e.args){yi(o,t,s.name,s,a.get(s.name),n,r,i)}return o}function yi(e,t,r,i,o,s,a,c){const u=i.type;if(!o){if(hn(i))throw new GraphQLError(`Argument "${qt(i)?i:r}" of required type "${u}" was not provided.`,{nodes:t});const n=hi(i);return void(void 0!==n&&(e[r]=n))}const l=o.value;if(l.kind===L){const t=l.name.value,n=a?.sources[t]?a:s;if(!(null!=n&&Object.hasOwn(n.coerced,t)||hn(i))){const t=hi(i);return void(void 0!==t&&(e[r]=t))}}const p=di(l,u,s,a);void 0===p&&(xn(l,u,(e,t)=>{throw e.message=`Argument "${qt(i)?i:i.name}" has invalid value${ht(t)}: ${e.message}`,e},s,a,c),n(0,"Invalid argument")),e[r]=p}function gi(e,t,n,r,i){const o=t.directives?.find(t=>t.name.value===e.name);if(o)return vi(e,o,n,r,i)}function Ti(e,t,n,r,i,o,s=!1){const a=new AccumulatorMap,c=[],u={schema:e,fragments:t,variableValues:n,runtimeType:r,visitedFragmentNames:new Set,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return bi(u,i,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:u.forbiddenDirectiveInstances}}function bi(e,t,n,r,i,o){const{schema:s,fragments:a,variableValues:c,runtimeType:u,visitedFragmentNames:l,hideSuggestions:p}=e;for(const d of t.selections)switch(d.kind){case b:if(!Ni(e,d,c,o))continue;n.add(Si(d),{node:d,deferUsage:i,fragmentVariableValues:o});break;case S:{if(!Ni(e,d,c,o)||!wi(s,d,u))continue;const t=Ei(c,o,d,i);t?(r.push(t),bi(e,d.selectionSet,n,r,t,o)):bi(e,d.selectionSet,n,r,i,o);break}case w:{const t=d.name.value;if(l.has(t)||!Ni(e,d,c,o))continue;const f=a[t];if(null==f||!wi(s,f.definition,u))continue;const h=Ei(c,o,d,i),m=f.variableSignatures;let v;m&&(v=mi(d,m,c,o,p)),h?(r.push(h),bi(e,f.definition.selectionSet,n,r,h,v)):(l.add(t),bi(e,f.definition.selectionSet,n,r,i,v));break}}}function Ei(e,t,n,r){const i=gi(Kn,n,e,t);if(i&&!1!==i.if)return{label:"string"==typeof i.label?i.label:void 0,parentDeferUsage:r}}function Ni(e,t,n,r){const i=t.directives?.find(e=>e.name.value===Jn.name);if(i&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(i),!1;const o=i?vi(Jn,i,n,r,e.hideSuggestions):void 0;if(!0===o?.if)return!1;const s=t.directives?.find(e=>e.name.value===qn.name);if(s&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(s),!1;const a=s?vi(qn,s,n,r,e.hideSuggestions):void 0;return!1!==a?.if}function wi(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=Qr(e,r);return i===n||!!rn(i)&&e.isSubType(i,n)}function Si(e){return e.alias?e.alias.value:e.name.value}function Ii(e){return e.map(e=>e.node)}function Li(e,t){const n=new AccumulatorMap;for(const r of e)n.add(t(r),r);return n}function ki(e){return{Field:t,Directive:t};function t(t){const n=Li(t.arguments??[],e=>e.name.value);for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one argument named "${t}".`,{nodes:r.map(e=>e.name)}))}}function Oi(e){const t=new Map,n=e.getSchema(),r=n?n.getDirectives():Zn;for(const e of r)t.set(e.name,!e.isRepeatable);const i=e.getDocument().definitions;for(const e of i)e.kind===W&&t.set(e.name.value,!e.repeatable);const o=new Map,s=new Map;return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===R||n.kind===X)r=o;else if(Rr(n)||Mr(n)){const e=n.name.value;r=s.get(e),void 0===r&&(r=new Map,s.set(e,r))}else r=new Map;for(const i of n.directives){const n=i.name.value;if(!0===t.get(n)){const t=r.get(n);null!=t?e.reportError(new GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[t,i]})):r.set(n,i)}}}}}function _i(e,t){return!!(Bt(e)||Jt(e)||Yt(e))&&null!=e.getFields()[t]}function xi(e){const t=[];let r=new Map;return{ObjectValue:{enter(){t.push(r),r=new Map},leave(){const e=t.pop();null!=e||n(),r=e}},ObjectField(t){const n=t.name.value,i=r.get(n);null!=i?e.reportError(new GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i,t.name]})):r.set(n,t.name)}}}function Di(e,t,n){return n&&xn(t,n,t=>{e.reportError(t)},void 0,void 0,e.hideSuggestions),!1}function $i(e,t,n,r,i){if(Wt(r)&&!Wt(t)){if(!(null!=n&&n.kind!==D)&&!(void 0!==i))return!1;return bn(e,t,r.ofType)}return bn(e,t,r)}const Ai=Object.freeze([function(e){function t(n,r=Object.create(null),i=0){if(n.kind===w){const o=n.name.value;if(!0===r[o])return!1;const s=e.getFragment(o);if(!s)return!1;try{return r[o]=!0,t(s,r,i)}finally{r[o]=void 0}}if(n.kind===b&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}]),Gi=Object.freeze([function(e){return{Document(t){for(const n of t.definitions)if(!jr(n)){const t=n.kind===R||n.kind===X?"schema":'"'+n.name.value+'"';e.reportError(new GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}},function(e){const t=e.getSchema();return{OperationDefinition(n){const r=n.operation;t.getRootType(r)||e.reportError(new GraphQLError(`The ${r} operation is not supported by the schema.`,{nodes:n}))}}},function(e){const t=new Map;return{OperationDefinition(n){const r=n.name;if(null!=r){const n=t.get(r.value);null!=n?e.reportError(new GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[n,r]})):t.set(r.value,r)}return!1},FragmentDefinition:()=>!1}},function(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===y).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}},function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(const e of s.definitions)e.kind===I&&(a[e.name.value]={definition:e});const{groupedFieldSet:c,forbiddenDirectiveInstances:u}=Ti(n,a,o,r,t.selectionSet,e.hideSuggestions,!0);if(u.length>0)return void e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:u}));if(c.size>1){const t=[...c.values()].slice(1).flatMap(e=>Ii(e));e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){Ii(t)[0].name.value.startsWith("__")&&e.reportError(new GraphQLError(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:Ii(t)}))}}}}}},Br,function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=Qr(e.getSchema(),n);if(t&&!nn(t)){const t=$t(n);e.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=Qr(e.getSchema(),t.typeCondition);if(n&&!nn(n)){const n=$t(t.typeCondition);e.reportError(new GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}},function(e){return{VariableDefinition(t){const n=Qr(e.getSchema(),t.type);if(void 0!==n&&!Xt(n)){const n=t.variable.name.value,r=$t(t.type);e.reportError(new GraphQLError(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}},function(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(en(un(n))){if(r){const i=t.name.value,o=tt(n);e.reportError(new GraphQLError(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=tt(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=tt(n);e.reportError(new GraphQLError(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}},function(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=mt("to use an inline fragment on",e.hideSuggestions?[]:function(e,t,n){if(!rn(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(null!=o.getFields()[n]){r.add(o),i[o.name]=1;for(const e of o.getInterfaces())null!=e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Jt(t)&&e.isSubType(t,n)?-1:Jt(n)&&e.isSubType(n,t)?1:gt(t.name,n.name)}).map(e=>e.name)}(r,n,i));""===o&&(o=mt(e.hideSuggestions?[]:function(e,t){if(Bt(e)||Jt(e)){return Nt(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new GraphQLError(`Cannot query field "${i}" on type "${n}".`+o,{nodes:t}))}}}}},function(e){const t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value,i=t.get(r);return null!=i?e.reportError(new GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[i,n.name]})):t.set(r,n.name),!1}}},function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}},Jr,function(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(nn(n)&&nn(r)&&!En(e.getSchema(),n,r)){const i=tt(r),o=tt(n);e.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=Qr(e.getSchema(),n.typeCondition);if(nn(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!En(e.getSchema(),r,i)){const o=tt(i),s=tt(r);e.reportError(new GraphQLError(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${s}".`,{nodes:t}))}}}},function(e){const t=new Set,n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t.has(o.name.value))return;const s=o.name.value;t.add(s);const a=e.getFragmentSpreads(o.selectionSet);if(0!==a.length){r[s]=n.length;for(const t of a){const o=t.name.value,s=r[o];if(n.push(t),void 0===s){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(s),r=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new GraphQLError(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[s]=void 0}}},function(e){return{OperationDefinition(t){const n=Li(t.variableDefinitions??[],e=>e.variable.name.value);for(const[t,r]of n)r.length>1&&e.reportError(new GraphQLError(`There can be only one variable named "$${t}".`,{nodes:r.map(e=>e.variable.name)}))}}},function(e){return{OperationDefinition(t){const n=new Set(t.variableDefinitions?.map(e=>e.variable.name.value)),r=e.getRecursiveVariableUsages(t);for(const{node:i,fragmentVariableDefinition:o}of r){if(o)continue;const r=i.name.value;n.has(r)||e.reportError(new GraphQLError(t.name?`Variable "$${r}" is not defined by operation "${t.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,t]}))}}}},function(e){return{FragmentDefinition(t){const n=e.getVariableUsages(t),r=new Set(n.map(({node:e})=>e.name.value)),i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(`Variable "$${i}" is never used in fragment "${t.name.value}".`,{nodes:n}))}},OperationDefinition(t){const n=e.getRecursiveVariableUsages(t),r=new Set;for(const{node:e,fragmentVariableDefinition:t}of n){const n=e.name.value;t||r.add(n)}const i=t.variableDefinitions??[];for(const n of i){const i=n.variable.name.value;r.has(i)||e.reportError(new GraphQLError(t.name?`Variable "$${i}" is never used in operation "${t.name.value}".`:`Variable "$${i}" is never used.`,{nodes:n}))}}}},Pr,Oi,function(e){return{Directive(t){const n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===Kn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Defer directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Defer directive cannot be used on root subscription type "${i}".`,{nodes:t}))),i&&t.name.value===zn.name&&(n&&i===n&&e.reportError(new GraphQLError(`Stream directive cannot be used on root mutation type "${i}".`,{nodes:t})),r&&i===r&&e.reportError(new GraphQLError(`Stream directive cannot be used on root subscription type "${i}".`,{nodes:t})))}}},function(e){const t=new Set;return{OperationDefinition(n){if(n.operation===f.SUBSCRIPTION)for(const r of e.getRecursivelyReferencedFragments(n))t.add(r.name.value)},Directive(n,r,i,o,s){const a=s[2];"kind"in a&&(a.kind===I&&t.has(a.name.value)||a.kind===y&&a.operation===f.SUBSCRIPTION)&&(n.name.value===Kn.name?Cr(n)||e.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:n})):n.name.value===zn.name&&(Cr(n)||e.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:n}))))}}},function(e){const t=new Map;return{Directive(n){if(n.name.value===Kn.name||n.name.value===zn.name){const r=n.arguments?.find(e=>"label"===e.name.value),i=r?.value;if(!i)return;if(i.kind!==_)return void e.reportError(new GraphQLError(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));const o=t.get(i.value);null!=o?e.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(i.value,n)}}}},function(e){return{Directive(t){const n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===zn.name&&!(Ht(n.type)||on(n.type)&&Ht(n.type.ofType))&&e.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${r}.${n.name}".`,{nodes:t}))}}},function(e){return{...Ur(e),FragmentArgument(t){const n=e.getFragmentSignature();if(n){if(!n.variableDefinitions.get(t.name.value)){const r=t.name.value,i=e.hideSuggestions?[]:Nt(r,Array.from(n.variableDefinitions.values()).map(e=>e.variable.name.value));e.reportError(new GraphQLError(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+mt(i),{nodes:t}))}}},Argument(t){const n=e.getArgument(),r=e.getFieldDef();if(!n&&r){const n=t.name.value,i=e.hideSuggestions?[]:Nt(n,r.args.map(e=>e.name));e.reportError(new GraphQLError(`Unknown argument "${n}" on field "${r}".`+mt(i),{nodes:t}))}}}},ki,function(e){return{NullValue:t=>Di(e,t,e.getInputType()),ListValue:t=>Di(e,t,e.getParentInputType()),ObjectValue:t=>Di(e,t,e.getInputType()),EnumValue:t=>Di(e,t,e.getInputType()),IntValue:t=>Di(e,t,e.getInputType()),FloatValue:t=>Di(e,t,e.getInputType()),StringValue:t=>Di(e,t,e.getInputType()),BooleanValue:t=>Di(e,t,e.getInputType())}},function(e){return{...ui(e),Field:{leave(t){const n=e.getFieldDef();if(!n)return!1;const r=new Set(t.arguments?.map(e=>e.name.value));for(const i of n.args)!r.has(i.name)&&hn(i)&&e.reportError(new GraphQLError(`Argument "${i}" of type "${i.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){const n=e.getFragmentSignature();if(!n)return!1;const r=new Set(t.arguments?.map(e=>e.name.value));for(const[i,o]of n.variableDefinitions)if(!r.has(i)&&li(o)){const n=tt(Qr(e.getSchema(),o.type));e.reportError(new GraphQLError(`Fragment "${t.name.value}" argument "${i}" of type "${n}" is required, but it was not provided.`,{nodes:t}))}}}}},function(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,parentType:o,defaultValue:s,fragmentVariableDefinition:a}of r){const r=n.name.value;let c=a;if(c||(c=t.get(r)),c&&i){const t=e.getSchema(),a=Qr(t,c.type);a&&!$i(t,a,c.defaultValue,i,s)&&e.reportError(new GraphQLError(`Variable "$${r}" of type "${a}" used in position expecting type "${i}".`,{nodes:[c,n]})),Yt(o)&&o.isOneOf&&sn(a)&&e.reportError(new GraphQLError(`Variable "$${r}" is of type "${a}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[c,n]}))}}}},VariableDefinition(e){t.set(e.variable.name.value,e)}}},function(e){const t=new OrderedPairSet,n=new PairSet,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const s=[],[a,c]=ii(e,t,i,o,void 0);if(function(e,t,n,r,i,o){for(const[s,a]of o.entries())if(a.length>1)for(let o=0;o0&&e.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:t})),++r)}}},function(e){const t=e.getSchema(),n=new Map,r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){const i=t.operationTypes??[];for(const t of i){const i=t.operation,o=n.get(i);r[i]?e.reportError(new GraphQLError(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new GraphQLError(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n.set(i,t)}return!1}},function(e){const t=new Map,n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(n?.getType(i))return void e.reportError(new GraphQLError(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));const o=t.get(i);return null!=o?e.reportError(new GraphQLError(`There can be only one type named "${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.values??[];for(const t of s){const r=t.name.value,s=n[i];if(zt(s)&&s.getValue(r)){e.reportError(new GraphQLError(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const a=o.get(r);null!=a?e.reportError(new GraphQLError(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[a,t.name]})):o.set(r,t.name)}return!1}},function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=new Map;return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){const i=t.name.value;let o=r.get(i);null==o&&(o=new Map,r.set(i,o));const s=t.fields??[];for(const t of s){const r=t.name.value;if(_i(n[i],r)){e.reportError(new GraphQLError(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name}));continue}const s=o.get(r);null!=s?e.reportError(new GraphQLError(`Field "${i}.${r}" can only be defined once.`,{nodes:[s,t.name]})):o.set(r,t.name)}return!1}},function(e){return{DirectiveDefinition(e){const t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){const t=e.name.value,r=e.fields??[];for(const e of r){n(`${t}.${e.name.value}`,e.arguments??[])}return!1}function n(t,n){const r=Li(n,e=>e.name.value);for(const[n,i]of r)i.length>1&&e.reportError(new GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}},function(e){const t=new Map,n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n?.getDirective(i))return void e.reportError(new GraphQLError(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));const o=t.get(i);return o?e.reportError(new GraphQLError(`There can be only one directive named "@${i}".`,{nodes:[o,r.name]})):t.set(i,r.name),!1}}},Br,Pr,Oi,function(e){const t=e.getSchema(),r=new Map;for(const t of e.getDocument().definitions)Rr(t)&&r.set(t.name.value,t);return{ScalarTypeExtension:i,ObjectTypeExtension:i,InterfaceTypeExtension:i,UnionTypeExtension:i,EnumTypeExtension:i,InputObjectTypeExtension:i};function i(i){const o=i.name.value,s=r.get(o),a=t?.getType(o);let c;if(null!=s?c=ci[s.kind]:a&&(c=function(e){if(Pt(e))return Z;if(Bt(e))return ee;if(Jt(e))return te;if(Kt(e))return ne;if(zt(e))return re;if(Yt(e))return ie;n(0,"Unexpected type: "+tt(e))}(a)),null!=c){if(c!==i.kind){const t=function(e){switch(e){case Z:return"scalar";case ee:return"object";case te:return"interface";case ne:return"union";case re:return"enum";case ie:return"input object";default:n(0,"Unexpected kind: "+tt(e))}}(i.kind);e.reportError(new GraphQLError(`Cannot extend non-${t} type "${o}".`,{nodes:s?[s,i]:i}))}}else{const n=[...r.keys(),...Object.keys(t?.getTypeMap()??{})];e.reportError(new GraphQLError(`Cannot extend type "${o}" because it is not defined.`+mt(Nt(o,n)),{nodes:i.name}))}}},Ur,ki,xi,ui]);class ASTValidationContext{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===I&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===w?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=new Set,r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!n.has(i)){n.add(i);const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class SDLValidationContext extends ASTValidationContext{constructor(e,t,n){super(e,n),this._schema=t}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(e,t,n,r,i){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map,this._hideSuggestions=i??!1}get[Symbol.toStringTag](){return"ValidationContext"}get hideSuggestions(){return this._hideSuggestions}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new TypeInfo(this._schema,void 0,this._typeInfo.getFragmentSignatureByName()),i=e.kind===I?e:void 0;_t(e,Vr(r,{VariableDefinition:()=>!1,Variable(e){let t;if(i){const o=r.getFragmentSignatureByName()(i.name.value);t=o?.variableDefinitions.get(e.name.value),n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:void 0,fragmentVariableDefinition:t})}else n.push({node:e,type:r.getInputType(),parentType:r.getParentInputType(),defaultValue:r.getDefaultValue(),fragmentVariableDefinition:void 0})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getFragmentSignature(){return this._typeInfo.getFragmentSignature()}getFragmentSignatureByName(){return this._typeInfo.getFragmentSignatureByName()}getEnumValue(){return this._typeInfo.getEnumValue()}}function Qi(e,t,n=Gi,r){!function(e){const t=br(e);if(0!==t.length)throw new Error(t.map(e=>e.message).join("\n\n"))}(e);const i=new GraphQLError("Too many validation errors, error limit reached. Validation aborted."),o=[],s=new TypeInfo(e),a=new ValidationContext(e,t,s,e=>{if(o.length>=100)throw i;o.push(e)},!1),c=xt(n.map(e=>e(a)));try{_t(t,Vr(s,c))}catch(e){if(e!==i)throw e;o.push(i)}return o}function Vi(e,n){t(e)&&t(e.__schema)||et(0,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${tt(e)}.`);const r=e.__schema,i=new Map(r.types.map(e=>[e.name,f(e)]));for(const e of[...Mn,...vr])i.has(e.name)&&i.set(e.name,e);const o=null!=r.queryType?p(r.queryType):null,s=null!=r.mutationType?p(r.mutationType):null,a=null!=r.subscriptionType?p(r.subscriptionType):null,c=null!=r.directives?r.directives.map(function(e){if(null==e.args){const t=tt(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(null==e.locations){const t=tt(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})}):[];return new GraphQLSchema({description:r.description,query:o,mutation:s,subscription:a,types:[...i.values()],directives:c,assumeValid:n?.assumeValid});function u(e){if(e.kind===pr.LIST){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");return new GraphQLList(u(t))}if(e.kind===pr.NON_NULL){const t=e.ofType;if(null==t)throw new Error("Decorated type deeper than introspection query.");const n=u(t);return new GraphQLNonNull(function(e){if(!sn(e))throw new Error(`Expected ${tt(e)} to be a GraphQL nullable type.`);return e}(n))}return l(e)}function l(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${tt(e)}.`);const n=i.get(t);if(null==n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function p(e){return function(e){if(!Bt(e))throw new Error(`Expected ${tt(e)} to be a GraphQL Object type.`);return e}(l(e))}function d(e){return function(e){if(!Jt(e))throw new Error(`Expected ${tt(e)} to be a GraphQL Interface type.`);return e}(l(e))}function f(e){switch(e.kind){case pr.SCALAR:return new GraphQLScalarType({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case pr.OBJECT:return new GraphQLObjectType({name:(n=e).name,description:n.description,interfaces:()=>h(n),fields:()=>m(n)});case pr.INTERFACE:return new GraphQLInterfaceType({name:(t=e).name,description:t.description,interfaces:()=>h(t),fields:()=>m(t)});case pr.UNION:return function(e){if(null==e.possibleTypes){const t=tt(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(p)})}(e);case pr.ENUM:return function(e){if(null==e.enumValues){const t=tt(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new GraphQLEnumType({name:e.name,description:e.description,values:yt(e.enumValues,e=>e.name,e=>({description:e.description,deprecationReason:e.deprecationReason}))})}(e);case pr.INPUT_OBJECT:return function(e){if(null==e.inputFields){const t=tt(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t,n,r;throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${tt(e)}.`)}function h(e){if(null===e.interfaces&&e.kind===pr.INTERFACE)return[];if(null==e.interfaces){const t=tt(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function m(e){if(null==e.fields)throw new Error(`Introspection result missing fields: ${tt(e)}.`);return yt(e.fields,e=>e.name,v)}function v(e){const t=u(e.type);if(!Zt(t)){const e=tt(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(null==e.args){const t=tt(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return yt(e,e=>e.name,g)}function g(e){const t=u(e.type);if(!Xt(t)){const e=tt(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}return{description:e.description,type:t,default:null!=e.defaultValue?{literal:ot(e.defaultValue)}:void 0,deprecationReason:e.deprecationReason}}}const Ci="SCHEMA",ji="SCALAR",Ri="OBJECT",Mi="FIELD",Ui="ARGUMENT",Pi="INTERFACE",Bi="UNION",qi="ENUM",Ji="ENUM_VALUE",Ki="INPUT_OBJECT",zi="INPUT_FIELD",Yi="DIRECTIVE";function Hi(e,t){const r=t({getNamedType:u,setNamedType:function(e){i.set(e.name,e)},getNamedTypes:function(){return Array.from(i.values())}}),i=new Map;for(const t of e.types){const e=t.name,n=l(t);n&&i.set(e,n)}const o=[];for(const t of e.directives){if(er(t)){o.push(t);continue}const e=m(t.toConfig());e&&o.push(new GraphQLDirective(e))}const s={...e,query:e.query&&u(e.query.name),mutation:e.mutation&&u(e.mutation.name),subscription:e.subscription&&u(e.subscription.name),types:Array.from(i.values()),directives:o},a=r[Ci];return null==a?s:a(s);function c(e){return Ht(e)?new GraphQLList(c(e.ofType)):Wt(e)?new GraphQLNonNull(c(e.ofType)):u(e.name)}function u(e){const t=Wi.get(e)??i.get(e);return void 0!==t||n(0,`Unknown type: "${e}".`),t}function l(e){return yr(e)||Un(e)?e:Pt(e)?function(e){let t=e.toConfig();const n=r[ji];return t=null==n?t:n(t),new GraphQLScalarType(t)}(e):Bt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map(e=>u(e.name)),fields:()=>p(t.fields,e.name)};const i=r[Ri];return n=null==i?n:i(n),new GraphQLObjectType(n)}(e):Jt(e)?function(e){const t=e.toConfig();let n={...t,interfaces:()=>t.interfaces.map(e=>u(e.name)),fields:()=>p(t.fields,e.name)};const i=r[Pi];return n=null==i?n:i(n),new GraphQLInterfaceType(n)}(e):Kt(e)?function(e){const t=e.toConfig();let n={...t,types:()=>t.types.map(e=>u(e.name))};const i=r[Bi];return n=null==i?n:i(n),new GraphQLUnionType(n)}(e):zt(e)?function(e){const t=e.toConfig();let n={...t,values:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.values)){const t=f(i,r,e.name);n[r]=t}return n}};const i=r[qi];return n=null==i?n:i(n),new GraphQLEnumType(n)}(e):Yt(e)?function(e){const t=e.toConfig();let n={...t,fields:()=>{const n=Object.create(null);for(const[r,i]of Object.entries(t.fields)){const t=h(i,r,e.name);n[r]=t}return n}};const i=r[Ki];return n=null==i?n:i(n),new GraphQLInputObjectType(n)}(e):void n(0,"Unexpected type: "+tt(e))}function p(e,t){const n=Object.create(null);for(const[i,o]of Object.entries(e)){let e={...o,type:c(o.type),args:d(o.args,t,i)};const s=r[Mi];s&&(e=s(e,t)),n[i]=e}return n}function d(e,t,n){const i=Object.create(null);for(const[o,s]of Object.entries(e)){let e={...s,type:c(s.type)};const a=r[Ui];a&&(e=a(e,t,n)),i[o]=e}return i}function f(e,t,n){const i={...e},o=r[Ji];return null==o?i:o(i,t,n)}function h(e,t,n){const i={...e,type:c(e.type)},o=r[zi];return null==o?i:o(i,t,n)}function m(e){const t={...e,args:d(e.args,e.name,void 0)},n=r[Yi];return null==n?t:n(t)}}const Wi=new Map([...Mn,...vr].map(e=>[e.name,e]));function Xi(e,t,r){const i=[],o=new AccumulatorMap,s=new AccumulatorMap,a=new AccumulatorMap,c=new AccumulatorMap,u=new AccumulatorMap,l=new AccumulatorMap,p=[];let d;const f=[];let h=!1;for(const e of t.definitions){switch(e.kind){case R:d=e;break;case X:f.push(e);break;case W:p.push(e);break;case U:case P:case J:case K:case z:case H:i.push(e);break;case Z:o.add(e.name.value,e);break;case ee:s.add(e.name.value,e);break;case te:a.add(e.name.value,e);break;case ne:c.add(e.name.value,e);break;case re:u.add(e.name.value,e);break;case ie:l.add(e.name.value,e);break;default:continue}h=!0}return h?Hi(e,e=>{const{getNamedType:t,setNamedType:h,getNamedTypes:m}=e;return{[Ci]:e=>{for(const e of i){const t=Zi.get(e.name.value)??L(e);h(t)}const n={query:e.query&&t(e.query.name),mutation:e.mutation&&t(e.mutation.name),subscription:e.subscription&&t(e.subscription.name),...d&&v([d]),...v(f)};return{description:d?.description?.value??e.description,...n,types:m(),directives:[...e.directives,...p.map(T)],extensions:e.extensions,astNode:d??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(f),assumeValid:r?.assumeValid??!1}},[Ki]:e=>{const t=l.get(e.name)??[];return{...e,fields:()=>({...e.fields(),...N(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[qi]:e=>{const t=u.get(e.name)??[];return{...e,values:()=>({...e.values(),...w(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[ji]:e=>{const t=o.get(e.name)??[];let n=e.specifiedByURL;for(const e of t)n=to(e)??n;return{...e,specifiedByURL:n,extensionASTNodes:e.extensionASTNodes.concat(t)}},[Ri]:e=>{const t=s.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...S(t)],fields:()=>({...e.fields(),...b(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[Pi]:e=>{const t=a.get(e.name)??[];return{...e,interfaces:()=>[...e.interfaces(),...S(t)],fields:()=>({...e.fields(),...b(t)}),extensionASTNodes:e.extensionASTNodes.concat(t)}},[Bi]:e=>{const t=c.get(e.name)??[];return{...e,types:()=>[...e.types(),...I(t)],extensionASTNodes:e.extensionASTNodes.concat(t)}}};function v(e){const t={};for(const n of e){const e=n.operationTypes??[];for(const n of e)t[n.operation]=y(n.type)}return t}function y(e){const r=e.name.value,i=t(r);return void 0!==i||n(0,`Unknown type: "${r}".`),i}function g(e){return e.kind===C?new GraphQLList(g(e.type)):e.kind===j?new GraphQLNonNull(g(e.type)):y(e)}function T(e){return new GraphQLDirective({name:e.name.value,description:e.description?.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:E(e.arguments),astNode:e})}function b(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e)t[n.name.value]={type:g(n.type),description:n.description?.value,args:E(n.arguments),deprecationReason:eo(n),astNode:n}}return t}function E(e){const t=e??[],n=Object.create(null);for(const e of t){const t=g(e.type);n[e.name.value]={type:t,description:e.description?.value,default:e.defaultValue&&{literal:e.defaultValue},deprecationReason:eo(e),astNode:e}}return n}function N(e){const t=Object.create(null);for(const n of e){const e=n.fields??[];for(const n of e){const e=g(n.type);t[n.name.value]={type:e,description:n.description?.value,default:n.defaultValue&&{literal:n.defaultValue},deprecationReason:eo(n),astNode:n}}}return t}function w(e){const t=Object.create(null);for(const n of e){const e=n.values??[];for(const n of e)t[n.name.value]={description:n.description?.value,deprecationReason:eo(n),astNode:n}}return t}function S(e){return e.flatMap(e=>e.interfaces?.map(y)??[])}function I(e){return e.flatMap(e=>e.types?.map(y)??[])}function L(e){const t=e.name.value;switch(e.kind){case P:{const n=s.get(t)??[],r=[e,...n];return new GraphQLObjectType({name:t,description:e.description?.value,interfaces:()=>S(r),fields:()=>b(r),astNode:e,extensionASTNodes:n})}case J:{const n=a.get(t)??[],r=[e,...n];return new GraphQLInterfaceType({name:t,description:e.description?.value,interfaces:()=>S(r),fields:()=>b(r),astNode:e,extensionASTNodes:n})}case z:{const n=u.get(t)??[],r=[e,...n];return new GraphQLEnumType({name:t,description:e.description?.value,values:()=>w(r),astNode:e,extensionASTNodes:n})}case K:{const n=c.get(t)??[],r=[e,...n];return new GraphQLUnionType({name:t,description:e.description?.value,types:()=>I(r),astNode:e,extensionASTNodes:n})}case U:{const n=o.get(t)??[];return new GraphQLScalarType({name:t,description:e.description?.value,specifiedByURL:to(e),astNode:e,extensionASTNodes:n})}case H:{const r=l.get(t)??[],i=[e,...r];return new GraphQLInputObjectType({name:t,description:e.description?.value,fields:()=>N(i),astNode:e,extensionASTNodes:r,isOneOf:(n=e,Boolean(gi(Xn,n)))})}}var n}}):e}const Zi=new Map([...Mn,...vr].map(e=>[e.name,e]));function eo(e){const t=gi(Hn,e);return t?.reason}function to(e){const t=gi(Wn,e);return t?.url}function no(e){return function(e,t,r){const i=e.getDirectives().filter(t),o=Object.values(e.getTypeMap()).filter(r);return[io(e),...i.map(e=>function(e){return po(e)+`directive ${e}`+co(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e)),...o.map(e=>function(e){if(Pt(e))return function(e){return po(e)+`scalar ${e}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${$t({kind:_,value:e.specifiedByURL})})`}(e)}(e);if(Bt(e))return function(e){return po(e)+`type ${e}`+oo(e)+so(e)}(e);if(Jt(e))return function(e){return po(e)+`interface ${e}`+oo(e)+so(e)}(e);if(Kt(e))return function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return po(e)+`union ${e.name}`+n}(e);if(zt(e))return function(e){const t=e.getValues().map((e,t)=>po(e," ",!t)+" "+e.name+lo(e.deprecationReason));return po(e)+`enum ${e}`+ao(t)}(e);if(Yt(e))return function(e){const t=Object.values(e.getFields()).map((e,t)=>po(e," ",!t)+" "+uo(e));return po(e)+`input ${e}`+(e.isOneOf?" @oneOf":"")+ao(t)}(e);n(0,"Unexpected type: "+tt(e))}(e))].filter(Boolean).join("\n\n")}(e,e=>!er(e),ro)}function ro(e){return!Un(e)&&!yr(e)}function io(e){const t=e.getQueryType(),n=e.getMutationType(),r=e.getSubscriptionType();if(t||n||r)return null==e.description&&function(e){return e.getQueryType()==e.getType("Query")&&e.getMutationType()==e.getType("Mutation")&&e.getSubscriptionType()==e.getType("Subscription")}(e)?void 0:po(e)+"schema {\n"+(t?` query: ${t}\n`:"")+(n?` mutation: ${n}\n`:"")+(r?` subscription: ${r}\n`:"")+"}"}function oo(e){const t=e.getInterfaces();return t.length?" implements "+t.map(e=>e.name).join(" & "):""}function so(e){return ao(Object.values(e.getFields()).map((e,t)=>po(e," ",!t)+" "+e.name+co(e.args," ")+": "+String(e.type)+lo(e.deprecationReason)))}function ao(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function co(e,t=""){return 0===e.length?"":e.every(e=>null==e.description)?"("+e.map(uo).join(", ")+")":"(\n"+e.map((e,n)=>po(e," "+t,!n)+" "+t+uo(e)).join("\n")+"\n"+t+")"}function uo(e){let t=e.name+": "+String(e.type);const n=rr(e);return n&&(t+=` = ${$t(n)}`),t+lo(e.deprecationReason)}function lo(e){if(null==e)return"";if(e!==Yn){return` @deprecated(reason: ${$t({kind:_,value:e})})`}return" @deprecated"}function po(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+$t({kind:_,value:r,block:fe(r)}).replaceAll("\n","\n"+t)+"\n"}function fo(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:v,definitions:t}}const ho=[Jr];function mo(e){var t;const n=function(e){if(e)return function(t){const n=e;return{Field(e){var r;const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);n.includes(o)&&t.reportError(new GraphQLError(`Field name "${i}" is not allowed because it conflicts with generated object APIs. Please use an alias to change the field name.`,{nodes:e}))}}};return}(null===(t=e.disallowedFieldNames)||void 0===t?void 0:t.allFields),r=function(e){if(e)return function(t){const n=e;return{VariableDefinition(e){const r=e.variable.name.value,i=r.charAt(0).toLowerCase()+r.slice(1);n.includes(i)&&t.reportError(new GraphQLError(`Input Parameter name "${r}" is not allowed because it conflicts with generated object APIs.`,{nodes:e}))}}};return}(e.disallowedInputParameterNames);return[vo,yo,go,To,...n?[n]:[],...r?[r]:[],...Gi.filter(e=>!ho.includes(e))]}function vo(e){return{OperationDefinition:t=>(t.name||e.reportError(new GraphQLError("Apollo does not support anonymous operations because operation names are used during code generation. Please give this operation a name.",{nodes:t})),!1)}}function yo(e){return{Field(t){"__typename"==(t.alias&&t.alias.value)&&e.reportError(new GraphQLError("Apollo needs to be able to insert __typename when needed, so using it as an alias is not supported.",{nodes:t}))}}}function go(e){return{InlineFragment(t){if(t.directives)for(const n of t.directives)n.name.value==Kn.name&&null==t.typeCondition&&e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a type condition. Please add a type condition to this inline fragment.",{nodes:t}))}}}function To(e){return{InlineFragment(t){var n;if(t.directives)for(const r of t.directives)r.name.value!=Kn.name||(null===(n=r.arguments)||void 0===n?void 0:n.find(e=>"label"==e.name.value))||e.reportError(new GraphQLError("Apollo does not support deferred inline fragments without a 'label' argument. Please add a 'label' argument to the @defer directive on this inline fragment.",{nodes:t}))}}}function bo(e){return{kind:m,value:e}}function Eo(e){return{kind:_,value:e}}function No(e){return{kind:W,description:e.description?Eo(e.description):void 0,name:bo(e.name),repeatable:!1,locations:e.locations.map(e=>bo(e)),arguments:e.args.map(e=>function(e){return{kind:q,description:Eo(e.description),name:bo(e.name),type:wo(un(e.type))}}(e))}}function wo(e){return{kind:V,name:bo(e.name)}}function So(e){return{kind:j,type:e}}const Io={kind:W,description:Eo("A directive used by the Apollo iOS client to annotate operations or fragments that should be used exclusively for generating local cache mutations instead of as standard operations."),name:bo("apollo_client_ios_localCacheMutation"),repeatable:!1,locations:[bo("QUERY"),bo("MUTATION"),bo("SUBSCRIPTION"),bo("FRAGMENT_DEFINITION")]},Lo={kind:W,description:Eo("Attach extra information to a given type."),name:bo("typePolicy"),arguments:[{kind:q,description:Eo("A selection set containing fields used to compute the cache key of an object. Referenced fields must have non-nullable scalar types. Order is important."),name:bo("keyFields"),type:So(wo(Cn))}],repeatable:!1,locations:[bo("OBJECT"),bo("INTERFACE")]},ko={kind:W,description:Eo("A directive used by Apollo iOS to map query input data to cache keys of objects."),name:bo("fieldPolicy"),arguments:[{kind:q,description:Eo("The field you are setting the @fieldPolicy for."),name:bo("forField"),type:So(wo(Cn))},{kind:q,description:Eo("Set of fields used to compute the cache key."),name:bo("keyArgs"),type:So(wo(Cn))}],repeatable:!0,locations:[bo("OBJECT"),bo("INTERFACE")]},Oo={kind:W,description:Eo("A directive used by the Apollo iOS code generation engine to generate custom import statements in operation or fragment definition files. An import statement to import a module with the name provided in the `module` argument will be added to the generated definition file."),name:bo("import"),arguments:[{kind:q,description:Eo("The name of the module to import."),name:bo("module"),type:So(wo(Cn))}],repeatable:!0,locations:[bo("QUERY"),bo("MUTATION"),bo("SUBSCRIPTION"),bo("FRAGMENT_DEFINITION")]},_o=[Io,Oo,Lo,ko];const xo={kind:b,name:{kind:m,value:"__typename"}};class GraphQLSchemaValidationError extends Error{constructor(e){super(e.map(e=>e.message).join("\n\n")),this.validationErrors=e,this.name="GraphQLSchemaValidationError"}}function Do(e){const t=function(e,t,n=Fi){const r=[],i=new SDLValidationContext(e,t,e=>{r.push(e)});return _t(e,xt(n.map(e=>e(i)))),r}(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function $o(e){const t=br(e);if(0!==t.length)throw new GraphQLSchemaValidationError(t)}function Ao(e){return e.startsWith("__")}function Go(e){if(!e)return!1;for(const t of e)if(t.name.value==Io.name.value)return!0;return!1}const Fo={kind:b,name:{kind:m,value:"__typename"}};function Qo(e,t){return t&&(e=function(e){return _t(e,{enter:e=>e.kind!==T?void 0:{...e,selections:e.selections.filter(e=>!("Field"===e.kind&&"__typename"===e.name.value))},leave(e){if((e.kind===b||e.kind===I||e.kind===S)&&e.selectionSet)return{...e,selectionSet:{...e.selectionSet,selections:[xo,...e.selectionSet.selections]}}}})}(e)),_t(e,{SelectionSet:{leave:(e,t,n)=>d(n)&&![b,I].includes(n.kind)?e:function(e){const t=e.selections.find(e=>e.kind==Fo.kind&&e.name.value==Fo.name.value);return t?e:{...e,selections:[Fo,...e.selections]}}(e)},Field:{enter:e=>function(e){return e.name.value==Fo.name.value?{...e,alias:void 0,directives:void 0}:e}(e)},Directive:{enter:e=>function(e){const t=[Io,Oo];for(const n of t)if(e.name.value==n.name.value)return null;return e}(e)}})}function Vo(e){return null!=e}function Co(e){switch(e.kind){case L:return{kind:e.kind,value:e.name.value};case A:return{kind:e.kind,value:e.values.map(Co)};case G:return{kind:e.kind,value:e.fields.reduce((e,t)=>(e[t.name.value]=Co(t.value),e),{})};default:return e}}function jo(e){var t,n;return null===(n=null===(t=e.loc)||void 0===t?void 0:t.source)||void 0===n?void 0:n.name}function Ro(e,t,n,r,i){var o,s,a;const c=new Map;for(const e of t.definitions)e.kind===I&&c.set(e.name.value,e);const u=[],l=new Map,p=new Set,d=r,f=e.getQueryType();if(void 0===f)throw new GraphQLError("GraphQL Schema must contain a 'query' root type definition.",{});const h={queryType:f,mutationType:null!==(o=e.getMutationType())&&void 0!==o?o:void 0,subscriptionType:null!==(s=e.getSubscriptionType())&&void 0!==s?s:void 0};for(const e of t.definitions)e.kind===y&&u.push(g(e));for(const[e,t]of c.entries())l.set(e,T(t));return{rootTypes:h,operations:u,fragments:Array.from(l.values()),referencedTypes:Array.from(p.values()),schemaDocumentation:null!==(a=e.description)&&void 0!==a?a:void 0};function m(t){if(!p.has(t)){if(p.add(t),Jt(t)){const n=e.getPossibleTypes(t);t._implementingObjects=n;for(const e of n)d&&!v(e)||m(un(e))}if(Kt(t)){const e=t.getTypes();for(t of e)m(un(t))}if(Yt(t)&&function(e){const t=e.getFields();for(const e in t){m(un(t[e].type))}}(t),Bt(t))for(const e of t.getInterfaces())m(un(e))}}function v(e){var t,n;const r=Lo.name.value;for(const i of null!==(n=null===(t=e.astNode)||void 0===t?void 0:t.directives)&&void 0!==n?n:[])if(i.name.value===r)return!0;return!1}function g(t){var r;if(!t.name)throw new GraphQLError("Operations should be named",{nodes:t});const i=jo(t),o=t.name.value,s=t.operation,a=new Set,c=(t.variableDefinitions||[]).map(t=>{const n=t.variable.name.value,r=t.defaultValue?Co(t.defaultValue):void 0,i=Qr(e,t.type);if(!i)throw new GraphQLError(`Couldn't get type from type node "${t.type}"`,{nodes:t});return m(un(i)),{name:n,type:i,defaultValue:r}}),u=$t(Qo(t,n)),l=e.getRootType(s),[p]=null!==(r=O(t.directives))&&void 0!==r?r:[void 0,void 0];m(l);const d=N(t.selectionSet,l,a),f=Array.from(a.values());return Go(t.directives)&&E(f),{name:o,operationType:s,variables:c,rootType:l,selectionSet:d,directives:p,referencedFragments:f,source:u,filePath:i}}function T(t){var r;const i=t.name.value,o=jo(t),s=$t(Qo(t,n)),a=new Set,c=Qr(e,t.typeCondition),[u]=null!==(r=O(t.directives))&&void 0!==r?r:[void 0,void 0];m(un(c));const l=N(t.selectionSet,c,a),p=Array.from(a.values());return Go(t.directives)&&E(p),{name:i,filePath:o,source:s,typeCondition:c,selectionSet:l,directives:u,referencedFragments:p,overrideAsLocalCacheMutation:!1}}function E(e){e.forEach(e=>{e.overrideAsLocalCacheMutation=!0,E(e.referencedFragments)})}function N(t,n,r){return{parentType:n,selections:t.selections.map(t=>function(t,n,r){var o,s,a,u;const[p,d]=null!==(o=O(t.directives))&&void 0!==o?o:[void 0,void 0];switch(t.kind){case b:{const f=t.name.value;if("__typename"==f)return;const h=null===(s=t.alias)||void 0===s?void 0:s.value,v=function(e,t,n){return n===fr.name&&e.getQueryType()===t?fr:n===hr.name&&e.getQueryType()===t?hr:n===mr.name&&(Bt(t)||Jt(t)||Kt(t))?mr:Bt(t)||Jt(t)?t.getFields()[n]:void 0}(e,n,f);if(!v)throw new GraphQLError(`Cannot query field "${f}" on type "${String(n)}"`,{nodes:t});const y=v.type,g=un(v.type);m(un(g));const{description:E,deprecationReason:I}=v;let L={kind:"Field",name:f,alias:h,type:y,arguments:k(v,t.arguments),inclusionConditions:d,description:!Ao(f)&&E?E:void 0,deprecationReason:I||void 0,directives:p,fieldPolicyKeys:v._apolloFieldPolicies||void 0};function _(e,t,n){var r;if(t&&n){const i=(null!==(r=e.alias)&&void 0!==r?r:e.name).value,o=i.charAt(0).toLowerCase()+i.slice(1);if(null==t?void 0:t.includes(o))throw new GraphQLError(`Schema name "${n}" conflicts with name of a generated object API. Please choose a different schema name. Suggestions: "${n}Schema", "${n}GraphQL", "${n}API"`,{nodes:e})}}if(Ht(y)||Wt(y)&&Ht(y.ofType)?_(t,null===(a=i.disallowedFieldNames)||void 0===a?void 0:a.entityList,i.schemaNamespace):nn(g)&&_(t,null===(u=i.disallowedFieldNames)||void 0===u?void 0:u.entity,i.schemaNamespace),nn(g)){const x=t.selectionSet;if(!x)throw new GraphQLError(`Composite field "${f}" on type "${String(n)}" requires selection set`,{nodes:t});L.selectionSet=N(x,g,r)}return L}case S:{const D=t.typeCondition,$=D?Qr(e,D):n;return m($),{kind:"InlineFragment",selectionSet:N(t.selectionSet,$,r),inclusionConditions:d,directives:p}}case w:{const A=t.name.value,G=function(e){let t=l.get(e);if(t)return t;const n=c.get(e);return n?(c.delete(e),t=T(n),l.set(e,t),t):void 0}(A);if(!G)throw new GraphQLError(`Unknown fragment "${A}".`,{nodes:t.name});r.add(G);return{kind:"FragmentSpread",fragment:G,inclusionConditions:d,directives:p}}}}(t,n,r)).filter(Vo)}}function k(...e){const t=e[0].args;return e[1]&&e[1].length>0?e[1].map(e=>{var n;const r=e.name.value,i=t.find(t=>t.name===e.name.value),o=null==i?void 0:i.type;if(!o)throw new GraphQLError(`Cannot find directive argument type for argument "${r}".`,{nodes:[e]});return{name:r,value:Co(e.value),type:o,deprecationReason:null!==(n=i.deprecationReason)&&void 0!==n?n:void 0}}):void 0}function O(t){if(t&&t.length>0){const n=[],r=[];for(const i of t){const t=i.name.value,o=e.getDirective(t);if(!o)throw new GraphQLError(`Cannot find directive "${t}".`,{nodes:i});n.push({name:t,arguments:k(o,i.arguments)});const s=_(i,o);s&&r.push(s)}return[n,r.length>0?r:void 0]}}function _(e,t){var n;if("include"==t.name||"skip"==t.name){const r=null===(n=e.arguments)||void 0===n?void 0:n[0].value,i="skip"==t.name;switch(null==r?void 0:r.kind){case x:return i?r.value?"SKIPPED":"INCLUDED":r.value?"INCLUDED":"SKIPPED";case L:return{variable:r.name.value,isInverted:i};default:throw new GraphQLError('Conditional inclusion directive has invalid "if" argument.',{nodes:e})}}}}function Mo(e){return e.kind===W&&e.name.value===Kn.name}function Uo(){return{kind:v,definitions:[No(Kn)]}}const Po=Lo.name.value;function Bo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map(e=>JSON.stringify([e.name.value,Rt(e.value)])).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map(e=>JSON.stringify([e.name.value,Rt(e.value)])).sort().toString()}function qo(e){var t,n,r,i;if(Kt(e))return;for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const t=null===(n=r.directives)||void 0===n?void 0:n.find(e=>e.name.value===Po);if(t)return{directive:t,source:e}}let o;for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])if(t.name.value===Po){o={directive:t,source:e};break}if("getInterfaces"in e)for(const t of e.getInterfaces()){const n=qo(t);if(n)if(o){if(!Bo(o.directive,n.directive))throw o.source===e?new GraphQLError(`Type "${e.name}" has a @typePolicy directive which conflicts with the @typePolicy directive on interface "${n.source.name}".`,{nodes:e.astNode}):new GraphQLError(`Type "${e.name}" inherits conflicting @typePolicy directives from interfaces "${o.source.name}" and "${n.source.name}".`,{nodes:e.astNode})}else o=n}return o}function Jo(e){var t,n,r;const i=qo(e);if(!i)return[];const o=null===(r=null===(n=null===(t=i.directive)||void 0===t?void 0:t.arguments)||void 0===n?void 0:n.find(e=>"keyFields"===e.name.value))||void 0===r?void 0:r.value;if(!o||o.kind!==_)return[];const s=o.value.split(" ");return function(e,t){const{directive:n,source:r}=e;if(Kt(r))return;const i=Jt(r)?"interface":"object";var o=r.getFields();for(const e of t){if(!e)throw new GraphQLError("Key fields must be a space-separated list of identifiers.",{nodes:n});const t=o[e];if(!t)throw new GraphQLError(`Key field "${e}" does not exist on ${i} "${r.name}".`,{nodes:r.astNode?[r.astNode,n]:n});if(!Wt(t.type))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be non-nullable.`,{nodes:t.astNode?[t.astNode,n]:n});if(!Pt(t.type.ofType))throw new GraphQLError(`Key field "${e}" on ${i} "${r.name}" must be a scalar type, got ${t.type}.`,{nodes:t.astNode?[t.astNode,n]:n})}}(i,s),s}function Ko(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&(n._apolloKeyFields=Jo(n))}}const zo=ko.name.value;function Yo(e){const t=e.getTypeMap();for(const e in t){const n=t[e];(n instanceof GraphQLObjectType||n instanceof GraphQLInterfaceType)&&Ho(n)}}function Ho(e){var t,n,r,i;const o=Wo(e);if(!o||Kt(e))return;const s=e.getFields();for(const a of o){const o=null===(n=null===(t=a.arguments)||void 0===t?void 0:t.find(e=>"forField"===e.name.value))||void 0===n?void 0:n.value;let c;if((null==o?void 0:o.kind)===_&&(c=o.value),!c)throw new GraphQLError("@fieldPolicy directive must have a 'forField' value.",{nodes:a});const u=null===(i=null===(r=a.arguments)||void 0===r?void 0:r.find(e=>"keyArgs"===e.name.value))||void 0===i?void 0:i.value;let l=[];if((null==u?void 0:u.kind)===_){const e=u.value.split(/\s+/);l=[...new Set(e.filter(Boolean))]}if(0===l.length)throw new GraphQLError("'keyArgs' must be a space-separated list of identifiers.",{nodes:a});const p=s[c];if(!p)throw new GraphQLError(`Field "${c}" does not exist on type "${e.name}".`,{nodes:e.astNode?[e.astNode,a]:a});Zo(p,l),is(p),p._apolloFieldPolicies=l}}function Wo(e){var t,n,r,i;if(!Bt(e)&&!Jt(e))return;const o=[];for(const r of null!==(t=e.extensionASTNodes)&&void 0!==t?t:[]){const e=null===(n=r.directives)||void 0===n?void 0:n.find(e=>e.name.value===zo);e&&o.push(e)}for(const t of null!==(i=null===(r=e.astNode)||void 0===r?void 0:r.directives)&&void 0!==i?i:[])t.name.value===zo&&o.push(t);if("getInterfaces"in e)for(const t of e.getInterfaces()){const e=Wo(t);if(e)for(const t of e){var s=!1;for(const e of o)if(Xo(e,t)){s=!0;break}s||o.push(t)}}return o}function Xo(e,t){var n,r;return(null!==(n=e.arguments)&&void 0!==n?n:[]).map(e=>JSON.stringify([e.name.value,Rt(e.value)])).sort().toString()===(null!==(r=t.arguments)&&void 0!==r?r:[]).map(e=>JSON.stringify([e.name.value,Rt(e.value)])).sort().toString()}function Zo(e,t){for(const n of t)es(e,n)}function es(e,t){const n=t.split(".").filter(Boolean),[r,...i]=n,o=e.args.find(e=>e.name===r);if(!o)throw new GraphQLError(`@fieldPolicy key argument "${t}" does not exist as an input argument of field "${e.name}".`,{nodes:e.astNode});let s=ts(o.type);for(let n=0;n1)throw new GraphQLError("@fieldPolicy can only have at most 1 List type input parameter.",{nodes:e.astNode});if(t&&1!==n||!t&&0!==n)throw new GraphQLError("@fieldPolicy requires either both a List return type and exactly 1 List input parameter, or neither.",{nodes:e.astNode})}return e.GraphQLEnumType=GraphQLEnumType,e.GraphQLError=GraphQLError,e.GraphQLInputObjectType=GraphQLInputObjectType,e.GraphQLInterfaceType=GraphQLInterfaceType,e.GraphQLObjectType=GraphQLObjectType,e.GraphQLScalarType=GraphQLScalarType,e.GraphQLSchema=GraphQLSchema,e.GraphQLSchemaValidationError=GraphQLSchemaValidationError,e.GraphQLUnionType=GraphQLUnionType,e.Source=Source,e.compileDocument=function(e,t,n,r,i){return Ro(e,t,n,r,i)},e.loadSchemaFromSources=function(e){var t,n=new Array;for(const r of e)if(r.name.endsWith(".json")){if(t)throw new Error(`Schema search paths can only include one JSON schema definition.\n Found "${t.name} & "${r.name}".`);t=r}else n.push(it(r));var r=function(e){const t=_o.filter(t=>!e.definitions.some(e=>e.kind==W&&e.name.value==t.name.value));return fo([e,{kind:v,definitions:t}])}(fo(n));if(t){var i=function(e){let t=JSON.parse(e);t.data&&(t=t.data);const n=Vi(t);return n}(t.body);return r=function(e,t){const n=e.getDirective(Kn.name);return n?function(e,t){return e.isRepeatable===t.isRepeatable&&e.locations.slice(0).sort().toString()===t.locations.slice(0).sort().toString()&&e.args.map(e=>e.name).sort().toString()===t.args.map(e=>e.name).sort().toString()}(n,Kn)?t:(console.warn(`Unsupported ${n.name} directive found. It will be replaced with a supported definition instead.`),fo([t,Uo()])):fo([t,Uo()])}(i,r),Ko(i=function(e,t,n){gr(e);const r=e.toConfig(),i=Xi(r,t,n);return r===i?e:new GraphQLSchema(i)}(i,r,{assumeValid:!0})),Yo(i),$o(i),i}{Do(r=function(e){const t=e.definitions.find(Mo);if(!t)return fo([e,Uo()]);const n=t;if(!function(e,t){var n;return e.repeatable===t.isRepeatable&&e.locations.map(e=>e.value).sort().toString()===t.locations.slice(0).sort().toString()&&(null===(n=e.arguments)||void 0===n?void 0:n.map(e=>e.name.value).sort().toString())===t.args.map(e=>e.name).sort().toString()}(n,Kn))return console.warn(`Unsupported ${n.name.value} directive found. It will be replaced with a supported definition instead.`),{kind:v,definitions:e.definitions.filter(e=>Mo(e)?void 0:e).concat(No(Kn))};return e}(r));const e=function(e,t){const n=Xi({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...Zn.filter(e=>n.directives.every(t=>t.name!==e.name))];return new GraphQLSchema({...n,directives:r})}(r,{assumeValid:!0});return Ko(e),Yo(e),$o(e),e}},e.mergeDocuments=function(e){return fo(e)},e.parseOperationDocument=function(e){return it(e)},e.printSchemaToSDL=function(e){return no(e)},e.validateDocument=function(e,t,n){return Qi(e,t,mo(n))},e}({});"# \ No newline at end of file From caba123d0b6db412f34757b1b3910910144a1277 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Sat, 30 Aug 2025 02:18:15 -0400 Subject: [PATCH 13/35] npm update --- .../JavaScript/package-lock.json | 52 ++++++++----------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json index b702351e8..058903f85 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json @@ -504,20 +504,20 @@ "dev": true }, "node_modules/@emnapi/core": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.5.tgz", - "integrity": "sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.5.0.tgz", + "integrity": "sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg==", "dev": true, "optional": true, "dependencies": { - "@emnapi/wasi-threads": "1.0.4", + "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "node_modules/@emnapi/runtime": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.5.tgz", - "integrity": "sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.5.0.tgz", + "integrity": "sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==", "dev": true, "optional": true, "dependencies": { @@ -525,9 +525,9 @@ } }, "node_modules/@emnapi/wasi-threads": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.4.tgz", - "integrity": "sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", "dev": true, "optional": true, "dependencies": { @@ -1523,9 +1523,9 @@ ] }, "node_modules/@sinclair/typebox": { - "version": "0.34.40", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.40.tgz", - "integrity": "sha512-gwBNIP8ZAYev/ORDWW0QvxdwPXwxBtLsdsJgSc7eDIRt8ubP+rxUBzPsrwnu16fgEF8Bx4lh/+mvQvJzcTM6Kw==", + "version": "0.34.41", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.41.tgz", + "integrity": "sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==", "dev": true }, "node_modules/@sinonjs/commons": { @@ -2144,9 +2144,9 @@ } }, "node_modules/browserslist": { - "version": "4.25.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.3.tgz", - "integrity": "sha512-cDGv1kkDI4/0e5yON9yM5G/0A5u8sf5TnmdX5C9qHzI9PPu++sQ9zjm1k9NiOrf3riY4OkK0zSGqfvJyJsgCBQ==", + "version": "4.25.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.4.tgz", + "integrity": "sha512-4jYpcjabC606xJ3kw2QwGEZKX0Aw7sgQdZCvIK9dhVSPh76BKo+C+btT1RRofH7B+8iNpEbgGNVWiLki5q93yg==", "dev": true, "funding": [ { @@ -2163,8 +2163,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001735", - "electron-to-chromium": "^1.5.204", + "caniuse-lite": "^1.0.30001737", + "electron-to-chromium": "^1.5.211", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -2489,9 +2489,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.209", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.209.tgz", - "integrity": "sha512-Xoz0uMrim9ZETCQt8UgM5FxQF9+imA7PBpokoGcZloA1uw2LeHzTlip5cb5KOAsXZLjh/moN2vReN3ZjJmjI9A==", + "version": "1.5.211", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.211.tgz", + "integrity": "sha512-IGBvimJkotaLzFnwIVgW9/UD/AOJ2tByUmeOrtqBfACSbAw5b1G0XpvdaieKyc7ULmbwXVx+4e4Be8pOPBrYkw==", "dev": true }, "node_modules/emittery": { @@ -2776,7 +2776,6 @@ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, - "license": "MIT", "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.2", @@ -4029,7 +4028,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4074,8 +4072,7 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/node-int64": { "version": "0.4.0", @@ -4879,7 +4876,6 @@ "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.1.tgz", "integrity": "sha512-SaeUtjfpg9Uqu8IbeDKtdaS0g8lS6FT6OzM3ezrDfErPJPHNDo/Ey+VFGP1bQIDfagYDLyRpd7O15XpG1Es2Uw==", "dev": true, - "license": "MIT", "dependencies": { "bs-logger": "^0.2.6", "fast-json-stable-stringify": "^2.1.0", @@ -4995,7 +4991,6 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", "dev": true, - "license": "BSD-2-Clause", "optional": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -5116,8 +5111,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/wrap-ansi": { "version": "8.1.0", From 1fd7c08ec0f2a2ac83f22e831f912718fc42b8a4 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Sat, 30 Aug 2025 03:29:08 -0400 Subject: [PATCH 14/35] fixing npm issue --- .../Sources/GraphQLCompiler/JavaScript/package-lock.json | 6 +++--- .../Sources/GraphQLCompiler/JavaScript/package.json | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json index 058903f85..ba4f1a0b3 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json @@ -1215,9 +1215,9 @@ } }, "node_modules/@rollup/plugin-typescript": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", - "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==", + "version": "12.1.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.4.tgz", + "integrity": "sha512-s5Hx+EtN60LMlDBvl5f04bEiFZmAepk27Q+mr85L/00zPDn1jtzlTV6FWn81MaIwqfWzKxmOJrBWHU6vtQyedQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.1.0", diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json index aec70f0da..345b9dc00 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package.json @@ -21,7 +21,6 @@ "@rollup/plugin-typescript": "12.1.4", "@rollup/plugin-replace": "6.0.2", "@rollup/plugin-terser": "0.4.4", - "@rollup/plugin-typescript": "12.1.2", "@types/common-tags": "1.8.4", "@types/jest": "30.0.0", "common-tags": "1.8.2", From 0042f7e8b8c868a82e8ae42700cd3f9546cb2794 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 1 Sep 2025 01:31:15 -0400 Subject: [PATCH 15/35] Fix import statement --- apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift index 597908b31..2590b164f 100644 --- a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift +++ b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift @@ -1,5 +1,7 @@ import Foundation +#if !COCOAPODS import ApolloAPI +#endif enum FieldPolicyResult { case single(CacheKeyInfo) From a6cc1ec1394935adb18eb13ed391721d3e9c01e1 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 1 Sep 2025 02:06:01 -0400 Subject: [PATCH 16/35] Updating github actions macos runner version Github actions migrated their mac runners to use macos-15 as the latest image now, which doesn't support Xcode 15.4, need to specify macos-14 runners until we are ready to drop Xcode 15.4 --- .github/workflows/ci-tests.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 1415138ae..5c8f3f677 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -40,7 +40,7 @@ jobs: - '.tuist-version' tuist-generation: - runs-on: macos-latest + runs-on: macos-14 needs: [changes] if: ${{ needs.changes.outputs.ios == 'true' || needs.changes.outputs.codegen == 'true' || needs.changes.outputs.pagination == 'true' || needs.changes.outputs.tuist == 'true' }} timeout-minutes: 8 @@ -63,7 +63,7 @@ jobs: key: ${{ github.run_id }}-dependencies run-swift-builds: - runs-on: macos-latest + runs-on: macos-14 timeout-minutes: 15 strategy: fail-fast: false @@ -85,7 +85,7 @@ jobs: cd ${{ matrix.package }} && swift build build-and-unit-test: - runs-on: macos-latest + runs-on: macos-14 needs: [tuist-generation, changes] timeout-minutes: 20 strategy: @@ -189,7 +189,7 @@ jobs: TestResults/ResultBundle.zip run-codegen-test-configurations: - runs-on: macos-latest + runs-on: macos-14 timeout-minutes: 20 name: Codegen Test Configurations - macOS steps: @@ -204,7 +204,7 @@ jobs: ./scripts/run-test-codegen-configurations.sh -t verify-frontend-bundle-latest: - runs-on: macos-latest + runs-on: macos-14 needs: [changes] if: ${{ needs.changes.outputs.codegen == 'true' }} timeout-minutes: 5 @@ -222,7 +222,7 @@ jobs: git diff --exit-code verify-cli-binary-archive: - runs-on: macos-latest + runs-on: macos-14 needs: [changes] if: ${{ needs.changes.outputs.codegen == 'true' }} timeout-minutes: 5 @@ -240,7 +240,7 @@ jobs: run: ./cli-version-check.sh run-cocoapods-integration-tests: - runs-on: macos-latest + runs-on: macos-14 timeout-minutes: 20 name: Cocoapods Integration Tests - macOS steps: From 2ccc6cc25647fbb85683b3948af5e2fc907d991f Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 1 Sep 2025 13:21:20 -0400 Subject: [PATCH 17/35] Updating FieldPolicyProvider handling --- .../MockSchemaMetadata.swift | 4 ++++ .../CacheDataExecutionSource.swift | 4 ++-- .../Sources/Apollo/FieldPolicyEvaluator.swift | 19 +++++++++++++------ .../Sources/ApolloAPI/SchemaMetadata.swift | 7 +++++++ 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index dce9a7bb9..4828d37f3 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -21,6 +21,10 @@ public class MockSchemaMetadata: SchemaMetadata { public static var objectTypeForTypeName: ((String) -> Object?)? { _objectTypeForTypeName } + + public static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { + SchemaConfiguration.self + } @MainActor public static func stub_objectTypeForTypeName(_ stub: ((String) -> Object?)?) { diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 9bc294651..9350e0250 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -75,7 +75,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { ) throws -> AnyHashable? { let fieldPolicyEvaluator = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables) if let fieldPolicyResult = resolveProgrammaticFieldPolicy(with: info, and: info.field.type) ?? - fieldPolicyEvaluator.resolveFieldPolicy(), + fieldPolicyEvaluator?.resolveFieldPolicy(), let returnTypename = typename(for: info.field) { switch fieldPolicyResult { @@ -94,7 +94,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, and type: Selection.Field.OutputType ) -> FieldPolicyResult? { - guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { + guard let provider = info.parentInfo.schema.fieldPolicyProvider else { return nil } diff --git a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift index 2590b164f..6c8429229 100644 --- a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift +++ b/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift @@ -10,22 +10,29 @@ enum FieldPolicyResult { struct FieldPolicyEvaluator { let field: Selection.Field + let fieldPolicy: Selection.FieldPolicy + let arguments: [String: InputValue] let variables: GraphQLOperation.Variables? - init( + init?( field: Selection.Field, variables: GraphQLOperation.Variables? ) { self.field = field self.variables = variables - } - - func resolveFieldPolicy() -> FieldPolicyResult? { - guard let fieldPolicy = field.fieldPolicy, - let arguments = field.arguments else { + + guard let fieldPolicy = field.fieldPolicy else { return nil } + self.fieldPolicy = fieldPolicy + guard let arguments = field.arguments else { + return nil + } + self.arguments = arguments + } + + func resolveFieldPolicy() -> FieldPolicyResult? { let keyArgs = parseKeyArgs(for: fieldPolicy) var singleValueArgs = [String?](repeating: nil, count: keyArgs.count) diff --git a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift index bd0de16f6..2be5a917c 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift @@ -9,6 +9,9 @@ public protocol SchemaMetadata { /// A ``SchemaConfiguration`` that provides custom configuration for the generated GraphQL schema. static var configuration: any SchemaConfiguration.Type { get } + + /// An optional ``FieldPolicyProvider`` that provides custom cache key configuration. + static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { get } /// Maps each object in a `GraphQLResponse` to the ``Object`` type representing the /// response object. @@ -25,6 +28,10 @@ public protocol SchemaMetadata { extension SchemaMetadata { + /// Default implementation for `fieldPolicyProvider` always returns nil. This is an opt-in feature + /// that users can override to provide the correct type. + public static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { nil } + /// A convenience function for getting the ``Object`` type representing a response object. /// /// Calls the ``objectType(forTypename:)`` function with the value of the objects `__typename` From aca4733f14a5dc3ed8d02b0764623f7c4fc41eba Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 1 Sep 2025 14:00:32 -0400 Subject: [PATCH 18/35] Reverting changes --- Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift | 4 ---- .../Apollo/ExecutionSources/CacheDataExecutionSource.swift | 4 ++-- apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift | 7 ------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index 4828d37f3..dce9a7bb9 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -21,10 +21,6 @@ public class MockSchemaMetadata: SchemaMetadata { public static var objectTypeForTypeName: ((String) -> Object?)? { _objectTypeForTypeName } - - public static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { - SchemaConfiguration.self - } @MainActor public static func stub_objectTypeForTypeName(_ stub: ((String) -> Object?)?) { diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 9350e0250..9bc294651 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -75,7 +75,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { ) throws -> AnyHashable? { let fieldPolicyEvaluator = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables) if let fieldPolicyResult = resolveProgrammaticFieldPolicy(with: info, and: info.field.type) ?? - fieldPolicyEvaluator?.resolveFieldPolicy(), + fieldPolicyEvaluator.resolveFieldPolicy(), let returnTypename = typename(for: info.field) { switch fieldPolicyResult { @@ -94,7 +94,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, and type: Selection.Field.OutputType ) -> FieldPolicyResult? { - guard let provider = info.parentInfo.schema.fieldPolicyProvider else { + guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { return nil } diff --git a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift index 2be5a917c..bd0de16f6 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift @@ -9,9 +9,6 @@ public protocol SchemaMetadata { /// A ``SchemaConfiguration`` that provides custom configuration for the generated GraphQL schema. static var configuration: any SchemaConfiguration.Type { get } - - /// An optional ``FieldPolicyProvider`` that provides custom cache key configuration. - static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { get } /// Maps each object in a `GraphQLResponse` to the ``Object`` type representing the /// response object. @@ -28,10 +25,6 @@ public protocol SchemaMetadata { extension SchemaMetadata { - /// Default implementation for `fieldPolicyProvider` always returns nil. This is an opt-in feature - /// that users can override to provide the correct type. - public static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { nil } - /// A convenience function for getting the ``Object`` type representing a response object. /// /// Calls the ``objectType(forTypename:)`` function with the value of the objects `__typename` From cb8b36672748e44a8195126eca3e9a987ce0c1f4 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:47:21 -0400 Subject: [PATCH 19/35] Adding optional unwrap --- .../Apollo/ExecutionSources/CacheDataExecutionSource.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 9bc294651..56f6884ab 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -75,7 +75,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { ) throws -> AnyHashable? { let fieldPolicyEvaluator = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables) if let fieldPolicyResult = resolveProgrammaticFieldPolicy(with: info, and: info.field.type) ?? - fieldPolicyEvaluator.resolveFieldPolicy(), + fieldPolicyEvaluator?.resolveFieldPolicy(), let returnTypename = typename(for: info.field) { switch fieldPolicyResult { From bf593f4de5f708048c48abb5fb8178bb29141ba1 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:52:55 -0400 Subject: [PATCH 20/35] Increase test timeouts --- Tests/ApolloTests/Cache/WatchQueryTests.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/ApolloTests/Cache/WatchQueryTests.swift b/Tests/ApolloTests/Cache/WatchQueryTests.swift index f3fdee030..256dfe61a 100644 --- a/Tests/ApolloTests/Cache/WatchQueryTests.swift +++ b/Tests/ApolloTests/Cache/WatchQueryTests.swift @@ -87,7 +87,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher.fetch(cachePolicy: .fetchIgnoringCacheData) - wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: Self.defaultWaitTimeout) + wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: 4.0) } runActivity("Refetch from server") { _ in @@ -117,7 +117,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher.refetch() - wait(for: [serverRequestExpectation, refetchedWatcherResultExpectation], timeout: Self.defaultWaitTimeout) + wait(for: [serverRequestExpectation, refetchedWatcherResultExpectation], timeout: 4.0) } } @@ -616,7 +616,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher.fetch(cachePolicy: .fetchIgnoringCacheData) - wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: Self.defaultWaitTimeout) + wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: 4.0) } runActivity("Fetch other query with list of updated keys from server") { _ in @@ -659,7 +659,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { XCTAssertSuccessResult(result) } - wait(for: [serverRequestExpectation, otherFetchCompletedExpectation, updatedWatcherResultExpectation], timeout: Self.defaultWaitTimeout) + wait(for: [serverRequestExpectation, otherFetchCompletedExpectation, updatedWatcherResultExpectation], timeout: 4.0) } } From 07915bd255d9c277d795fc2d78bd8c4794694a02 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Wed, 3 Sep 2025 01:37:41 -0400 Subject: [PATCH 21/35] Addressing PR feedback --- .../MockSchemaMetadata.swift | 4 ++-- .../Sources/GraphQLCompiler/GraphQLSchema.swift | 16 ++++++++-------- .../CacheDataExecutionSource.swift | 5 ++--- ...swift => FieldPolicyDirectiveEvaluator.swift} | 2 +- .../Sources/ApolloAPI/FieldPolicyProvider.swift | 14 +++++++------- 5 files changed, 20 insertions(+), 21 deletions(-) rename apollo-ios/Sources/Apollo/{FieldPolicyEvaluator.swift => FieldPolicyDirectiveEvaluator.swift} (99%) diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index dce9a7bb9..d9064abc5 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -83,8 +83,8 @@ public class MockSchemaMetadata: SchemaMetadata { stub_cacheKeyForField_SingleReturn?(field, variables, path) } - public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { - stub_cacheKeyForField_ListReturn?(field, variables, path) + public static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + stub_cacheKeyForField_ListReturn?(listField, variables, path) } } } diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift b/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift index d16a0c0bc..c092b35ed 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/GraphQLSchema.swift @@ -64,7 +64,7 @@ public class GraphQLNamedType: } } -public final class GraphQLScalarType: GraphQLNamedType { +public final class GraphQLScalarType: GraphQLNamedType, @unchecked Sendable { public let specifiedByURL: String? public var isCustomScalar: Bool { @@ -95,7 +95,7 @@ public final class GraphQLScalarType: GraphQLNamedType { } -public final class GraphQLEnumType: GraphQLNamedType { +public final class GraphQLEnumType: GraphQLNamedType, @unchecked Sendable { public private(set) var values: [GraphQLEnumValue]! required init(_ jsValue: JSValue, bridge: isolated JavaScriptBridge) { @@ -151,7 +151,7 @@ public struct GraphQLEnumValue: JavaScriptObjectDecodable, GraphQLNamedItem { public typealias GraphQLInputFieldDictionary = OrderedDictionary -public final class GraphQLInputObjectType: GraphQLNamedType { +public final class GraphQLInputObjectType: GraphQLNamedType, @unchecked Sendable { public private(set) var fields: GraphQLInputFieldDictionary! public let isOneOf: Bool @@ -217,7 +217,7 @@ public class GraphQLInputField: JavaScriptObjectDecodable, GraphQLNamedItem { } } -public class GraphQLCompositeType: GraphQLNamedType { +public class GraphQLCompositeType: GraphQLNamedType, @unchecked Sendable { public override var debugDescription: String { "Type - \(name)" } @@ -233,7 +233,7 @@ public extension GraphQLInterfaceImplementingType { } } -public final class GraphQLObjectType: GraphQLCompositeType, GraphQLInterfaceImplementingType { +public final class GraphQLObjectType: GraphQLCompositeType, GraphQLInterfaceImplementingType, @unchecked Sendable { public private(set) var fields: [String: GraphQLField]! @@ -270,10 +270,10 @@ public final class GraphQLObjectType: GraphQLCompositeType, GraphQLInterfaceImpl } } -public class GraphQLAbstractType: GraphQLCompositeType { +public class GraphQLAbstractType: GraphQLCompositeType, @unchecked Sendable { } -public final class GraphQLInterfaceType: GraphQLAbstractType, GraphQLInterfaceImplementingType { +public final class GraphQLInterfaceType: GraphQLAbstractType, GraphQLInterfaceImplementingType, @unchecked Sendable { public private(set) var fields: [String: GraphQLField]! @@ -315,7 +315,7 @@ public final class GraphQLInterfaceType: GraphQLAbstractType, GraphQLInterfaceIm } } -public final class GraphQLUnionType: GraphQLAbstractType { +public final class GraphQLUnionType: GraphQLAbstractType, @unchecked Sendable { public let types: [GraphQLObjectType] required init(_ jsValue: JSValue, bridge: isolated JavaScriptBridge) { diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 56f6884ab..c6d959947 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -73,9 +73,8 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, on object: Record ) throws -> AnyHashable? { - let fieldPolicyEvaluator = FieldPolicyEvaluator(field: info.field, variables: info.parentInfo.variables) if let fieldPolicyResult = resolveProgrammaticFieldPolicy(with: info, and: info.field.type) ?? - fieldPolicyEvaluator?.resolveFieldPolicy(), + FieldPolicyDirectiveEvaluator(field: info.field, variables: info.parentInfo.variables)?.resolveFieldPolicy(), let returnTypename = typename(for: info.field) { switch fieldPolicyResult { @@ -102,7 +101,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { case .nonNull(let innerType): return resolveProgrammaticFieldPolicy(with: info, and: innerType) case .list(_): - if let keys = provider.cacheKeys( + if let keys = provider.cacheKeyList( for: info.field, variables: info.parentInfo.variables, path: info.responsePath diff --git a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift b/apollo-ios/Sources/Apollo/FieldPolicyDirectiveEvaluator.swift similarity index 99% rename from apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift rename to apollo-ios/Sources/Apollo/FieldPolicyDirectiveEvaluator.swift index 6c8429229..d7891bab9 100644 --- a/apollo-ios/Sources/Apollo/FieldPolicyEvaluator.swift +++ b/apollo-ios/Sources/Apollo/FieldPolicyDirectiveEvaluator.swift @@ -8,7 +8,7 @@ enum FieldPolicyResult { case list([CacheKeyInfo]) } -struct FieldPolicyEvaluator { +struct FieldPolicyDirectiveEvaluator { let field: Selection.Field let fieldPolicy: Selection.FieldPolicy let arguments: [String: InputValue] diff --git a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift index 4aa8c86f1..597572dec 100644 --- a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift +++ b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift @@ -3,9 +3,9 @@ /// This protocol should be applied to your existing ``SchemaConfiguration`` and provides a way to provide custom /// field policy cache keys in lieu of using the @fieldPolicy directive. public protocol FieldPolicyProvider { - /// The entry point for resolving a cache key to read an object from the `NormalizedCache` when executing an operation, - /// prior to attempting to fetch data from the network. - /// + /// The entry point for resolving a cache key to read an object from the `NormalizedCache` for a field + /// that returns a single object. + /// /// - Parameters: /// - field: The ``Selection.Field`` of the operation being executed. /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. @@ -13,13 +13,13 @@ public protocol FieldPolicyProvider { /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? - /// The entry point for resolving cache keys to read objects from the `NormalizedCache` when executing an operation, - /// prior to attempting to fetch data from the network. + /// The entry point for resolving cache keys to read objects from the `NormalizedCache` for a field + /// that returns a list of objects. /// /// - Parameters: /// - field: The ``Selection.Field`` of the operation being executed. /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. - /// - Returns: Aan array of ``CacheKeyInfo`` describing the computed cache keys. - static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? + /// - Returns: An array of ``CacheKeyInfo`` describing the computed cache keys. + static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? } From e901a3636e613d5938d23a415b4b01dd88ae07c4 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:48:58 -0400 Subject: [PATCH 22/35] Testing test timeout --- Tests/ApolloTests/Cache/WatchQueryTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/ApolloTests/Cache/WatchQueryTests.swift b/Tests/ApolloTests/Cache/WatchQueryTests.swift index 256dfe61a..cd61269b9 100644 --- a/Tests/ApolloTests/Cache/WatchQueryTests.swift +++ b/Tests/ApolloTests/Cache/WatchQueryTests.swift @@ -616,7 +616,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher.fetch(cachePolicy: .fetchIgnoringCacheData) - wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: 4.0) + wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: 200.0) } runActivity("Fetch other query with list of updated keys from server") { _ in @@ -659,7 +659,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { XCTAssertSuccessResult(result) } - wait(for: [serverRequestExpectation, otherFetchCompletedExpectation, updatedWatcherResultExpectation], timeout: 4.0) + wait(for: [serverRequestExpectation, otherFetchCompletedExpectation, updatedWatcherResultExpectation], timeout: 200.0) } } @@ -1919,7 +1919,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher!.fetch(cachePolicy: .fetchIgnoringCacheData) - wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: Self.defaultWaitTimeout) + wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: 200.0) } runActivity("make sure it gets released") { _ in From 99a5b103d00b86461b9e4c89c6d2dbb5ee311e81 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 12:16:24 -0400 Subject: [PATCH 23/35] Testing ci failures --- .../CacheDataExecutionSource.swift | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index c6d959947..48529ca3a 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -99,7 +99,27 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { switch type { case .nonNull(let innerType): - return resolveProgrammaticFieldPolicy(with: info, and: innerType) + switch innerType { + case .nonNull(_): + return nil + case .list(_): + if let keys = provider.cacheKeyList( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .list(keys) + } + default: + if let key = provider.cacheKey( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .single(key) + } + } +// return resolveProgrammaticFieldPolicy(with: info, and: innerType) case .list(_): if let keys = provider.cacheKeyList( for: info.field, From 8e26e695b12a5495e8ff111347d5981e5e34a8fa Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 13:01:39 -0400 Subject: [PATCH 24/35] Adjusting fieldpolicyprovider --- .../MockSchemaMetadata.swift | 2 ++ .../CacheDataExecutionSource.swift | 27 ++++--------------- .../Sources/ApolloAPI/SchemaMetadata.swift | 6 +++++ 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index d9064abc5..cd07d9085 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -10,6 +10,8 @@ public class MockSchemaMetadata: SchemaMetadata { public static var _configuration: SchemaConfiguration.Type = SchemaConfiguration.self public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + + public static let fieldPolicyProvider: (any FieldPolicyProvider.Type)? = SchemaConfiguration.self @MainActor private static let testObserver = TestObserver() { _ in diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 48529ca3a..64e75f451 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -93,33 +93,16 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, and type: Selection.Field.OutputType ) -> FieldPolicyResult? { - guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { +// guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { +// return nil +// } + guard let provider = info.parentInfo.schema.fieldPolicyProvider else { return nil } switch type { case .nonNull(let innerType): - switch innerType { - case .nonNull(_): - return nil - case .list(_): - if let keys = provider.cacheKeyList( - for: info.field, - variables: info.parentInfo.variables, - path: info.responsePath - ) { - return .list(keys) - } - default: - if let key = provider.cacheKey( - for: info.field, - variables: info.parentInfo.variables, - path: info.responsePath - ) { - return .single(key) - } - } -// return resolveProgrammaticFieldPolicy(with: info, and: innerType) + return resolveProgrammaticFieldPolicy(with: info, and: innerType) case .list(_): if let keys = provider.cacheKeyList( for: info.field, diff --git a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift index bd0de16f6..e350eeb18 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift @@ -9,6 +9,8 @@ public protocol SchemaMetadata { /// A ``SchemaConfiguration`` that provides custom configuration for the generated GraphQL schema. static var configuration: any SchemaConfiguration.Type { get } + + static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { get } /// Maps each object in a `GraphQLResponse` to the ``Object`` type representing the /// response object. @@ -25,6 +27,10 @@ public protocol SchemaMetadata { extension SchemaMetadata { + public static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { + nil + } + /// A convenience function for getting the ``Object`` type representing a response object. /// /// Calls the ``objectType(forTypename:)`` function with the value of the objects `__typename` From 5abe5d5fa5ebbf2e428dfbac7d201e5a9212b2c8 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 14:15:30 -0400 Subject: [PATCH 25/35] Changing protocol for field policy functions --- .../Sources/Schema/SchemaConfiguration.swift | 8 ++++ .../Sources/Schema/SchemaConfiguration.swift | 8 ++++ .../MockSchemaMetadata.swift | 12 +++--- Tests/ApolloTests/TestMockTests.swift | 2 +- .../CacheDataExecutionSource.swift | 4 +- .../ApolloAPI/FieldPolicyProvider.swift | 42 +++++++++---------- .../ApolloAPI/SchemaConfiguration.swift | 20 +++++++++ .../Sources/ApolloAPI/SchemaMetadata.swift | 6 --- 8 files changed, 64 insertions(+), 38 deletions(-) diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift index 7976ecf82..bc84ddc03 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift @@ -8,6 +8,14 @@ import ApolloAPI public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { + public static func cacheKey(for field: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { + return nil + } + + public static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + return nil + } + public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { // Implement this function to configure cache key resolution for your schema types. return nil diff --git a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift index 7976ecf82..bc84ddc03 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift @@ -8,6 +8,14 @@ import ApolloAPI public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { + public static func cacheKey(for field: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { + return nil + } + + public static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + return nil + } + public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { // Implement this function to configure cache key resolution for your schema types. return nil diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index cd07d9085..2bfd3f9fb 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -10,8 +10,6 @@ public class MockSchemaMetadata: SchemaMetadata { public static var _configuration: SchemaConfiguration.Type = SchemaConfiguration.self public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self - - public static let fieldPolicyProvider: (any FieldPolicyProvider.Type)? = SchemaConfiguration.self @MainActor private static let testObserver = TestObserver() { _ in @@ -70,7 +68,7 @@ public class MockSchemaMetadata: SchemaMetadata { return Object(typename: __typename, implementedInterfaces: []) } - public class SchemaConfiguration: ApolloAPI.SchemaConfiguration, ApolloAPI.FieldPolicyProvider { + public class SchemaConfiguration: ApolloAPI.SchemaConfiguration { static var stub_cacheKeyInfoForType_Object: ((Object, ObjectData) -> CacheKeyInfo?)? static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? @@ -141,8 +139,8 @@ public enum MockSchema1Configuration: SchemaConfiguration { return nil } - public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { - return nil + public static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + nil } } @@ -163,7 +161,7 @@ public enum MockSchema2Configuration: SchemaConfiguration { return nil } - public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { - return nil + public static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + nil } } diff --git a/Tests/ApolloTests/TestMockTests.swift b/Tests/ApolloTests/TestMockTests.swift index 54c905cfc..e413c926f 100644 --- a/Tests/ApolloTests/TestMockTests.swift +++ b/Tests/ApolloTests/TestMockTests.swift @@ -566,7 +566,7 @@ enum TestMockSchema: SchemaMetadata { return nil } - static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { return nil } } diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 64e75f451..1fe7eb2af 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -96,9 +96,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { // guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { // return nil // } - guard let provider = info.parentInfo.schema.fieldPolicyProvider else { - return nil - } + let provider = info.parentInfo.schema.configuration switch type { case .nonNull(let innerType): diff --git a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift index 597572dec..18773f4e9 100644 --- a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift +++ b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift @@ -2,24 +2,24 @@ /// /// This protocol should be applied to your existing ``SchemaConfiguration`` and provides a way to provide custom /// field policy cache keys in lieu of using the @fieldPolicy directive. -public protocol FieldPolicyProvider { - /// The entry point for resolving a cache key to read an object from the `NormalizedCache` for a field - /// that returns a single object. - /// - /// - Parameters: - /// - field: The ``Selection.Field`` of the operation being executed. - /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. - /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. - /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. - static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? - - /// The entry point for resolving cache keys to read objects from the `NormalizedCache` for a field - /// that returns a list of objects. - /// - /// - Parameters: - /// - field: The ``Selection.Field`` of the operation being executed. - /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. - /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. - /// - Returns: An array of ``CacheKeyInfo`` describing the computed cache keys. - static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? -} +//public protocol FieldPolicyProvider { +// /// The entry point for resolving a cache key to read an object from the `NormalizedCache` for a field +// /// that returns a single object. +// /// +// /// - Parameters: +// /// - field: The ``Selection.Field`` of the operation being executed. +// /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. +// /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. +// /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. +// static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? +// +// /// The entry point for resolving cache keys to read objects from the `NormalizedCache` for a field +// /// that returns a list of objects. +// /// +// /// - Parameters: +// /// - field: The ``Selection.Field`` of the operation being executed. +// /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. +// /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. +// /// - Returns: An array of ``CacheKeyInfo`` describing the computed cache keys. +// static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? +//} diff --git a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift index a448dea10..bdd1f3ef3 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift @@ -39,4 +39,24 @@ public protocol SchemaConfiguration { /// Represented as a ``ObjectData`` dictionary. /// - Returns: A ``CacheKeyInfo`` describing the computed cache key for the response object. static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? + + /// The entry point for resolving a cache key to read an object from the `NormalizedCache` for a field + /// that returns a single object. + /// + /// - Parameters: + /// - field: The ``Selection.Field`` of the operation being executed. + /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. + /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. + /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. + static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? + + /// The entry point for resolving cache keys to read objects from the `NormalizedCache` for a field + /// that returns a list of objects. + /// + /// - Parameters: + /// - field: The ``Selection.Field`` of the operation being executed. + /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. + /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. + /// - Returns: An array of ``CacheKeyInfo`` describing the computed cache keys. + static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? } diff --git a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift index e350eeb18..63f971dab 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift @@ -9,8 +9,6 @@ public protocol SchemaMetadata { /// A ``SchemaConfiguration`` that provides custom configuration for the generated GraphQL schema. static var configuration: any SchemaConfiguration.Type { get } - - static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { get } /// Maps each object in a `GraphQLResponse` to the ``Object`` type representing the /// response object. @@ -26,10 +24,6 @@ public protocol SchemaMetadata { } extension SchemaMetadata { - - public static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { - nil - } /// A convenience function for getting the ``Object`` type representing a response object. /// From 14d6702f30d93662e8c25ff55feb7f85e1239967 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 14:21:58 -0400 Subject: [PATCH 26/35] testing unit tests --- .../CacheDataExecutionSource.swift | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 1fe7eb2af..644cab12c 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -99,24 +99,26 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { let provider = info.parentInfo.schema.configuration switch type { - case .nonNull(let innerType): - return resolveProgrammaticFieldPolicy(with: info, and: innerType) - case .list(_): - if let keys = provider.cacheKeyList( - for: info.field, - variables: info.parentInfo.variables, - path: info.responsePath - ) { - return .list(keys) - } +// case .nonNull(let innerType): +// return resolveProgrammaticFieldPolicy(with: info, and: innerType) +// case .list(_): +// if let keys = provider.cacheKeyList( +// for: info.field, +// variables: info.parentInfo.variables, +// path: info.responsePath +// ) { +// return .list(keys) +// } +// default: +// if let key = provider.cacheKey( +// for: info.field, +// variables: info.parentInfo.variables, +// path: info.responsePath +// ) { +// return .single(key) +// } default: - if let key = provider.cacheKey( - for: info.field, - variables: info.parentInfo.variables, - path: info.responsePath - ) { - return .single(key) - } + return nil } return nil } From 1d25c20979e039bab99b944b56043cc84c2f2ec1 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 14:29:04 -0400 Subject: [PATCH 27/35] Adjusting for tests --- .../CacheDataExecutionSource.swift | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 644cab12c..dea8a5520 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -108,17 +108,15 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { // path: info.responsePath // ) { // return .list(keys) -// } -// default: -// if let key = provider.cacheKey( -// for: info.field, -// variables: info.parentInfo.variables, -// path: info.responsePath -// ) { -// return .single(key) // } default: - return nil + if let key = provider.cacheKey( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .single(key) + } } return nil } From eb2a2c938953638dd97112a1576514b6e5a4d45f Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:27:22 -0400 Subject: [PATCH 28/35] Revert "Adjusting for tests" This reverts commit 1d25c20979e039bab99b944b56043cc84c2f2ec1. --- .../CacheDataExecutionSource.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index dea8a5520..644cab12c 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -108,15 +108,17 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { // path: info.responsePath // ) { // return .list(keys) +// } +// default: +// if let key = provider.cacheKey( +// for: info.field, +// variables: info.parentInfo.variables, +// path: info.responsePath +// ) { +// return .single(key) // } default: - if let key = provider.cacheKey( - for: info.field, - variables: info.parentInfo.variables, - path: info.responsePath - ) { - return .single(key) - } + return nil } return nil } From 5d5199f515f30bc5b485f144d8f61753e3f05748 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:27:25 -0400 Subject: [PATCH 29/35] Revert "testing unit tests" This reverts commit 14d6702f30d93662e8c25ff55feb7f85e1239967. --- .../CacheDataExecutionSource.swift | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 644cab12c..1fe7eb2af 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -99,26 +99,24 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { let provider = info.parentInfo.schema.configuration switch type { -// case .nonNull(let innerType): -// return resolveProgrammaticFieldPolicy(with: info, and: innerType) -// case .list(_): -// if let keys = provider.cacheKeyList( -// for: info.field, -// variables: info.parentInfo.variables, -// path: info.responsePath -// ) { -// return .list(keys) -// } -// default: -// if let key = provider.cacheKey( -// for: info.field, -// variables: info.parentInfo.variables, -// path: info.responsePath -// ) { -// return .single(key) -// } + case .nonNull(let innerType): + return resolveProgrammaticFieldPolicy(with: info, and: innerType) + case .list(_): + if let keys = provider.cacheKeyList( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .list(keys) + } default: - return nil + if let key = provider.cacheKey( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .single(key) + } } return nil } From cabc2642132aa840f7e9001190fc6000ebe9677b Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:27:27 -0400 Subject: [PATCH 30/35] Revert "Changing protocol for field policy functions" This reverts commit 5abe5d5fa5ebbf2e428dfbac7d201e5a9212b2c8. --- .../Sources/Schema/SchemaConfiguration.swift | 8 ---- .../Sources/Schema/SchemaConfiguration.swift | 8 ---- .../MockSchemaMetadata.swift | 12 +++--- Tests/ApolloTests/TestMockTests.swift | 2 +- .../CacheDataExecutionSource.swift | 4 +- .../ApolloAPI/FieldPolicyProvider.swift | 42 +++++++++---------- .../ApolloAPI/SchemaConfiguration.swift | 20 --------- .../Sources/ApolloAPI/SchemaMetadata.swift | 6 +++ 8 files changed, 38 insertions(+), 64 deletions(-) diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift index bc84ddc03..7976ecf82 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Schema/SchemaConfiguration.swift @@ -8,14 +8,6 @@ import ApolloAPI public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { - public static func cacheKey(for field: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { - return nil - } - - public static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - return nil - } - public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { // Implement this function to configure cache key resolution for your schema types. return nil diff --git a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift index bc84ddc03..7976ecf82 100644 --- a/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift +++ b/Sources/UploadAPI/UploadAPI/Sources/Schema/SchemaConfiguration.swift @@ -8,14 +8,6 @@ import ApolloAPI public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration { - public static func cacheKey(for field: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> ApolloAPI.CacheKeyInfo? { - return nil - } - - public static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - return nil - } - public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { // Implement this function to configure cache key resolution for your schema types. return nil diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index 2bfd3f9fb..cd07d9085 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -10,6 +10,8 @@ public class MockSchemaMetadata: SchemaMetadata { public static var _configuration: SchemaConfiguration.Type = SchemaConfiguration.self public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + + public static let fieldPolicyProvider: (any FieldPolicyProvider.Type)? = SchemaConfiguration.self @MainActor private static let testObserver = TestObserver() { _ in @@ -68,7 +70,7 @@ public class MockSchemaMetadata: SchemaMetadata { return Object(typename: __typename, implementedInterfaces: []) } - public class SchemaConfiguration: ApolloAPI.SchemaConfiguration { + public class SchemaConfiguration: ApolloAPI.SchemaConfiguration, ApolloAPI.FieldPolicyProvider { static var stub_cacheKeyInfoForType_Object: ((Object, ObjectData) -> CacheKeyInfo?)? static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? @@ -139,8 +141,8 @@ public enum MockSchema1Configuration: SchemaConfiguration { return nil } - public static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - nil + public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + return nil } } @@ -161,7 +163,7 @@ public enum MockSchema2Configuration: SchemaConfiguration { return nil } - public static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { - nil + public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + return nil } } diff --git a/Tests/ApolloTests/TestMockTests.swift b/Tests/ApolloTests/TestMockTests.swift index e413c926f..54c905cfc 100644 --- a/Tests/ApolloTests/TestMockTests.swift +++ b/Tests/ApolloTests/TestMockTests.swift @@ -566,7 +566,7 @@ enum TestMockSchema: SchemaMetadata { return nil } - static func cacheKeyList(for listField: ApolloAPI.Selection.Field, variables: [String : any ApolloAPI.GraphQLOperationVariableValue]?, path: ApolloAPI.ResponsePath) -> [ApolloAPI.CacheKeyInfo]? { + static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { return nil } } diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 1fe7eb2af..64e75f451 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -96,7 +96,9 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { // guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { // return nil // } - let provider = info.parentInfo.schema.configuration + guard let provider = info.parentInfo.schema.fieldPolicyProvider else { + return nil + } switch type { case .nonNull(let innerType): diff --git a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift index 18773f4e9..597572dec 100644 --- a/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift +++ b/apollo-ios/Sources/ApolloAPI/FieldPolicyProvider.swift @@ -2,24 +2,24 @@ /// /// This protocol should be applied to your existing ``SchemaConfiguration`` and provides a way to provide custom /// field policy cache keys in lieu of using the @fieldPolicy directive. -//public protocol FieldPolicyProvider { -// /// The entry point for resolving a cache key to read an object from the `NormalizedCache` for a field -// /// that returns a single object. -// /// -// /// - Parameters: -// /// - field: The ``Selection.Field`` of the operation being executed. -// /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. -// /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. -// /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. -// static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? -// -// /// The entry point for resolving cache keys to read objects from the `NormalizedCache` for a field -// /// that returns a list of objects. -// /// -// /// - Parameters: -// /// - field: The ``Selection.Field`` of the operation being executed. -// /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. -// /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. -// /// - Returns: An array of ``CacheKeyInfo`` describing the computed cache keys. -// static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? -//} +public protocol FieldPolicyProvider { + /// The entry point for resolving a cache key to read an object from the `NormalizedCache` for a field + /// that returns a single object. + /// + /// - Parameters: + /// - field: The ``Selection.Field`` of the operation being executed. + /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. + /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. + /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. + static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? + + /// The entry point for resolving cache keys to read objects from the `NormalizedCache` for a field + /// that returns a list of objects. + /// + /// - Parameters: + /// - field: The ``Selection.Field`` of the operation being executed. + /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. + /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. + /// - Returns: An array of ``CacheKeyInfo`` describing the computed cache keys. + static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? +} diff --git a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift index bdd1f3ef3..a448dea10 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaConfiguration.swift @@ -39,24 +39,4 @@ public protocol SchemaConfiguration { /// Represented as a ``ObjectData`` dictionary. /// - Returns: A ``CacheKeyInfo`` describing the computed cache key for the response object. static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? - - /// The entry point for resolving a cache key to read an object from the `NormalizedCache` for a field - /// that returns a single object. - /// - /// - Parameters: - /// - field: The ``Selection.Field`` of the operation being executed. - /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. - /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. - /// - Returns: A ``CacheKeyInfo`` describing the computed cache key. - static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? - - /// The entry point for resolving cache keys to read objects from the `NormalizedCache` for a field - /// that returns a list of objects. - /// - /// - Parameters: - /// - field: The ``Selection.Field`` of the operation being executed. - /// - variables: Optional ``GraphQLOperation.Variables`` input values provided to the operation. - /// - path: The ``ResponsePath`` representing the path within operation to get to the given field. - /// - Returns: An array of ``CacheKeyInfo`` describing the computed cache keys. - static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? } diff --git a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift index 63f971dab..e350eeb18 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift @@ -9,6 +9,8 @@ public protocol SchemaMetadata { /// A ``SchemaConfiguration`` that provides custom configuration for the generated GraphQL schema. static var configuration: any SchemaConfiguration.Type { get } + + static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { get } /// Maps each object in a `GraphQLResponse` to the ``Object`` type representing the /// response object. @@ -24,6 +26,10 @@ public protocol SchemaMetadata { } extension SchemaMetadata { + + public static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { + nil + } /// A convenience function for getting the ``Object`` type representing a response object. /// From 9123eb5629f514b556ed8b3e0dcae4bbf9406b45 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:27:50 -0400 Subject: [PATCH 31/35] Revert "Adjusting fieldpolicyprovider" This reverts commit 8e26e695b12a5495e8ff111347d5981e5e34a8fa. --- .../MockSchemaMetadata.swift | 2 -- .../CacheDataExecutionSource.swift | 27 +++++++++++++++---- .../Sources/ApolloAPI/SchemaMetadata.swift | 6 ----- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index cd07d9085..d9064abc5 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -10,8 +10,6 @@ public class MockSchemaMetadata: SchemaMetadata { public static var _configuration: SchemaConfiguration.Type = SchemaConfiguration.self public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self - - public static let fieldPolicyProvider: (any FieldPolicyProvider.Type)? = SchemaConfiguration.self @MainActor private static let testObserver = TestObserver() { _ in diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 64e75f451..48529ca3a 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -93,16 +93,33 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { with info: FieldExecutionInfo, and type: Selection.Field.OutputType ) -> FieldPolicyResult? { -// guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { -// return nil -// } - guard let provider = info.parentInfo.schema.fieldPolicyProvider else { + guard let provider = info.parentInfo.schema.configuration.self as? (any FieldPolicyProvider.Type) else { return nil } switch type { case .nonNull(let innerType): - return resolveProgrammaticFieldPolicy(with: info, and: innerType) + switch innerType { + case .nonNull(_): + return nil + case .list(_): + if let keys = provider.cacheKeyList( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .list(keys) + } + default: + if let key = provider.cacheKey( + for: info.field, + variables: info.parentInfo.variables, + path: info.responsePath + ) { + return .single(key) + } + } +// return resolveProgrammaticFieldPolicy(with: info, and: innerType) case .list(_): if let keys = provider.cacheKeyList( for: info.field, diff --git a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift index e350eeb18..bd0de16f6 100644 --- a/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift +++ b/apollo-ios/Sources/ApolloAPI/SchemaMetadata.swift @@ -9,8 +9,6 @@ public protocol SchemaMetadata { /// A ``SchemaConfiguration`` that provides custom configuration for the generated GraphQL schema. static var configuration: any SchemaConfiguration.Type { get } - - static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { get } /// Maps each object in a `GraphQLResponse` to the ``Object`` type representing the /// response object. @@ -27,10 +25,6 @@ public protocol SchemaMetadata { extension SchemaMetadata { - public static var fieldPolicyProvider: (any FieldPolicyProvider.Type)? { - nil - } - /// A convenience function for getting the ``Object`` type representing a response object. /// /// Calls the ``objectType(forTypename:)`` function with the value of the objects `__typename` From 2a6d9a72970fca049b661cb4a610ef131a7460d4 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:28:31 -0400 Subject: [PATCH 32/35] More ci testing --- .../MockSchemaMetadata.swift | 60 +- .../ApolloTests/Cache/FieldPolicyTests.swift | 2580 ++++++++--------- 2 files changed, 1320 insertions(+), 1320 deletions(-) diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index d9064abc5..6350f1f19 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -40,25 +40,25 @@ public class MockSchemaMetadata: SchemaMetadata { } } - @MainActor - public static func stub_cacheKeyForField_SingleReturn( - _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? - ) { - _configuration.stub_cacheKeyForField_SingleReturn = stub - if stub != nil { - testObserver.start() - } - } - - @MainActor - public static func stub_cacheKeyForField_ListReturn( - _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? - ) { - _configuration.stub_cacheKeyForField_ListReturn = stub - if stub != nil { - testObserver.start() - } - } +// @MainActor +// public static func stub_cacheKeyForField_SingleReturn( +// _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? +// ) { +// _configuration.stub_cacheKeyForField_SingleReturn = stub +// if stub != nil { +// testObserver.start() +// } +// } +// +// @MainActor +// public static func stub_cacheKeyForField_ListReturn( +// _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? +// ) { +// _configuration.stub_cacheKeyForField_ListReturn = stub +// if stub != nil { +// testObserver.start() +// } +// } public static func objectType(forTypename __typename: String) -> Object? { if let stub = objectTypeForTypeName { @@ -68,24 +68,24 @@ public class MockSchemaMetadata: SchemaMetadata { return Object(typename: __typename, implementedInterfaces: []) } - public class SchemaConfiguration: ApolloAPI.SchemaConfiguration, ApolloAPI.FieldPolicyProvider { + public class SchemaConfiguration: ApolloAPI.SchemaConfiguration/*, ApolloAPI.FieldPolicyProvider*/ { static var stub_cacheKeyInfoForType_Object: ((Object, ObjectData) -> CacheKeyInfo?)? - static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? - - static var stub_cacheKeyForField_ListReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? +// static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? +// +// static var stub_cacheKeyForField_ListReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { stub_cacheKeyInfoForType_Object?(type, object) } - public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { - stub_cacheKeyForField_SingleReturn?(field, variables, path) - } - - public static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { - stub_cacheKeyForField_ListReturn?(listField, variables, path) - } +// public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { +// stub_cacheKeyForField_SingleReturn?(field, variables, path) +// } +// +// public static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { +// stub_cacheKeyForField_ListReturn?(listField, variables, path) +// } } } diff --git a/Tests/ApolloTests/Cache/FieldPolicyTests.swift b/Tests/ApolloTests/Cache/FieldPolicyTests.swift index f51126bd5..6a6aa0f6f 100644 --- a/Tests/ApolloTests/Cache/FieldPolicyTests.swift +++ b/Tests/ApolloTests/Cache/FieldPolicyTests.swift @@ -1,1290 +1,1290 @@ -import XCTest -@testable import Apollo -import ApolloAPI -import ApolloInternalTestHelpers - -@MainActor -final class FieldPolicyTests: XCTestCase, CacheDependentTesting { - - var cacheType: any TestCacheProvider.Type { - InMemoryTestCacheProvider.self - } - - static let defaultWaitTimeout: TimeInterval = 1.0 - - var cache: (any NormalizedCache)! - var server: MockGraphQLServer! - var client: ApolloClient! - - override func setUp() async throws { - try await super.setUp() - - cache = try await makeNormalizedCache() - let store = ApolloStore(cache: cache) - - server = MockGraphQLServer() - let networkTransport = MockNetworkTransport(server: server, store: store) - - client = ApolloClient(networkTransport: networkTransport, store: store) - } - - override func tearDownWithError() throws { - cache = nil - server = nil - client = nil - - try super.tearDownWithError() - } - - // MARK: - Single Key Argument Tests - - func test_fieldPolicy_withStringKeyArgument_resolvesCorrectCacheKey() throws { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["name": .variable("name")], fieldPolicy: .init(keyArgs: ["name"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["name": "Luke"] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], - "Hero:Luke": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withIntKeyArgument_resolvesCorrectCacheKey() throws { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["age": .variable("age")], fieldPolicy: .init(keyArgs: ["age"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["age": 19] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:19": CacheReference("Hero:19")], - "Hero:19": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withDoubleKeyArgument_resolvesCorrectCacheKey() throws { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["weight": .variable("weight")], fieldPolicy: .init(keyArgs: ["weight"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["weight": 175.2] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:175.2": CacheReference("Hero:175.2")], - "Hero:175.2": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withBoolKeyArgument_resolvesCorrectCacheKey() throws { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["isJedi"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["isJedi": true] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:true": CacheReference("Hero:true")], - "Hero:true": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withListKeyArgument_resolvesCorrectCacheKey() throws { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["names": .variable("names")], fieldPolicy: .init(keyArgs: ["names"])) - ]} - var heroes: [Hero] { __data["heroes"] } - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] - - mergeRecordsIntoCache([ - "QUERY_ROOT": [ - "Hero:Anakin": CacheReference("Hero:Anakin"), - "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), - "Hero:Ahsoka": CacheReference("Hero:Ahsoka") - ], - "Hero:Anakin": [ - "age": 23, - "isJedi": true, - "name": "Anakin", - "weight": 185.3, - "__typename": "Hero", - ], - "Hero:Obi-Wan": [ - "age": 30, - "isJedi": true, - "name": "Obi-Wan", - "weight": 179.7, - "__typename": "Hero", - ], - "Hero:Ahsoka": [ - "age": 17, - "isJedi": true, - "name": "Ahsoka", - "weight": 138.5, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - - XCTAssertEqual(data.heroes[0].name, "Anakin") - XCTAssertEqual(data.heroes[0].age, 23) - XCTAssertEqual(data.heroes[0].isJedi, true) - XCTAssertEqual(data.heroes[0].weight, 185.3) - - XCTAssertEqual(data.heroes[1].name, "Obi-Wan") - XCTAssertEqual(data.heroes[1].age, 30) - XCTAssertEqual(data.heroes[1].isJedi, true) - XCTAssertEqual(data.heroes[1].weight, 179.7) - - XCTAssertEqual(data.heroes[2].name, "Ahsoka") - XCTAssertEqual(data.heroes[2].age, 17) - XCTAssertEqual(data.heroes[2].isJedi, true) - XCTAssertEqual(data.heroes[2].weight, 138.5) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withObjectKeyArgument_resolvesCorrectCacheKey() { - struct HeroSearchInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init(name: String) { - __data = InputDict([ - "name": name - ]) - } - - public var name: String { - get { __data["name"] } - set { __data["name"] = newValue } - } - } - - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["input": HeroSearchInput(name: "Luke")] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], - "Hero:Luke": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withNestedObjectKeyArgument_resolvesCorrectCacheKey() { - struct NameInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init (name: String) { - __data = InputDict([ - "name": name - ]) - } - - public var name: String { - get { __data["name"] } - set { __data["name"] = newValue } - } - } - - struct HeroSearchInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init(nameInput: NameInput) { - __data = InputDict([ - "nameInput": nameInput - ]) - } - - public var nameInput: NameInput { - get { __data["nameInput"] } - set { __data["nameInput"] = newValue } - } - } - - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"))] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], - "Hero:Luke": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withNestedObjectListKeyArgument_resolvesCorrectCacheKey() { - struct NameInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init (names: [String]) { - __data = InputDict([ - "names": names - ]) - } - - public var names: [String] { - get { __data["names"] } - set { __data["names"] = newValue } - } - } - - struct HeroSearchInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init(nameInput: NameInput) { - __data = InputDict([ - "nameInput": nameInput - ]) - } - - public var nameInput: NameInput { - get { __data["nameInput"] } - set { __data["nameInput"] = newValue } - } - } - - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names"])) - ]} - var heroes: [Hero] { __data["heroes"] } - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]))] - - mergeRecordsIntoCache([ - "QUERY_ROOT": [ - "Hero:Anakin": CacheReference("Hero:Anakin"), - "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), - "Hero:Ahsoka": CacheReference("Hero:Ahsoka") - ], - "Hero:Anakin": [ - "age": 23, - "isJedi": true, - "name": "Anakin", - "weight": 185.3, - "__typename": "Hero", - ], - "Hero:Obi-Wan": [ - "age": 30, - "isJedi": true, - "name": "Obi-Wan", - "weight": 179.7, - "__typename": "Hero", - ], - "Hero:Ahsoka": [ - "age": 17, - "isJedi": true, - "name": "Ahsoka", - "weight": 138.5, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - - XCTAssertEqual(data.heroes[0].name, "Anakin") - XCTAssertEqual(data.heroes[0].age, 23) - XCTAssertEqual(data.heroes[0].isJedi, true) - XCTAssertEqual(data.heroes[0].weight, 185.3) - - XCTAssertEqual(data.heroes[1].name, "Obi-Wan") - XCTAssertEqual(data.heroes[1].age, 30) - XCTAssertEqual(data.heroes[1].isJedi, true) - XCTAssertEqual(data.heroes[1].weight, 179.7) - - XCTAssertEqual(data.heroes[2].name, "Ahsoka") - XCTAssertEqual(data.heroes[2].age, 17) - XCTAssertEqual(data.heroes[2].isJedi, true) - XCTAssertEqual(data.heroes[2].weight, 138.5) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - // MARK: - Multiple Key Argument Tests - - func test_fieldPolicy_withMultipleKeyArguments_resolvesCorrectCacheKey() { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["name", "age"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["name": "Luke", "age": 19] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:Luke+19": CacheReference("Hero:Luke+19")], - "Hero:Luke+19": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withMultipleKeyArguments_withDifferentOrder_resolvesCorrectCacheKey() { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["age", "name"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["name": "Luke", "age": 19] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:19+Luke": CacheReference("Hero:19+Luke")], - "Hero:19+Luke": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withMultipleKeyArguments_includingList_resolvesCorrectCacheKey() { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["names": .variable("names"), "isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["names", "isJedi"])) - ]} - var heroes: [Hero] { __data["heroes"] } - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"], "isJedi": true] - - mergeRecordsIntoCache([ - "QUERY_ROOT": [ - "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), - "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), - "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") - ], - "Hero:Anakin+true": [ - "age": 23, - "isJedi": true, - "name": "Anakin", - "weight": 185.3, - "__typename": "Hero", - ], - "Hero:Obi-Wan+true": [ - "age": 30, - "isJedi": true, - "name": "Obi-Wan", - "weight": 179.7, - "__typename": "Hero", - ], - "Hero:Ahsoka+true": [ - "age": 17, - "isJedi": true, - "name": "Ahsoka", - "weight": 138.5, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - - XCTAssertEqual(data.heroes[0].name, "Anakin") - XCTAssertEqual(data.heroes[0].age, 23) - XCTAssertEqual(data.heroes[0].isJedi, true) - XCTAssertEqual(data.heroes[0].weight, 185.3) - - XCTAssertEqual(data.heroes[1].name, "Obi-Wan") - XCTAssertEqual(data.heroes[1].age, 30) - XCTAssertEqual(data.heroes[1].isJedi, true) - XCTAssertEqual(data.heroes[1].weight, 179.7) - - XCTAssertEqual(data.heroes[2].name, "Ahsoka") - XCTAssertEqual(data.heroes[2].age, 17) - XCTAssertEqual(data.heroes[2].isJedi, true) - XCTAssertEqual(data.heroes[2].weight, 138.5) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withMultipleKeyArguments_includingObject_resolvesCorrectCacheKey() { - struct HeroSearchInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init( - name: String, - isJedi: Bool - ) { - __data = InputDict([ - "name": name, - "isJedi": true - ]) - } - - public var name: String { - get { __data["name"] } - set { __data["name"] = newValue } - } - - public var isJedi: Bool { - get { __data["isJedi"] } - set { __data["isJedi"] = newValue } - } - } - - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name", "input.isJedi"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["input": HeroSearchInput(name: "Luke", isJedi: true)] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], - "Hero:Luke+true": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withMultipleKeyArguments_includingNestedObject_resolvesCorrectCacheKey() { - struct NameInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init( - name: String - ) { - __data = InputDict([ - "name": name - ]) - } - - public var name: String { - get { __data["name"] } - set { __data["name"] = newValue } - } - } - - struct HeroSearchInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init( - nameInput: NameInput, - isJedi: Bool - ) { - __data = InputDict([ - "nameInput": nameInput, - "isJedi": isJedi - ]) - } - - public var nameInput: NameInput { - get { __data["nameInput"] } - set { __data["nameInput"] = newValue } - } - - public var isJedi: Bool { - get { __data["isJedi"] } - set { __data["isJedi"] = newValue } - } - } - - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name", "input.isJedi"])) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"), isJedi: true)] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], - "Hero:Luke+true": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_fieldPolicy_withMultipleKeyArguments_includingNestedObjectList_resolvesCorrectCacheKey() { - struct NameInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init (names: [String]) { - __data = InputDict([ - "names": names - ]) - } - - public var names: [String] { - get { __data["names"] } - set { __data["names"] = newValue } - } - } - - struct HeroSearchInput: InputObject { - public private(set) var __data: InputDict - - public init(_ data: InputDict) { - __data = data - } - - public init( - nameInput: NameInput, - isJedi: Bool - ) { - __data = InputDict([ - "nameInput": nameInput, - "isJedi": isJedi - ]) - } - - public var nameInput: NameInput { - get { __data["nameInput"] } - set { __data["nameInput"] = newValue } - } - - public var isJedi: Bool { - get { __data["isJedi"] } - set { __data["isJedi"] = newValue } - } - } - - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names", "input.isJedi"])) - ]} - var heroes: [Hero] { __data["heroes"] } - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - let query = MockQuery() - query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]), isJedi: true)] - - mergeRecordsIntoCache([ - "QUERY_ROOT": [ - "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), - "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), - "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") - ], - "Hero:Anakin+true": [ - "age": 23, - "isJedi": true, - "name": "Anakin", - "weight": 185.3, - "__typename": "Hero", - ], - "Hero:Obi-Wan+true": [ - "age": 30, - "isJedi": true, - "name": "Obi-Wan", - "weight": 179.7, - "__typename": "Hero", - ], - "Hero:Ahsoka+true": [ - "age": 17, - "isJedi": true, - "name": "Ahsoka", - "weight": 138.5, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - - XCTAssertEqual(data.heroes[0].name, "Anakin") - XCTAssertEqual(data.heroes[0].age, 23) - XCTAssertEqual(data.heroes[0].isJedi, true) - XCTAssertEqual(data.heroes[0].weight, 185.3) - - XCTAssertEqual(data.heroes[1].name, "Obi-Wan") - XCTAssertEqual(data.heroes[1].age, 30) - XCTAssertEqual(data.heroes[1].isJedi, true) - XCTAssertEqual(data.heroes[1].weight, 179.7) - - XCTAssertEqual(data.heroes[2].name, "Ahsoka") - XCTAssertEqual(data.heroes[2].age, 17) - XCTAssertEqual(data.heroes[2].isJedi, true) - XCTAssertEqual(data.heroes[2].weight, 138.5) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - // MARK: - FieldPolicyProvider Tests - - func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("hero", Hero.self, arguments: ["name": .variable("name")]) - ]} - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - MockSchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in - return CacheKeyInfo(id: "Luke") - } - - let query = MockQuery() - query.__variables = ["name": "Luke"] - - mergeRecordsIntoCache([ - "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], - "Hero:Luke": [ - "age": 19, - "isJedi": true, - "name": "Luke", - "weight": 175.2, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - XCTAssertEqual(data.hero?.name, "Luke") - XCTAssertEqual(data.hero?.age, 19) - XCTAssertEqual(data.hero?.isJedi, true) - XCTAssertEqual(data.hero?.weight, 175.2) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - - func test_schemaConfiguration_givenFieldPolicyProvider_returnsListOfCacheKeyInfo() throws { - class HeroSelectionSet: MockSelectionSet { - override class var __selections: [Selection] { [ - .field("heroes", [Hero].self, arguments: ["names": .variable("names")]) - ]} - var heroes: [Hero] { __data["heroes"] } - - class Hero: MockSelectionSet { - override class var __parentType: any ParentType { - Object(typename: "Hero", implementedInterfaces: []) - } - override class var __selections: [Selection] { [ - .field("__typename", String.self), - .field("age", Int.self), - .field("name", String.self), - .field("isJedi", Bool.self), - .field("weight", Double.self) - ]} - } - } - - MockSchemaMetadata.stub_cacheKeyForField_ListReturn { _, _, _ in - return [ - CacheKeyInfo(id: "Anakin"), - CacheKeyInfo(id: "Obi-Wan"), - CacheKeyInfo(id: "Ahsoka") - ] - } - - let query = MockQuery() - query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] - - mergeRecordsIntoCache([ - "QUERY_ROOT": [ - "Hero:Anakin": CacheReference("Hero:Anakin"), - "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), - "Hero:Ahsoka": CacheReference("Hero:Ahsoka") - ], - "Hero:Anakin": [ - "age": 23, - "isJedi": true, - "name": "Anakin", - "weight": 185.3, - "__typename": "Hero", - ], - "Hero:Obi-Wan": [ - "age": 30, - "isJedi": true, - "name": "Obi-Wan", - "weight": 179.7, - "__typename": "Hero", - ], - "Hero:Ahsoka": [ - "age": 17, - "isJedi": true, - "name": "Ahsoka", - "weight": 138.5, - "__typename": "Hero", - ] - ]) - - let resultObserver = makeResultObserver(for: query) - - let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in - try XCTAssertSuccessResult(result) { graphQLResult in - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertNil(graphQLResult.errors) - - let data = try XCTUnwrap(graphQLResult.data) - - XCTAssertEqual(data.heroes[0].name, "Anakin") - XCTAssertEqual(data.heroes[0].age, 23) - XCTAssertEqual(data.heroes[0].isJedi, true) - XCTAssertEqual(data.heroes[0].weight, 185.3) - - XCTAssertEqual(data.heroes[1].name, "Obi-Wan") - XCTAssertEqual(data.heroes[1].age, 30) - XCTAssertEqual(data.heroes[1].isJedi, true) - XCTAssertEqual(data.heroes[1].weight, 179.7) - - XCTAssertEqual(data.heroes[2].name, "Ahsoka") - XCTAssertEqual(data.heroes[2].age, 17) - XCTAssertEqual(data.heroes[2].isJedi, true) - XCTAssertEqual(data.heroes[2].weight, 138.5) - } - } - - client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) - - wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) - } - -} +//import XCTest +//@testable import Apollo +//import ApolloAPI +//import ApolloInternalTestHelpers +// +//@MainActor +//final class FieldPolicyTests: XCTestCase, CacheDependentTesting { +// +// var cacheType: any TestCacheProvider.Type { +// InMemoryTestCacheProvider.self +// } +// +// static let defaultWaitTimeout: TimeInterval = 1.0 +// +// var cache: (any NormalizedCache)! +// var server: MockGraphQLServer! +// var client: ApolloClient! +// +// override func setUp() async throws { +// try await super.setUp() +// +// cache = try await makeNormalizedCache() +// let store = ApolloStore(cache: cache) +// +// server = MockGraphQLServer() +// let networkTransport = MockNetworkTransport(server: server, store: store) +// +// client = ApolloClient(networkTransport: networkTransport, store: store) +// } +// +// override func tearDownWithError() throws { +// cache = nil +// server = nil +// client = nil +// +// try super.tearDownWithError() +// } +// +// // MARK: - Single Key Argument Tests +// +// func test_fieldPolicy_withStringKeyArgument_resolvesCorrectCacheKey() throws { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["name": .variable("name")], fieldPolicy: .init(keyArgs: ["name"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["name": "Luke"] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], +// "Hero:Luke": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withIntKeyArgument_resolvesCorrectCacheKey() throws { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["age": .variable("age")], fieldPolicy: .init(keyArgs: ["age"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["age": 19] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:19": CacheReference("Hero:19")], +// "Hero:19": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withDoubleKeyArgument_resolvesCorrectCacheKey() throws { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["weight": .variable("weight")], fieldPolicy: .init(keyArgs: ["weight"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["weight": 175.2] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:175.2": CacheReference("Hero:175.2")], +// "Hero:175.2": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withBoolKeyArgument_resolvesCorrectCacheKey() throws { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["isJedi"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["isJedi": true] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:true": CacheReference("Hero:true")], +// "Hero:true": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withListKeyArgument_resolvesCorrectCacheKey() throws { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("heroes", [Hero].self, arguments: ["names": .variable("names")], fieldPolicy: .init(keyArgs: ["names"])) +// ]} +// var heroes: [Hero] { __data["heroes"] } +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": [ +// "Hero:Anakin": CacheReference("Hero:Anakin"), +// "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), +// "Hero:Ahsoka": CacheReference("Hero:Ahsoka") +// ], +// "Hero:Anakin": [ +// "age": 23, +// "isJedi": true, +// "name": "Anakin", +// "weight": 185.3, +// "__typename": "Hero", +// ], +// "Hero:Obi-Wan": [ +// "age": 30, +// "isJedi": true, +// "name": "Obi-Wan", +// "weight": 179.7, +// "__typename": "Hero", +// ], +// "Hero:Ahsoka": [ +// "age": 17, +// "isJedi": true, +// "name": "Ahsoka", +// "weight": 138.5, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// +// XCTAssertEqual(data.heroes[0].name, "Anakin") +// XCTAssertEqual(data.heroes[0].age, 23) +// XCTAssertEqual(data.heroes[0].isJedi, true) +// XCTAssertEqual(data.heroes[0].weight, 185.3) +// +// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") +// XCTAssertEqual(data.heroes[1].age, 30) +// XCTAssertEqual(data.heroes[1].isJedi, true) +// XCTAssertEqual(data.heroes[1].weight, 179.7) +// +// XCTAssertEqual(data.heroes[2].name, "Ahsoka") +// XCTAssertEqual(data.heroes[2].age, 17) +// XCTAssertEqual(data.heroes[2].isJedi, true) +// XCTAssertEqual(data.heroes[2].weight, 138.5) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withObjectKeyArgument_resolvesCorrectCacheKey() { +// struct HeroSearchInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init(name: String) { +// __data = InputDict([ +// "name": name +// ]) +// } +// +// public var name: String { +// get { __data["name"] } +// set { __data["name"] = newValue } +// } +// } +// +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["input": HeroSearchInput(name: "Luke")] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], +// "Hero:Luke": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withNestedObjectKeyArgument_resolvesCorrectCacheKey() { +// struct NameInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init (name: String) { +// __data = InputDict([ +// "name": name +// ]) +// } +// +// public var name: String { +// get { __data["name"] } +// set { __data["name"] = newValue } +// } +// } +// +// struct HeroSearchInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init(nameInput: NameInput) { +// __data = InputDict([ +// "nameInput": nameInput +// ]) +// } +// +// public var nameInput: NameInput { +// get { __data["nameInput"] } +// set { __data["nameInput"] = newValue } +// } +// } +// +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"))] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], +// "Hero:Luke": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withNestedObjectListKeyArgument_resolvesCorrectCacheKey() { +// struct NameInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init (names: [String]) { +// __data = InputDict([ +// "names": names +// ]) +// } +// +// public var names: [String] { +// get { __data["names"] } +// set { __data["names"] = newValue } +// } +// } +// +// struct HeroSearchInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init(nameInput: NameInput) { +// __data = InputDict([ +// "nameInput": nameInput +// ]) +// } +// +// public var nameInput: NameInput { +// get { __data["nameInput"] } +// set { __data["nameInput"] = newValue } +// } +// } +// +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names"])) +// ]} +// var heroes: [Hero] { __data["heroes"] } +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]))] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": [ +// "Hero:Anakin": CacheReference("Hero:Anakin"), +// "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), +// "Hero:Ahsoka": CacheReference("Hero:Ahsoka") +// ], +// "Hero:Anakin": [ +// "age": 23, +// "isJedi": true, +// "name": "Anakin", +// "weight": 185.3, +// "__typename": "Hero", +// ], +// "Hero:Obi-Wan": [ +// "age": 30, +// "isJedi": true, +// "name": "Obi-Wan", +// "weight": 179.7, +// "__typename": "Hero", +// ], +// "Hero:Ahsoka": [ +// "age": 17, +// "isJedi": true, +// "name": "Ahsoka", +// "weight": 138.5, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// +// XCTAssertEqual(data.heroes[0].name, "Anakin") +// XCTAssertEqual(data.heroes[0].age, 23) +// XCTAssertEqual(data.heroes[0].isJedi, true) +// XCTAssertEqual(data.heroes[0].weight, 185.3) +// +// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") +// XCTAssertEqual(data.heroes[1].age, 30) +// XCTAssertEqual(data.heroes[1].isJedi, true) +// XCTAssertEqual(data.heroes[1].weight, 179.7) +// +// XCTAssertEqual(data.heroes[2].name, "Ahsoka") +// XCTAssertEqual(data.heroes[2].age, 17) +// XCTAssertEqual(data.heroes[2].isJedi, true) +// XCTAssertEqual(data.heroes[2].weight, 138.5) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// // MARK: - Multiple Key Argument Tests +// +// func test_fieldPolicy_withMultipleKeyArguments_resolvesCorrectCacheKey() { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["name", "age"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["name": "Luke", "age": 19] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:Luke+19": CacheReference("Hero:Luke+19")], +// "Hero:Luke+19": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withMultipleKeyArguments_withDifferentOrder_resolvesCorrectCacheKey() { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["age", "name"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["name": "Luke", "age": 19] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:19+Luke": CacheReference("Hero:19+Luke")], +// "Hero:19+Luke": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withMultipleKeyArguments_includingList_resolvesCorrectCacheKey() { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("heroes", [Hero].self, arguments: ["names": .variable("names"), "isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["names", "isJedi"])) +// ]} +// var heroes: [Hero] { __data["heroes"] } +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"], "isJedi": true] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": [ +// "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), +// "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), +// "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") +// ], +// "Hero:Anakin+true": [ +// "age": 23, +// "isJedi": true, +// "name": "Anakin", +// "weight": 185.3, +// "__typename": "Hero", +// ], +// "Hero:Obi-Wan+true": [ +// "age": 30, +// "isJedi": true, +// "name": "Obi-Wan", +// "weight": 179.7, +// "__typename": "Hero", +// ], +// "Hero:Ahsoka+true": [ +// "age": 17, +// "isJedi": true, +// "name": "Ahsoka", +// "weight": 138.5, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// +// XCTAssertEqual(data.heroes[0].name, "Anakin") +// XCTAssertEqual(data.heroes[0].age, 23) +// XCTAssertEqual(data.heroes[0].isJedi, true) +// XCTAssertEqual(data.heroes[0].weight, 185.3) +// +// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") +// XCTAssertEqual(data.heroes[1].age, 30) +// XCTAssertEqual(data.heroes[1].isJedi, true) +// XCTAssertEqual(data.heroes[1].weight, 179.7) +// +// XCTAssertEqual(data.heroes[2].name, "Ahsoka") +// XCTAssertEqual(data.heroes[2].age, 17) +// XCTAssertEqual(data.heroes[2].isJedi, true) +// XCTAssertEqual(data.heroes[2].weight, 138.5) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withMultipleKeyArguments_includingObject_resolvesCorrectCacheKey() { +// struct HeroSearchInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init( +// name: String, +// isJedi: Bool +// ) { +// __data = InputDict([ +// "name": name, +// "isJedi": true +// ]) +// } +// +// public var name: String { +// get { __data["name"] } +// set { __data["name"] = newValue } +// } +// +// public var isJedi: Bool { +// get { __data["isJedi"] } +// set { __data["isJedi"] = newValue } +// } +// } +// +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name", "input.isJedi"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["input": HeroSearchInput(name: "Luke", isJedi: true)] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], +// "Hero:Luke+true": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withMultipleKeyArguments_includingNestedObject_resolvesCorrectCacheKey() { +// struct NameInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init( +// name: String +// ) { +// __data = InputDict([ +// "name": name +// ]) +// } +// +// public var name: String { +// get { __data["name"] } +// set { __data["name"] = newValue } +// } +// } +// +// struct HeroSearchInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init( +// nameInput: NameInput, +// isJedi: Bool +// ) { +// __data = InputDict([ +// "nameInput": nameInput, +// "isJedi": isJedi +// ]) +// } +// +// public var nameInput: NameInput { +// get { __data["nameInput"] } +// set { __data["nameInput"] = newValue } +// } +// +// public var isJedi: Bool { +// get { __data["isJedi"] } +// set { __data["isJedi"] = newValue } +// } +// } +// +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name", "input.isJedi"])) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"), isJedi: true)] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], +// "Hero:Luke+true": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_fieldPolicy_withMultipleKeyArguments_includingNestedObjectList_resolvesCorrectCacheKey() { +// struct NameInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init (names: [String]) { +// __data = InputDict([ +// "names": names +// ]) +// } +// +// public var names: [String] { +// get { __data["names"] } +// set { __data["names"] = newValue } +// } +// } +// +// struct HeroSearchInput: InputObject { +// public private(set) var __data: InputDict +// +// public init(_ data: InputDict) { +// __data = data +// } +// +// public init( +// nameInput: NameInput, +// isJedi: Bool +// ) { +// __data = InputDict([ +// "nameInput": nameInput, +// "isJedi": isJedi +// ]) +// } +// +// public var nameInput: NameInput { +// get { __data["nameInput"] } +// set { __data["nameInput"] = newValue } +// } +// +// public var isJedi: Bool { +// get { __data["isJedi"] } +// set { __data["isJedi"] = newValue } +// } +// } +// +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names", "input.isJedi"])) +// ]} +// var heroes: [Hero] { __data["heroes"] } +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// let query = MockQuery() +// query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]), isJedi: true)] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": [ +// "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), +// "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), +// "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") +// ], +// "Hero:Anakin+true": [ +// "age": 23, +// "isJedi": true, +// "name": "Anakin", +// "weight": 185.3, +// "__typename": "Hero", +// ], +// "Hero:Obi-Wan+true": [ +// "age": 30, +// "isJedi": true, +// "name": "Obi-Wan", +// "weight": 179.7, +// "__typename": "Hero", +// ], +// "Hero:Ahsoka+true": [ +// "age": 17, +// "isJedi": true, +// "name": "Ahsoka", +// "weight": 138.5, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// +// XCTAssertEqual(data.heroes[0].name, "Anakin") +// XCTAssertEqual(data.heroes[0].age, 23) +// XCTAssertEqual(data.heroes[0].isJedi, true) +// XCTAssertEqual(data.heroes[0].weight, 185.3) +// +// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") +// XCTAssertEqual(data.heroes[1].age, 30) +// XCTAssertEqual(data.heroes[1].isJedi, true) +// XCTAssertEqual(data.heroes[1].weight, 179.7) +// +// XCTAssertEqual(data.heroes[2].name, "Ahsoka") +// XCTAssertEqual(data.heroes[2].age, 17) +// XCTAssertEqual(data.heroes[2].isJedi, true) +// XCTAssertEqual(data.heroes[2].weight, 138.5) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// // MARK: - FieldPolicyProvider Tests +// +// func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("hero", Hero.self, arguments: ["name": .variable("name")]) +// ]} +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// MockSchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in +// return CacheKeyInfo(id: "Luke") +// } +// +// let query = MockQuery() +// query.__variables = ["name": "Luke"] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], +// "Hero:Luke": [ +// "age": 19, +// "isJedi": true, +// "name": "Luke", +// "weight": 175.2, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// XCTAssertEqual(data.hero?.name, "Luke") +// XCTAssertEqual(data.hero?.age, 19) +// XCTAssertEqual(data.hero?.isJedi, true) +// XCTAssertEqual(data.hero?.weight, 175.2) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +// func test_schemaConfiguration_givenFieldPolicyProvider_returnsListOfCacheKeyInfo() throws { +// class HeroSelectionSet: MockSelectionSet { +// override class var __selections: [Selection] { [ +// .field("heroes", [Hero].self, arguments: ["names": .variable("names")]) +// ]} +// var heroes: [Hero] { __data["heroes"] } +// +// class Hero: MockSelectionSet { +// override class var __parentType: any ParentType { +// Object(typename: "Hero", implementedInterfaces: []) +// } +// override class var __selections: [Selection] { [ +// .field("__typename", String.self), +// .field("age", Int.self), +// .field("name", String.self), +// .field("isJedi", Bool.self), +// .field("weight", Double.self) +// ]} +// } +// } +// +// MockSchemaMetadata.stub_cacheKeyForField_ListReturn { _, _, _ in +// return [ +// CacheKeyInfo(id: "Anakin"), +// CacheKeyInfo(id: "Obi-Wan"), +// CacheKeyInfo(id: "Ahsoka") +// ] +// } +// +// let query = MockQuery() +// query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] +// +// mergeRecordsIntoCache([ +// "QUERY_ROOT": [ +// "Hero:Anakin": CacheReference("Hero:Anakin"), +// "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), +// "Hero:Ahsoka": CacheReference("Hero:Ahsoka") +// ], +// "Hero:Anakin": [ +// "age": 23, +// "isJedi": true, +// "name": "Anakin", +// "weight": 185.3, +// "__typename": "Hero", +// ], +// "Hero:Obi-Wan": [ +// "age": 30, +// "isJedi": true, +// "name": "Obi-Wan", +// "weight": 179.7, +// "__typename": "Hero", +// ], +// "Hero:Ahsoka": [ +// "age": 17, +// "isJedi": true, +// "name": "Ahsoka", +// "weight": 138.5, +// "__typename": "Hero", +// ] +// ]) +// +// let resultObserver = makeResultObserver(for: query) +// +// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in +// try XCTAssertSuccessResult(result) { graphQLResult in +// XCTAssertEqual(graphQLResult.source, .cache) +// XCTAssertNil(graphQLResult.errors) +// +// let data = try XCTUnwrap(graphQLResult.data) +// +// XCTAssertEqual(data.heroes[0].name, "Anakin") +// XCTAssertEqual(data.heroes[0].age, 23) +// XCTAssertEqual(data.heroes[0].isJedi, true) +// XCTAssertEqual(data.heroes[0].weight, 185.3) +// +// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") +// XCTAssertEqual(data.heroes[1].age, 30) +// XCTAssertEqual(data.heroes[1].isJedi, true) +// XCTAssertEqual(data.heroes[1].weight, 179.7) +// +// XCTAssertEqual(data.heroes[2].name, "Ahsoka") +// XCTAssertEqual(data.heroes[2].age, 17) +// XCTAssertEqual(data.heroes[2].isJedi, true) +// XCTAssertEqual(data.heroes[2].weight, 138.5) +// } +// } +// +// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) +// +// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) +// } +// +//} From 4e92cba3e1c34be27ecd56bb65bc76d9e244dafa Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Tue, 9 Sep 2025 13:23:02 -0400 Subject: [PATCH 33/35] Changing mock usage --- .../MockSchemaMetadata.swift | 50 +- .../ApolloTests/Cache/FieldPolicyTests.swift | 2664 +++++++++-------- .../CacheDataExecutionSource.swift | 22 +- 3 files changed, 1376 insertions(+), 1360 deletions(-) diff --git a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift index 6350f1f19..2d5534f1e 100644 --- a/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift +++ b/Tests/ApolloInternalTestHelpers/MockSchemaMetadata.swift @@ -39,26 +39,6 @@ public class MockSchemaMetadata: SchemaMetadata { testObserver.start() } } - -// @MainActor -// public static func stub_cacheKeyForField_SingleReturn( -// _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? -// ) { -// _configuration.stub_cacheKeyForField_SingleReturn = stub -// if stub != nil { -// testObserver.start() -// } -// } -// -// @MainActor -// public static func stub_cacheKeyForField_ListReturn( -// _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? -// ) { -// _configuration.stub_cacheKeyForField_ListReturn = stub -// if stub != nil { -// testObserver.start() -// } -// } public static func objectType(forTypename __typename: String) -> Object? { if let stub = objectTypeForTypeName { @@ -68,24 +48,12 @@ public class MockSchemaMetadata: SchemaMetadata { return Object(typename: __typename, implementedInterfaces: []) } - public class SchemaConfiguration: ApolloAPI.SchemaConfiguration/*, ApolloAPI.FieldPolicyProvider*/ { + public class SchemaConfiguration: ApolloAPI.SchemaConfiguration { static var stub_cacheKeyInfoForType_Object: ((Object, ObjectData) -> CacheKeyInfo?)? - -// static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? -// -// static var stub_cacheKeyForField_ListReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { stub_cacheKeyInfoForType_Object?(type, object) } - -// public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { -// stub_cacheKeyForField_SingleReturn?(field, variables, path) -// } -// -// public static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { -// stub_cacheKeyForField_ListReturn?(listField, variables, path) -// } } } @@ -134,14 +102,6 @@ public enum MockSchema1Configuration: SchemaConfiguration { public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { CacheKeyInfo(id: "one") } - - public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { - return nil - } - - public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { - return nil - } } public enum MockSchema2: SchemaMetadata { @@ -156,12 +116,4 @@ public enum MockSchema2Configuration: SchemaConfiguration { public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { CacheKeyInfo(id: "two") } - - public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { - return nil - } - - public static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { - return nil - } } diff --git a/Tests/ApolloTests/Cache/FieldPolicyTests.swift b/Tests/ApolloTests/Cache/FieldPolicyTests.swift index 6a6aa0f6f..f0e8b8aa0 100644 --- a/Tests/ApolloTests/Cache/FieldPolicyTests.swift +++ b/Tests/ApolloTests/Cache/FieldPolicyTests.swift @@ -1,1290 +1,1374 @@ -//import XCTest -//@testable import Apollo -//import ApolloAPI -//import ApolloInternalTestHelpers -// -//@MainActor -//final class FieldPolicyTests: XCTestCase, CacheDependentTesting { -// -// var cacheType: any TestCacheProvider.Type { -// InMemoryTestCacheProvider.self -// } -// -// static let defaultWaitTimeout: TimeInterval = 1.0 -// -// var cache: (any NormalizedCache)! -// var server: MockGraphQLServer! -// var client: ApolloClient! -// -// override func setUp() async throws { -// try await super.setUp() -// -// cache = try await makeNormalizedCache() -// let store = ApolloStore(cache: cache) -// -// server = MockGraphQLServer() -// let networkTransport = MockNetworkTransport(server: server, store: store) -// -// client = ApolloClient(networkTransport: networkTransport, store: store) -// } -// -// override func tearDownWithError() throws { -// cache = nil -// server = nil -// client = nil -// -// try super.tearDownWithError() -// } -// -// // MARK: - Single Key Argument Tests -// -// func test_fieldPolicy_withStringKeyArgument_resolvesCorrectCacheKey() throws { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["name": .variable("name")], fieldPolicy: .init(keyArgs: ["name"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["name": "Luke"] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], -// "Hero:Luke": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withIntKeyArgument_resolvesCorrectCacheKey() throws { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["age": .variable("age")], fieldPolicy: .init(keyArgs: ["age"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["age": 19] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:19": CacheReference("Hero:19")], -// "Hero:19": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withDoubleKeyArgument_resolvesCorrectCacheKey() throws { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["weight": .variable("weight")], fieldPolicy: .init(keyArgs: ["weight"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["weight": 175.2] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:175.2": CacheReference("Hero:175.2")], -// "Hero:175.2": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withBoolKeyArgument_resolvesCorrectCacheKey() throws { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["isJedi"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["isJedi": true] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:true": CacheReference("Hero:true")], -// "Hero:true": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withListKeyArgument_resolvesCorrectCacheKey() throws { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("heroes", [Hero].self, arguments: ["names": .variable("names")], fieldPolicy: .init(keyArgs: ["names"])) -// ]} -// var heroes: [Hero] { __data["heroes"] } -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": [ -// "Hero:Anakin": CacheReference("Hero:Anakin"), -// "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), -// "Hero:Ahsoka": CacheReference("Hero:Ahsoka") -// ], -// "Hero:Anakin": [ -// "age": 23, -// "isJedi": true, -// "name": "Anakin", -// "weight": 185.3, -// "__typename": "Hero", -// ], -// "Hero:Obi-Wan": [ -// "age": 30, -// "isJedi": true, -// "name": "Obi-Wan", -// "weight": 179.7, -// "__typename": "Hero", -// ], -// "Hero:Ahsoka": [ -// "age": 17, -// "isJedi": true, -// "name": "Ahsoka", -// "weight": 138.5, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// -// XCTAssertEqual(data.heroes[0].name, "Anakin") -// XCTAssertEqual(data.heroes[0].age, 23) -// XCTAssertEqual(data.heroes[0].isJedi, true) -// XCTAssertEqual(data.heroes[0].weight, 185.3) -// -// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") -// XCTAssertEqual(data.heroes[1].age, 30) -// XCTAssertEqual(data.heroes[1].isJedi, true) -// XCTAssertEqual(data.heroes[1].weight, 179.7) -// -// XCTAssertEqual(data.heroes[2].name, "Ahsoka") -// XCTAssertEqual(data.heroes[2].age, 17) -// XCTAssertEqual(data.heroes[2].isJedi, true) -// XCTAssertEqual(data.heroes[2].weight, 138.5) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withObjectKeyArgument_resolvesCorrectCacheKey() { -// struct HeroSearchInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init(name: String) { -// __data = InputDict([ -// "name": name -// ]) -// } -// -// public var name: String { -// get { __data["name"] } -// set { __data["name"] = newValue } -// } -// } -// -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["input": HeroSearchInput(name: "Luke")] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], -// "Hero:Luke": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withNestedObjectKeyArgument_resolvesCorrectCacheKey() { -// struct NameInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init (name: String) { -// __data = InputDict([ -// "name": name -// ]) -// } -// -// public var name: String { -// get { __data["name"] } -// set { __data["name"] = newValue } -// } -// } -// -// struct HeroSearchInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init(nameInput: NameInput) { -// __data = InputDict([ -// "nameInput": nameInput -// ]) -// } -// -// public var nameInput: NameInput { -// get { __data["nameInput"] } -// set { __data["nameInput"] = newValue } -// } -// } -// -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"))] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], -// "Hero:Luke": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withNestedObjectListKeyArgument_resolvesCorrectCacheKey() { -// struct NameInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init (names: [String]) { -// __data = InputDict([ -// "names": names -// ]) -// } -// -// public var names: [String] { -// get { __data["names"] } -// set { __data["names"] = newValue } -// } -// } -// -// struct HeroSearchInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init(nameInput: NameInput) { -// __data = InputDict([ -// "nameInput": nameInput -// ]) -// } -// -// public var nameInput: NameInput { -// get { __data["nameInput"] } -// set { __data["nameInput"] = newValue } -// } -// } -// -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names"])) -// ]} -// var heroes: [Hero] { __data["heroes"] } -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]))] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": [ -// "Hero:Anakin": CacheReference("Hero:Anakin"), -// "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), -// "Hero:Ahsoka": CacheReference("Hero:Ahsoka") -// ], -// "Hero:Anakin": [ -// "age": 23, -// "isJedi": true, -// "name": "Anakin", -// "weight": 185.3, -// "__typename": "Hero", -// ], -// "Hero:Obi-Wan": [ -// "age": 30, -// "isJedi": true, -// "name": "Obi-Wan", -// "weight": 179.7, -// "__typename": "Hero", -// ], -// "Hero:Ahsoka": [ -// "age": 17, -// "isJedi": true, -// "name": "Ahsoka", -// "weight": 138.5, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// -// XCTAssertEqual(data.heroes[0].name, "Anakin") -// XCTAssertEqual(data.heroes[0].age, 23) -// XCTAssertEqual(data.heroes[0].isJedi, true) -// XCTAssertEqual(data.heroes[0].weight, 185.3) -// -// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") -// XCTAssertEqual(data.heroes[1].age, 30) -// XCTAssertEqual(data.heroes[1].isJedi, true) -// XCTAssertEqual(data.heroes[1].weight, 179.7) -// -// XCTAssertEqual(data.heroes[2].name, "Ahsoka") -// XCTAssertEqual(data.heroes[2].age, 17) -// XCTAssertEqual(data.heroes[2].isJedi, true) -// XCTAssertEqual(data.heroes[2].weight, 138.5) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// // MARK: - Multiple Key Argument Tests -// -// func test_fieldPolicy_withMultipleKeyArguments_resolvesCorrectCacheKey() { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["name", "age"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["name": "Luke", "age": 19] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:Luke+19": CacheReference("Hero:Luke+19")], -// "Hero:Luke+19": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withMultipleKeyArguments_withDifferentOrder_resolvesCorrectCacheKey() { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["age", "name"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["name": "Luke", "age": 19] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:19+Luke": CacheReference("Hero:19+Luke")], -// "Hero:19+Luke": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withMultipleKeyArguments_includingList_resolvesCorrectCacheKey() { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("heroes", [Hero].self, arguments: ["names": .variable("names"), "isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["names", "isJedi"])) -// ]} -// var heroes: [Hero] { __data["heroes"] } -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"], "isJedi": true] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": [ -// "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), -// "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), -// "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") -// ], -// "Hero:Anakin+true": [ -// "age": 23, -// "isJedi": true, -// "name": "Anakin", -// "weight": 185.3, -// "__typename": "Hero", -// ], -// "Hero:Obi-Wan+true": [ -// "age": 30, -// "isJedi": true, -// "name": "Obi-Wan", -// "weight": 179.7, -// "__typename": "Hero", -// ], -// "Hero:Ahsoka+true": [ -// "age": 17, -// "isJedi": true, -// "name": "Ahsoka", -// "weight": 138.5, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// -// XCTAssertEqual(data.heroes[0].name, "Anakin") -// XCTAssertEqual(data.heroes[0].age, 23) -// XCTAssertEqual(data.heroes[0].isJedi, true) -// XCTAssertEqual(data.heroes[0].weight, 185.3) -// -// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") -// XCTAssertEqual(data.heroes[1].age, 30) -// XCTAssertEqual(data.heroes[1].isJedi, true) -// XCTAssertEqual(data.heroes[1].weight, 179.7) -// -// XCTAssertEqual(data.heroes[2].name, "Ahsoka") -// XCTAssertEqual(data.heroes[2].age, 17) -// XCTAssertEqual(data.heroes[2].isJedi, true) -// XCTAssertEqual(data.heroes[2].weight, 138.5) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withMultipleKeyArguments_includingObject_resolvesCorrectCacheKey() { -// struct HeroSearchInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init( -// name: String, -// isJedi: Bool -// ) { -// __data = InputDict([ -// "name": name, -// "isJedi": true -// ]) -// } -// -// public var name: String { -// get { __data["name"] } -// set { __data["name"] = newValue } -// } -// -// public var isJedi: Bool { -// get { __data["isJedi"] } -// set { __data["isJedi"] = newValue } -// } -// } -// -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name", "input.isJedi"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["input": HeroSearchInput(name: "Luke", isJedi: true)] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], -// "Hero:Luke+true": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withMultipleKeyArguments_includingNestedObject_resolvesCorrectCacheKey() { -// struct NameInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init( -// name: String -// ) { -// __data = InputDict([ -// "name": name -// ]) -// } -// -// public var name: String { -// get { __data["name"] } -// set { __data["name"] = newValue } -// } -// } -// -// struct HeroSearchInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init( -// nameInput: NameInput, -// isJedi: Bool -// ) { -// __data = InputDict([ -// "nameInput": nameInput, -// "isJedi": isJedi -// ]) -// } -// -// public var nameInput: NameInput { -// get { __data["nameInput"] } -// set { __data["nameInput"] = newValue } -// } -// -// public var isJedi: Bool { -// get { __data["isJedi"] } -// set { __data["isJedi"] = newValue } -// } -// } -// -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name", "input.isJedi"])) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"), isJedi: true)] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], -// "Hero:Luke+true": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_fieldPolicy_withMultipleKeyArguments_includingNestedObjectList_resolvesCorrectCacheKey() { -// struct NameInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init (names: [String]) { -// __data = InputDict([ -// "names": names -// ]) -// } -// -// public var names: [String] { -// get { __data["names"] } -// set { __data["names"] = newValue } -// } -// } -// -// struct HeroSearchInput: InputObject { -// public private(set) var __data: InputDict -// -// public init(_ data: InputDict) { -// __data = data -// } -// -// public init( -// nameInput: NameInput, -// isJedi: Bool -// ) { -// __data = InputDict([ -// "nameInput": nameInput, -// "isJedi": isJedi -// ]) -// } -// -// public var nameInput: NameInput { -// get { __data["nameInput"] } -// set { __data["nameInput"] = newValue } -// } -// -// public var isJedi: Bool { -// get { __data["isJedi"] } -// set { __data["isJedi"] = newValue } -// } -// } -// -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names", "input.isJedi"])) -// ]} -// var heroes: [Hero] { __data["heroes"] } -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// let query = MockQuery() -// query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]), isJedi: true)] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": [ -// "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), -// "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), -// "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") -// ], -// "Hero:Anakin+true": [ -// "age": 23, -// "isJedi": true, -// "name": "Anakin", -// "weight": 185.3, -// "__typename": "Hero", -// ], -// "Hero:Obi-Wan+true": [ -// "age": 30, -// "isJedi": true, -// "name": "Obi-Wan", -// "weight": 179.7, -// "__typename": "Hero", -// ], -// "Hero:Ahsoka+true": [ -// "age": 17, -// "isJedi": true, -// "name": "Ahsoka", -// "weight": 138.5, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// -// XCTAssertEqual(data.heroes[0].name, "Anakin") -// XCTAssertEqual(data.heroes[0].age, 23) -// XCTAssertEqual(data.heroes[0].isJedi, true) -// XCTAssertEqual(data.heroes[0].weight, 185.3) -// -// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") -// XCTAssertEqual(data.heroes[1].age, 30) -// XCTAssertEqual(data.heroes[1].isJedi, true) -// XCTAssertEqual(data.heroes[1].weight, 179.7) -// -// XCTAssertEqual(data.heroes[2].name, "Ahsoka") -// XCTAssertEqual(data.heroes[2].age, 17) -// XCTAssertEqual(data.heroes[2].isJedi, true) -// XCTAssertEqual(data.heroes[2].weight, 138.5) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// // MARK: - FieldPolicyProvider Tests -// -// func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("hero", Hero.self, arguments: ["name": .variable("name")]) -// ]} -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// MockSchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in -// return CacheKeyInfo(id: "Luke") -// } -// -// let query = MockQuery() -// query.__variables = ["name": "Luke"] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], -// "Hero:Luke": [ -// "age": 19, -// "isJedi": true, -// "name": "Luke", -// "weight": 175.2, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// XCTAssertEqual(data.hero?.name, "Luke") -// XCTAssertEqual(data.hero?.age, 19) -// XCTAssertEqual(data.hero?.isJedi, true) -// XCTAssertEqual(data.hero?.weight, 175.2) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -// func test_schemaConfiguration_givenFieldPolicyProvider_returnsListOfCacheKeyInfo() throws { -// class HeroSelectionSet: MockSelectionSet { -// override class var __selections: [Selection] { [ -// .field("heroes", [Hero].self, arguments: ["names": .variable("names")]) -// ]} -// var heroes: [Hero] { __data["heroes"] } -// -// class Hero: MockSelectionSet { -// override class var __parentType: any ParentType { -// Object(typename: "Hero", implementedInterfaces: []) -// } -// override class var __selections: [Selection] { [ -// .field("__typename", String.self), -// .field("age", Int.self), -// .field("name", String.self), -// .field("isJedi", Bool.self), -// .field("weight", Double.self) -// ]} -// } -// } -// -// MockSchemaMetadata.stub_cacheKeyForField_ListReturn { _, _, _ in -// return [ -// CacheKeyInfo(id: "Anakin"), -// CacheKeyInfo(id: "Obi-Wan"), -// CacheKeyInfo(id: "Ahsoka") -// ] -// } -// -// let query = MockQuery() -// query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] -// -// mergeRecordsIntoCache([ -// "QUERY_ROOT": [ -// "Hero:Anakin": CacheReference("Hero:Anakin"), -// "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), -// "Hero:Ahsoka": CacheReference("Hero:Ahsoka") -// ], -// "Hero:Anakin": [ -// "age": 23, -// "isJedi": true, -// "name": "Anakin", -// "weight": 185.3, -// "__typename": "Hero", -// ], -// "Hero:Obi-Wan": [ -// "age": 30, -// "isJedi": true, -// "name": "Obi-Wan", -// "weight": 179.7, -// "__typename": "Hero", -// ], -// "Hero:Ahsoka": [ -// "age": 17, -// "isJedi": true, -// "name": "Ahsoka", -// "weight": 138.5, -// "__typename": "Hero", -// ] -// ]) -// -// let resultObserver = makeResultObserver(for: query) -// -// let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in -// try XCTAssertSuccessResult(result) { graphQLResult in -// XCTAssertEqual(graphQLResult.source, .cache) -// XCTAssertNil(graphQLResult.errors) -// -// let data = try XCTUnwrap(graphQLResult.data) -// -// XCTAssertEqual(data.heroes[0].name, "Anakin") -// XCTAssertEqual(data.heroes[0].age, 23) -// XCTAssertEqual(data.heroes[0].isJedi, true) -// XCTAssertEqual(data.heroes[0].weight, 185.3) -// -// XCTAssertEqual(data.heroes[1].name, "Obi-Wan") -// XCTAssertEqual(data.heroes[1].age, 30) -// XCTAssertEqual(data.heroes[1].isJedi, true) -// XCTAssertEqual(data.heroes[1].weight, 179.7) -// -// XCTAssertEqual(data.heroes[2].name, "Ahsoka") -// XCTAssertEqual(data.heroes[2].age, 17) -// XCTAssertEqual(data.heroes[2].isJedi, true) -// XCTAssertEqual(data.heroes[2].weight, 138.5) -// } -// } -// -// client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) -// -// wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) -// } -// -//} +import XCTest +@testable import Apollo +import ApolloAPI +import ApolloInternalTestHelpers + +@MainActor +final class FieldPolicyTests: XCTestCase, CacheDependentTesting { + + var cacheType: any TestCacheProvider.Type { + InMemoryTestCacheProvider.self + } + + static let defaultWaitTimeout: TimeInterval = 1.0 + + var cache: (any NormalizedCache)! + var server: MockGraphQLServer! + var client: ApolloClient! + + override func setUp() async throws { + try await super.setUp() + + cache = try await makeNormalizedCache() + let store = ApolloStore(cache: cache) + + server = MockGraphQLServer() + let networkTransport = MockNetworkTransport(server: server, store: store) + + client = ApolloClient(networkTransport: networkTransport, store: store) + } + + override func tearDownWithError() throws { + cache = nil + server = nil + client = nil + + try super.tearDownWithError() + } + + // MARK: - Single Key Argument Tests + + func test_fieldPolicy_withStringKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name")], fieldPolicy: .init(keyArgs: ["name"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke"] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withIntKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["age": .variable("age")], fieldPolicy: .init(keyArgs: ["age"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:19": CacheReference("Hero:19")], + "Hero:19": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withDoubleKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["weight": .variable("weight")], fieldPolicy: .init(keyArgs: ["weight"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["weight": 175.2] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:175.2": CacheReference("Hero:175.2")], + "Hero:175.2": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withBoolKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["isJedi"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["isJedi": true] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:true": CacheReference("Hero:true")], + "Hero:true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withListKeyArgument_resolvesCorrectCacheKey() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names")], fieldPolicy: .init(keyArgs: ["names"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withObjectKeyArgument_resolvesCorrectCacheKey() { + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(name: String) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(name: "Luke")] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withNestedObjectKeyArgument_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (name: String) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(nameInput: NameInput) { + __data = InputDict([ + "nameInput": nameInput + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"))] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withNestedObjectListKeyArgument_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (names: [String]) { + __data = InputDict([ + "names": names + ]) + } + + public var names: [String] { + get { __data["names"] } + set { __data["names"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init(nameInput: NameInput) { + __data = InputDict([ + "nameInput": nameInput + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]))] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + // MARK: - Multiple Key Argument Tests + + func test_fieldPolicy_withMultipleKeyArguments_resolvesCorrectCacheKey() { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["name", "age"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke", "age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+19": CacheReference("Hero:Luke+19")], + "Hero:Luke+19": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_withDifferentOrder_resolvesCorrectCacheKey() { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name"), "age": .variable("age")], fieldPolicy: .init(keyArgs: ["age", "name"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["name": "Luke", "age": 19] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:19+Luke": CacheReference("Hero:19+Luke")], + "Hero:19+Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingList_resolvesCorrectCacheKey() { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names"), "isJedi": .variable("isJedi")], fieldPolicy: .init(keyArgs: ["names", "isJedi"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"], "isJedi": true] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), + "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), + "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") + ], + "Hero:Anakin+true": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan+true": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka+true": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingObject_resolvesCorrectCacheKey() { + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + name: String, + isJedi: Bool + ) { + __data = InputDict([ + "name": name, + "isJedi": true + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.name", "input.isJedi"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(name: "Luke", isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], + "Hero:Luke+true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingNestedObject_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + name: String + ) { + __data = InputDict([ + "name": name + ]) + } + + public var name: String { + get { __data["name"] } + set { __data["name"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + nameInput: NameInput, + isJedi: Bool + ) { + __data = InputDict([ + "nameInput": nameInput, + "isJedi": isJedi + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.name", "input.isJedi"])) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(name: "Luke"), isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke+true": CacheReference("Hero:Luke+true")], + "Hero:Luke+true": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_fieldPolicy_withMultipleKeyArguments_includingNestedObjectList_resolvesCorrectCacheKey() { + struct NameInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init (names: [String]) { + __data = InputDict([ + "names": names + ]) + } + + public var names: [String] { + get { __data["names"] } + set { __data["names"] = newValue } + } + } + + struct HeroSearchInput: InputObject { + public private(set) var __data: InputDict + + public init(_ data: InputDict) { + __data = data + } + + public init( + nameInput: NameInput, + isJedi: Bool + ) { + __data = InputDict([ + "nameInput": nameInput, + "isJedi": isJedi + ]) + } + + public var nameInput: NameInput { + get { __data["nameInput"] } + set { __data["nameInput"] = newValue } + } + + public var isJedi: Bool { + get { __data["isJedi"] } + set { __data["isJedi"] = newValue } + } + } + + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["input": .variable("input")], fieldPolicy: .init(keyArgs: ["input.nameInput.names", "input.isJedi"])) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + let query = MockQuery() + query.__variables = ["input": HeroSearchInput(nameInput: NameInput(names: ["Anakin", "Obi-Wan", "Ahsoka"]), isJedi: true)] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin+true": CacheReference("Hero:Anakin+true"), + "Hero:Obi-Wan+true": CacheReference("Hero:Obi-Wan+true"), + "Hero:Ahsoka+true": CacheReference("Hero:Ahsoka+true") + ], + "Hero:Anakin+true": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan+true": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka+true": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + // MARK: - FieldPolicyProvider Tests + + func test_schemaConfiguration_givenFieldPolicyProvider_returnsSingleCacheKeyInfo() { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("hero", Hero.self, arguments: ["name": .variable("name")]) + ]} + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + FieldPolicySchemaMetadata.stub_cacheKeyForField_SingleReturn { _, _, _ in + return CacheKeyInfo(id: "Luke") + } + + let query = MockQuery() + query.__variables = ["name": "Luke"] + + mergeRecordsIntoCache([ + "QUERY_ROOT": ["Hero:Luke": CacheReference("Hero:Luke")], + "Hero:Luke": [ + "age": 19, + "isJedi": true, + "name": "Luke", + "weight": 175.2, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + XCTAssertEqual(data.hero?.name, "Luke") + XCTAssertEqual(data.hero?.age, 19) + XCTAssertEqual(data.hero?.isJedi, true) + XCTAssertEqual(data.hero?.weight, 175.2) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + + func test_schemaConfiguration_givenFieldPolicyProvider_returnsListOfCacheKeyInfo() throws { + class HeroSelectionSet: AbstractMockSelectionSet { + override class var __selections: [Selection] { [ + .field("heroes", [Hero].self, arguments: ["names": .variable("names")]) + ]} + var heroes: [Hero] { __data["heroes"] } + + class Hero: AbstractMockSelectionSet { + override class var __parentType: any ParentType { + Object(typename: "Hero", implementedInterfaces: []) + } + override class var __selections: [Selection] { [ + .field("__typename", String.self), + .field("age", Int.self), + .field("name", String.self), + .field("isJedi", Bool.self), + .field("weight", Double.self) + ]} + } + } + + FieldPolicySchemaMetadata.stub_cacheKeyForField_ListReturn { _, _, _ in + return [ + CacheKeyInfo(id: "Anakin"), + CacheKeyInfo(id: "Obi-Wan"), + CacheKeyInfo(id: "Ahsoka") + ] + } + + let query = MockQuery() + query.__variables = ["names": ["Anakin", "Obi-Wan", "Ahsoka"]] + + mergeRecordsIntoCache([ + "QUERY_ROOT": [ + "Hero:Anakin": CacheReference("Hero:Anakin"), + "Hero:Obi-Wan": CacheReference("Hero:Obi-Wan"), + "Hero:Ahsoka": CacheReference("Hero:Ahsoka") + ], + "Hero:Anakin": [ + "age": 23, + "isJedi": true, + "name": "Anakin", + "weight": 185.3, + "__typename": "Hero", + ], + "Hero:Obi-Wan": [ + "age": 30, + "isJedi": true, + "name": "Obi-Wan", + "weight": 179.7, + "__typename": "Hero", + ], + "Hero:Ahsoka": [ + "age": 17, + "isJedi": true, + "name": "Ahsoka", + "weight": 138.5, + "__typename": "Hero", + ] + ]) + + let resultObserver = makeResultObserver(for: query) + + let fetchResultFromCacheExpectation = resultObserver.expectation(description: "Received result from cache") { result in + try XCTAssertSuccessResult(result) { graphQLResult in + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertNil(graphQLResult.errors) + + let data = try XCTUnwrap(graphQLResult.data) + + XCTAssertEqual(data.heroes[0].name, "Anakin") + XCTAssertEqual(data.heroes[0].age, 23) + XCTAssertEqual(data.heroes[0].isJedi, true) + XCTAssertEqual(data.heroes[0].weight, 185.3) + + XCTAssertEqual(data.heroes[1].name, "Obi-Wan") + XCTAssertEqual(data.heroes[1].age, 30) + XCTAssertEqual(data.heroes[1].isJedi, true) + XCTAssertEqual(data.heroes[1].weight, 179.7) + + XCTAssertEqual(data.heroes[2].name, "Ahsoka") + XCTAssertEqual(data.heroes[2].age, 17) + XCTAssertEqual(data.heroes[2].isJedi, true) + XCTAssertEqual(data.heroes[2].weight, 138.5) + } + } + + client.fetch(query: query, cachePolicy: .returnCacheDataDontFetch, resultHandler: resultObserver.handler) + + wait(for: [fetchResultFromCacheExpectation], timeout: Self.defaultWaitTimeout) + } + +} + +class FieldPolicySchemaMetadata: SchemaMetadata { + init() { } + + static var _configuration: SchemaConfiguration.Type = SchemaConfiguration.self + static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self + + @MainActor + private static let testObserver = TestObserver() { _ in + stub_objectTypeForTypeName(nil) + stub_cacheKeyInfoForType_Object(nil) + } + + private static var _objectTypeForTypeName: ((String) -> Object?)? + static var objectTypeForTypeName: ((String) -> Object?)? { + _objectTypeForTypeName + } + + @MainActor + static func stub_objectTypeForTypeName(_ stub: ((String) -> Object?)?) { + _objectTypeForTypeName = stub + if _objectTypeForTypeName != nil { + testObserver.start() + } + } + + @MainActor + static func stub_cacheKeyInfoForType_Object( + _ stub: ((Object, ObjectData) -> CacheKeyInfo?)? + ){ + _configuration.stub_cacheKeyInfoForType_Object = stub + if stub != nil { + testObserver.start() + } + } + + @MainActor + static func stub_cacheKeyForField_SingleReturn( + _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? + ) { + _configuration.stub_cacheKeyForField_SingleReturn = stub + if stub != nil { + testObserver.start() + } + } + + @MainActor + static func stub_cacheKeyForField_ListReturn( + _ stub: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? + ) { + _configuration.stub_cacheKeyForField_ListReturn = stub + if stub != nil { + testObserver.start() + } + } + + static func objectType(forTypename __typename: String) -> Object? { + if let stub = objectTypeForTypeName { + return stub(__typename) + } + + return Object(typename: __typename, implementedInterfaces: []) + } + + class SchemaConfiguration: ApolloAPI.SchemaConfiguration, ApolloAPI.FieldPolicyProvider { + static var stub_cacheKeyInfoForType_Object: ((Object, ObjectData) -> CacheKeyInfo?)? + + static var stub_cacheKeyForField_SingleReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> CacheKeyInfo?)? + + static var stub_cacheKeyForField_ListReturn: ((Selection.Field, GraphQLOperation.Variables?, ResponsePath) -> [CacheKeyInfo]?)? + + public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { + stub_cacheKeyInfoForType_Object?(type, object) + } + + public static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { + stub_cacheKeyForField_SingleReturn?(field, variables, path) + } + + public static func cacheKeyList(for listField: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { + stub_cacheKeyForField_ListReturn?(listField, variables, path) + } + } +} diff --git a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift index 48529ca3a..c6d959947 100644 --- a/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift +++ b/apollo-ios/Sources/Apollo/ExecutionSources/CacheDataExecutionSource.swift @@ -99,27 +99,7 @@ struct CacheDataExecutionSource: GraphQLExecutionSource { switch type { case .nonNull(let innerType): - switch innerType { - case .nonNull(_): - return nil - case .list(_): - if let keys = provider.cacheKeyList( - for: info.field, - variables: info.parentInfo.variables, - path: info.responsePath - ) { - return .list(keys) - } - default: - if let key = provider.cacheKey( - for: info.field, - variables: info.parentInfo.variables, - path: info.responsePath - ) { - return .single(key) - } - } -// return resolveProgrammaticFieldPolicy(with: info, and: innerType) + return resolveProgrammaticFieldPolicy(with: info, and: innerType) case .list(_): if let keys = provider.cacheKeyList( for: info.field, From 738af42af95b2ac6081bdc237e1d8068ac0ae3cd Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Tue, 9 Sep 2025 13:49:41 -0400 Subject: [PATCH 34/35] Cleaning up code --- Tests/ApolloTests/Cache/WatchQueryTests.swift | 10 +- Tests/ApolloTests/TestMockTests.swift | 8 - .../SchemaConfigurationFileGenerator.swift | 2 - .../SchemaConfigurationTemplate.swift | 1 - .../JavaScript/package-lock.json | 508 +++--------------- 5 files changed, 76 insertions(+), 453 deletions(-) diff --git a/Tests/ApolloTests/Cache/WatchQueryTests.swift b/Tests/ApolloTests/Cache/WatchQueryTests.swift index cd61269b9..f3fdee030 100644 --- a/Tests/ApolloTests/Cache/WatchQueryTests.swift +++ b/Tests/ApolloTests/Cache/WatchQueryTests.swift @@ -87,7 +87,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher.fetch(cachePolicy: .fetchIgnoringCacheData) - wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: 4.0) + wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: Self.defaultWaitTimeout) } runActivity("Refetch from server") { _ in @@ -117,7 +117,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher.refetch() - wait(for: [serverRequestExpectation, refetchedWatcherResultExpectation], timeout: 4.0) + wait(for: [serverRequestExpectation, refetchedWatcherResultExpectation], timeout: Self.defaultWaitTimeout) } } @@ -616,7 +616,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher.fetch(cachePolicy: .fetchIgnoringCacheData) - wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: 200.0) + wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: Self.defaultWaitTimeout) } runActivity("Fetch other query with list of updated keys from server") { _ in @@ -659,7 +659,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { XCTAssertSuccessResult(result) } - wait(for: [serverRequestExpectation, otherFetchCompletedExpectation, updatedWatcherResultExpectation], timeout: 200.0) + wait(for: [serverRequestExpectation, otherFetchCompletedExpectation, updatedWatcherResultExpectation], timeout: Self.defaultWaitTimeout) } } @@ -1919,7 +1919,7 @@ class WatchQueryTests: XCTestCase, CacheDependentTesting { watcher!.fetch(cachePolicy: .fetchIgnoringCacheData) - wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: 200.0) + wait(for: [serverRequestExpectation, initialWatcherResultExpectation], timeout: Self.defaultWaitTimeout) } runActivity("make sure it gets released") { _ in diff --git a/Tests/ApolloTests/TestMockTests.swift b/Tests/ApolloTests/TestMockTests.swift index 54c905cfc..c5bc55d15 100644 --- a/Tests/ApolloTests/TestMockTests.swift +++ b/Tests/ApolloTests/TestMockTests.swift @@ -561,14 +561,6 @@ enum TestMockSchema: SchemaMetadata { static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? { return nil } - - static func cacheKey(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> CacheKeyInfo? { - return nil - } - - static func cacheKeys(for field: Selection.Field, variables: GraphQLOperation.Variables?, path: ResponsePath) -> [CacheKeyInfo]? { - return nil - } } struct Interfaces { diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift index 5fb6daa62..8baa7f9ee 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/SchemaConfigurationFileGenerator.swift @@ -1,6 +1,5 @@ import Foundation import OrderedCollections -import TemplateString /// Generates a file containing schema metadata used by the GraphQL executor at runtime. struct SchemaConfigurationFileGenerator: FileGenerator { @@ -11,5 +10,4 @@ struct SchemaConfigurationFileGenerator: FileGenerator { var overwrite: Bool { false } var target: FileTarget { .schema } var fileName: String { "SchemaConfiguration" } - } diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift index 2f48571c7..196ca8e86 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift @@ -30,7 +30,6 @@ struct SchemaConfigurationTemplate: TemplateRenderer { return nil } } - """ } } diff --git a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json index a44e26312..2e4628333 100644 --- a/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json +++ b/apollo-ios-codegen/Sources/GraphQLCompiler/JavaScript/package-lock.json @@ -29,19 +29,6 @@ "npm": ">=7" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/code-frame": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", @@ -57,30 +44,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.0.tgz", - "integrity": "sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.4.tgz", + "integrity": "sha512-YsmSKC29MJwf0gF8Rjjrg5LQCmyh+j/nD8/eP7f+BeoQTKYqs9RoWbjGOdy0+1Ekr68RJZMUOPVQaQisnIo4Rw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.28.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.3.tgz", - "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.4.tgz", + "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", "@babel/helper-compilation-targets": "^7.27.2", "@babel/helper-module-transforms": "^7.28.3", - "@babel/helpers": "^7.28.3", - "@babel/parser": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.4", "@babel/template": "^7.27.2", - "@babel/traverse": "^7.28.3", - "@babel/types": "^7.28.2", + "@babel/traverse": "^7.28.4", + "@babel/types": "^7.28.4", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -203,25 +190,25 @@ } }, "node_modules/@babel/helpers": { - "version": "7.28.3", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.3.tgz", - "integrity": "sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", "dev": true, "dependencies": { "@babel/template": "^7.27.2", - "@babel/types": "^7.28.2" + "@babel/types": "^7.28.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.28.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.3.tgz", - "integrity": "sha512-7+Ey1mAgYqFAx2h0RuoxcQT5+MlG3GTV0TQrgr7/ZliKsm/MNDxVVutlWaziMq7wJNAz8MTqz55XLpWvva6StA==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.4.tgz", + "integrity": "sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==", "dev": true, "dependencies": { - "@babel/types": "^7.28.2" + "@babel/types": "^7.28.4" }, "bin": { "parser": "bin/babel-parser.js" @@ -467,17 +454,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.28.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.3.tgz", - "integrity": "sha512-7w4kZYHneL3A6NP2nxzHvT3HCZ7puDZZjFMqDpBPECub79sTtSO5CGXDkKrTQq8ksAwfD/XI2MRFX23njdDaIQ==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.4.tgz", + "integrity": "sha512-YEzuboP2qvQavAcjgQNVgsvHIDv6ZpwXvcvjmyySP2DIMuByS/6ioU5G9pYrWHM6T2YDfc7xga9iNzYOs12CFQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.28.3", + "@babel/parser": "^7.28.4", "@babel/template": "^7.27.2", - "@babel/types": "^7.28.2", + "@babel/types": "^7.28.4", "debug": "^4.3.1" }, "engines": { @@ -485,9 +472,9 @@ } }, "node_modules/@babel/types": { - "version": "7.28.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.2.tgz", - "integrity": "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.4.tgz", + "integrity": "sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.27.1", @@ -593,26 +580,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@jest/console/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/@jest/core": { "version": "30.1.2", "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.1.2.tgz", @@ -660,26 +627,6 @@ } } }, - "node_modules/@jest/core/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/@jest/diff-sequences": { "version": "30.0.1", "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.0.1.tgz", @@ -729,82 +676,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@jest/expect/node_modules/@jest/get-type": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", - "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", - "dev": true, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/@jest/expect/node_modules/expect": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/expect/-/expect-30.0.5.tgz", - "integrity": "sha512-P0te2pt+hHI5qLJkIR+iMvS+lYUZml8rKKsohVHAGY+uClp9XVbdyYNJOIjSRpHVp8s8YqxJCiHUkSYZGr8rtQ==", - "dev": true, - "dependencies": { - "@jest/expect-utils": "30.0.5", - "@jest/get-type": "30.0.1", - "jest-matcher-utils": "30.0.5", - "jest-message-util": "30.0.5", - "jest-mock": "30.0.5", - "jest-util": "30.0.5" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/@jest/expect/node_modules/jest-diff": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.0.5.tgz", - "integrity": "sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A==", - "dev": true, - "dependencies": { - "@jest/diff-sequences": "30.0.1", - "@jest/get-type": "30.0.1", - "chalk": "^4.1.2", - "pretty-format": "30.0.5" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/@jest/expect/node_modules/jest-matcher-utils": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.0.5.tgz", - "integrity": "sha512-uQgGWt7GOrRLP1P7IwNWwK1WAQbq+m//ZY0yXygyfWp0rJlksMSLQAA4wYQC3b6wl3zfnchyTx+k3HZ5aPtCbQ==", - "dev": true, - "dependencies": { - "@jest/get-type": "30.0.1", - "chalk": "^4.1.2", - "jest-diff": "30.0.5", - "pretty-format": "30.0.5" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/@jest/expect/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/@jest/fake-timers": { "version": "30.1.2", "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.1.2.tgz", @@ -822,32 +693,11 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@jest/fake-timers/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/@jest/get-type": { "version": "30.1.0", "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", "dev": true, - "license": "MIT", "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } @@ -922,26 +772,6 @@ } } }, - "node_modules/@jest/reporters/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/@jest/schemas": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.0.5.tgz", @@ -1067,6 +897,16 @@ "@jridgewell/trace-mapping": "^0.3.24" } }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -1230,9 +1070,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.2.0.tgz", - "integrity": "sha512-qWJ2ZTbmumwiLFomfzTyt5Kng4hwPi9rwCYN4SHb6eaRU1KNO4ccxINHr/VhH4GgPlt1XfSTLX2LBTme8ne4Zw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", + "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", @@ -1480,7 +1320,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "openharmony" @@ -1647,9 +1486,9 @@ } }, "node_modules/@types/node": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.0.tgz", - "integrity": "sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==", + "version": "24.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz", + "integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==", "dev": true, "dependencies": { "undici-types": "~7.10.0" @@ -1966,9 +1805,9 @@ } }, "node_modules/ansi-regex": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.0.tgz", - "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, "engines": { "node": ">=12" @@ -2048,9 +1887,9 @@ } }, "node_modules/babel-plugin-istanbul": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.0.tgz", - "integrity": "sha512-C5OzENSx/A+gt7t4VH1I2XsflxyPUmXRFPKBxt33xncdOmq7oROVM3bZv9Ysjjkv8OJYDMa+tKuKMvqU/H3xdw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.1.tgz", + "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", @@ -2224,9 +2063,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001737", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001737.tgz", - "integrity": "sha512-BiloLiXtQNrY5UyF0+1nSJLXUENuhka2pzy2Fx5pGxqavdrxSCW4U6Pn/PoG3Efspi2frRbHpBV2XsrPE6EDlw==", + "version": "1.0.30001741", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001741.tgz", + "integrity": "sha512-QGUGitqsc8ARjLdgAfxETDhRbJ0REsP6O3I96TAth/mVjh2cYzN2u+3AzPP3aVSm2FehEItaJw1xd+IGBXWeSw==", "dev": true, "funding": [ { @@ -2492,9 +2331,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.211", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.211.tgz", - "integrity": "sha512-IGBvimJkotaLzFnwIVgW9/UD/AOJ2tByUmeOrtqBfACSbAw5b1G0XpvdaieKyc7ULmbwXVx+4e4Be8pOPBrYkw==", + "version": "1.5.215", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.215.tgz", + "integrity": "sha512-TIvGp57UpeNetj/wV/xpFNpWGb0b/ROw372lHPx5Aafx02gjTBtWnEEcaSX3W2dLM3OSdGGyHX/cHl01JQsLaQ==", "dev": true }, "node_modules/emittery": { @@ -3112,65 +2951,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-circus/node_modules/@jest/get-type": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", - "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", - "dev": true, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/jest-circus/node_modules/jest-diff": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.0.5.tgz", - "integrity": "sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A==", - "dev": true, - "dependencies": { - "@jest/diff-sequences": "30.0.1", - "@jest/get-type": "30.0.1", - "chalk": "^4.1.2", - "pretty-format": "30.0.5" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/jest-circus/node_modules/jest-matcher-utils": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.0.5.tgz", - "integrity": "sha512-uQgGWt7GOrRLP1P7IwNWwK1WAQbq+m//ZY0yXygyfWp0rJlksMSLQAA4wYQC3b6wl3zfnchyTx+k3HZ5aPtCbQ==", - "dev": true, - "dependencies": { - "@jest/get-type": "30.0.1", - "chalk": "^4.1.2", - "jest-diff": "30.0.5", - "pretty-format": "30.0.5" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/jest-circus/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/jest-cli": { "version": "30.1.2", "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.1.2.tgz", @@ -3297,15 +3077,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-each/node_modules/@jest/get-type": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", - "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", - "dev": true, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/jest-environment-node": { "version": "30.1.2", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.1.2.tgz", @@ -3501,26 +3272,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-runner/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/jest-runtime": { "version": "30.1.2", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.1.2.tgz", @@ -3554,26 +3305,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-runtime/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/jest-snapshot": { "version": "30.1.2", "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.1.2.tgz", @@ -3606,94 +3337,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-snapshot/node_modules/@jest/expect-utils": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.0.5.tgz", - "integrity": "sha512-F3lmTT7CXWYywoVUGTCmom0vXq3HTTkaZyTAzIy+bXSBizB7o5qzlC9VCtq0arOa8GqmNsbg/cE9C6HLn7Szew==", - "dev": true, - "dependencies": { - "@jest/get-type": "30.0.1" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/@jest/get-type": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", - "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", - "dev": true, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/expect": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/expect/-/expect-30.0.5.tgz", - "integrity": "sha512-P0te2pt+hHI5qLJkIR+iMvS+lYUZml8rKKsohVHAGY+uClp9XVbdyYNJOIjSRpHVp8s8YqxJCiHUkSYZGr8rtQ==", - "dev": true, - "dependencies": { - "@jest/expect-utils": "30.0.5", - "@jest/get-type": "30.0.1", - "jest-matcher-utils": "30.0.5", - "jest-message-util": "30.0.5", - "jest-mock": "30.0.5", - "jest-util": "30.0.5" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/jest-diff": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.0.5.tgz", - "integrity": "sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A==", - "dev": true, - "dependencies": { - "@jest/diff-sequences": "30.0.1", - "@jest/get-type": "30.0.1", - "chalk": "^4.1.2", - "pretty-format": "30.0.5" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/jest-matcher-utils": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.0.5.tgz", - "integrity": "sha512-uQgGWt7GOrRLP1P7IwNWwK1WAQbq+m//ZY0yXygyfWp0rJlksMSLQAA4wYQC3b6wl3zfnchyTx+k3HZ5aPtCbQ==", - "dev": true, - "dependencies": { - "@jest/get-type": "30.0.1", - "chalk": "^4.1.2", - "jest-diff": "30.0.5", - "pretty-format": "30.0.5" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/jest-message-util": { - "version": "30.0.5", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.0.5.tgz", - "integrity": "sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@jest/types": "30.0.5", - "@types/stack-utils": "^2.0.3", - "chalk": "^4.1.2", - "graceful-fs": "^4.2.11", - "micromatch": "^4.0.8", - "pretty-format": "30.0.5", - "slash": "^3.0.0", - "stack-utils": "^2.0.6" - }, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/jest-snapshot/node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", @@ -3740,15 +3383,6 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-validate/node_modules/@jest/get-type": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.0.1.tgz", - "integrity": "sha512-AyYdemXCptSRFirI5EPazNxyPwAL0jXt3zceFjaj8NFiKP9pOi0bfXonf6qkf82z2t3QWPeLCWWw4stPBzctLw==", - "dev": true, - "engines": { - "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - } - }, "node_modules/jest-validate/node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -3903,9 +3537,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.18", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.18.tgz", - "integrity": "sha512-yi8swmWbO17qHhwIBNeeZxTceJMeBvWJaId6dyvTSOwTipqeHhMhOrz6513r1sOKnpvQ7zkhlG8tPrpilwTxHQ==", + "version": "0.30.19", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.19.tgz", + "integrity": "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" @@ -4066,9 +3700,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.20.tgz", + "integrity": "sha512-7gK6zSXEH6neM212JgfYFXe+GmZQM+fia5SsusuBIUgnPheLFBmIPhtFoAQRj8/7wASYQnbDlHPVwY0BefoFgA==", "dev": true }, "node_modules/normalize-path": { @@ -4649,9 +4283,9 @@ } }, "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" @@ -4755,13 +4389,13 @@ } }, "node_modules/terser": { - "version": "5.43.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.43.1.tgz", - "integrity": "sha512-+6erLbBm0+LROX2sPXlUYx/ux5PyE9K/a92Wrt6oA+WDAoFTdpHE5tCYCI5PNzq2y8df4rA+QgHLJuR4jNymsg==", + "version": "5.44.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.0.tgz", + "integrity": "sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.14.0", + "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -5176,9 +4810,9 @@ } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, "engines": { "node": ">=12" From 8606c5d9174e3ea5d8cc4ba2cef0c9087c70a781 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Tue, 9 Sep 2025 13:57:27 -0400 Subject: [PATCH 35/35] Fixing tests --- .../ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift index 196ca8e86..a95bd345e 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/SchemaConfigurationTemplate.swift @@ -30,6 +30,7 @@ struct SchemaConfigurationTemplate: TemplateRenderer { return nil } } + """ } }