@graphitation/supermassive 3.0.0-alpha.5 → 3.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/.eslintcache +1 -1
  2. package/CHANGELOG.md +18 -2
  3. package/lib/benchmarks/index.js.map +2 -2
  4. package/lib/benchmarks/index.mjs.map +2 -2
  5. package/lib/collectFields.d.ts.map +1 -1
  6. package/lib/collectFields.js +6 -5
  7. package/lib/collectFields.js.map +2 -2
  8. package/lib/collectFields.mjs +6 -5
  9. package/lib/collectFields.mjs.map +2 -2
  10. package/lib/executeWithoutSchema.d.ts +1 -3
  11. package/lib/executeWithoutSchema.d.ts.map +1 -1
  12. package/lib/executeWithoutSchema.js +153 -69
  13. package/lib/executeWithoutSchema.js.map +2 -2
  14. package/lib/executeWithoutSchema.mjs +143 -71
  15. package/lib/executeWithoutSchema.mjs.map +2 -2
  16. package/lib/index.d.ts +4 -4
  17. package/lib/index.d.ts.map +1 -1
  18. package/lib/index.js +5 -1
  19. package/lib/index.js.map +2 -2
  20. package/lib/index.mjs +10 -2
  21. package/lib/index.mjs.map +2 -2
  22. package/lib/schema/definition.d.ts +43 -33
  23. package/lib/schema/definition.d.ts.map +1 -1
  24. package/lib/schema/definition.js +284 -9
  25. package/lib/schema/definition.js.map +2 -2
  26. package/lib/schema/definition.mjs +284 -55
  27. package/lib/schema/definition.mjs.map +3 -3
  28. package/lib/schema/directives.d.ts.map +1 -1
  29. package/lib/schema/directives.js +3 -3
  30. package/lib/schema/directives.js.map +2 -2
  31. package/lib/schema/directives.mjs +4 -4
  32. package/lib/schema/directives.mjs.map +2 -2
  33. package/lib/schema/reference.d.ts +3 -1
  34. package/lib/schema/reference.d.ts.map +1 -1
  35. package/lib/schema/reference.js.map +2 -2
  36. package/lib/schema/reference.mjs.map +2 -2
  37. package/lib/schema/resolvers.d.ts +10 -4
  38. package/lib/schema/resolvers.d.ts.map +1 -1
  39. package/lib/schema/resolvers.js +92 -9
  40. package/lib/schema/resolvers.js.map +2 -2
  41. package/lib/schema/resolvers.mjs +99 -9
  42. package/lib/schema/resolvers.mjs.map +2 -2
  43. package/lib/types.d.ts +25 -2
  44. package/lib/types.d.ts.map +1 -1
  45. package/lib/types.js.map +1 -1
  46. package/lib/utilities/coerceInputValue.d.ts +3 -3
  47. package/lib/utilities/coerceInputValue.d.ts.map +1 -1
  48. package/lib/utilities/coerceInputValue.js +17 -12
  49. package/lib/utilities/coerceInputValue.js.map +2 -2
  50. package/lib/utilities/coerceInputValue.mjs +22 -12
  51. package/lib/utilities/coerceInputValue.mjs.map +2 -2
  52. package/lib/utilities/decodeASTSchema.d.ts.map +1 -1
  53. package/lib/utilities/decodeASTSchema.js +32 -40
  54. package/lib/utilities/decodeASTSchema.js.map +2 -2
  55. package/lib/utilities/decodeASTSchema.mjs +51 -49
  56. package/lib/utilities/decodeASTSchema.mjs.map +2 -2
  57. package/lib/utilities/encodeASTSchema.d.ts.map +1 -1
  58. package/lib/utilities/encodeASTSchema.js +16 -20
  59. package/lib/utilities/encodeASTSchema.js.map +2 -2
  60. package/lib/utilities/encodeASTSchema.mjs +22 -21
  61. package/lib/utilities/encodeASTSchema.mjs.map +2 -2
  62. package/lib/utilities/extractMinimalViableSchemaForRequestDocument.d.ts.map +1 -1
  63. package/lib/utilities/extractMinimalViableSchemaForRequestDocument.js +20 -22
  64. package/lib/utilities/extractMinimalViableSchemaForRequestDocument.js.map +2 -2
  65. package/lib/utilities/extractMinimalViableSchemaForRequestDocument.mjs +35 -29
  66. package/lib/utilities/extractMinimalViableSchemaForRequestDocument.mjs.map +2 -2
  67. package/lib/utilities/mergeResolvers.js +1 -2
  68. package/lib/utilities/mergeResolvers.js.map +2 -2
  69. package/lib/utilities/mergeResolvers.mjs +1 -2
  70. package/lib/utilities/mergeResolvers.mjs.map +2 -2
  71. package/lib/utilities/mergeSchemaDefinitions.d.ts.map +1 -1
  72. package/lib/utilities/mergeSchemaDefinitions.js +18 -28
  73. package/lib/utilities/mergeSchemaDefinitions.js.map +2 -2
  74. package/lib/utilities/mergeSchemaDefinitions.mjs +28 -34
  75. package/lib/utilities/mergeSchemaDefinitions.mjs.map +2 -2
  76. package/lib/utilities/valueFromAST.d.ts +3 -3
  77. package/lib/utilities/valueFromAST.d.ts.map +1 -1
  78. package/lib/utilities/valueFromAST.js +23 -10
  79. package/lib/utilities/valueFromAST.js.map +2 -2
  80. package/lib/utilities/valueFromAST.mjs +13 -10
  81. package/lib/utilities/valueFromAST.mjs.map +2 -2
  82. package/lib/values.d.ts +2 -2
  83. package/lib/values.d.ts.map +1 -1
  84. package/lib/values.js +14 -14
  85. package/lib/values.js.map +2 -2
  86. package/lib/values.mjs +21 -14
  87. package/lib/values.mjs.map +2 -2
  88. package/package.json +1 -1
  89. package/lib/schema/fragment.d.ts +0 -63
  90. package/lib/schema/fragment.d.ts.map +0 -1
  91. package/lib/schema/fragment.js +0 -295
  92. package/lib/schema/fragment.js.map +0 -7
  93. package/lib/schema/fragment.mjs +0 -292
  94. package/lib/schema/fragment.mjs.map +0 -7
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @graphitation/supermassive
2
2
 
3
- This log was last generated on Mon, 11 Sep 2023 12:05:51 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 12 Sep 2023 23:58:24 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 3.0.0-alpha.7
8
+
9
+ Tue, 12 Sep 2023 23:58:24 GMT
10
+
11
+ ### Changes
12
+
13
+ - refactor: replace PartialSchema class with ES module functions (vladimir.razuvaev@gmail.com)
14
+
15
+ ## 3.0.0-alpha.6
16
+
17
+ Mon, 11 Sep 2023 19:24:32 GMT
18
+
19
+ ### Changes
20
+
21
+ - fix mergeResolvers + more tests (vladimir.razuvaev@gmail.com)
22
+
7
23
  ## 3.0.0-alpha.5
8
24
 
9
- Mon, 11 Sep 2023 12:05:51 GMT
25
+ Mon, 11 Sep 2023 12:06:07 GMT
10
26
 
11
27
  ### Changes
12
28
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/benchmarks/index.ts"],
4
- "sourcesContent": ["import fs from \"fs\";\nimport path from \"path\";\nimport NiceBenchmark from \"./nice-benchmark\";\nimport schema from \"./swapi-schema\";\nimport resolvers from \"./swapi-schema/resolvers\";\nimport models from \"./swapi-schema/models\";\nimport {\n execute as graphqlExecute,\n parse,\n // experimentalExecuteIncrementally as graphqlExecute,\n} from \"graphql\";\nimport { compileQuery, isCompiledQuery } from \"graphql-jit\";\nimport { executeWithoutSchema as supermassiveExecute } from \"../executeWithoutSchema\";\nimport { UserResolvers } from \"../types\";\nimport { extractMinimalViableSchemaForRequestDocument } from \"../utilities/extractMinimalViableSchemaForRequestDocument\";\nimport { SchemaFragment } from \"../schema/fragment\";\n\nconst query = fs.readFileSync(\n path.join(__dirname, \"./fixtures/query1.graphql\"),\n {\n encoding: \"utf-8\",\n },\n);\n\nconst parsedQuery = parse(query);\nconst compiledQuery = compileQuery(schema, parsedQuery);\n\nconst { definitions } = extractMinimalViableSchemaForRequestDocument(\n schema,\n parsedQuery,\n);\n\nconst schemaFragment: SchemaFragment = {\n schemaId: \"benchmark\",\n definitions,\n resolvers: resolvers as UserResolvers,\n};\n\nconst queryRunningSuite = new NiceBenchmark(\"Query Running\");\nqueryRunningSuite.add(\"graphql-js - string queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parse(query),\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-js - parsed queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parsedQuery,\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - uncompiled\", async () => {\n const freshCompiledQuery = compileQuery(schema, parsedQuery);\n if (isCompiledQuery(freshCompiledQuery)) {\n const result = await freshCompiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - precompiled\", async () => {\n if (isCompiledQuery(compiledQuery)) {\n const result = await compiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"supermassive - runtime schemaless\", async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\n\nconst queryParsingSuite = new NiceBenchmark(\"Query parsing\");\nqueryParsingSuite.add(\"graphql-js\", async () => {\n parse(query);\n});\n\nconst queryCompilingSuite = new NiceBenchmark(\"Query compiling\");\nqueryCompilingSuite.add(\"graphql-jit\", async () => {\n await compileQuery(schema, parsedQuery);\n});\n\nconst queryAnnotationSuite = new NiceBenchmark(\"Query annotation\");\nqueryAnnotationSuite.add(\"supermassive\", () => {\n extractMinimalViableSchemaForRequestDocument(schema, parsedQuery);\n});\n\nasync function main() {\n await queryCompilingSuite.run();\n await queryParsingSuite.run();\n await queryAnnotationSuite.run();\n await queryRunningSuite.run();\n}\n\nmain();\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gBAAe;AACf,kBAAiB;AACjB,4BAA0B;AAC1B,0BAAmB;AACnB,uBAAsB;AACtB,oBAAmB;AACnB,qBAIO;AACP,yBAA8C;AAC9C,kCAA4D;AAE5D,0DAA6D;AAG7D,MAAM,QAAQ,UAAAA,QAAG;AAAA,EACf,YAAAC,QAAK,KAAK,WAAW,2BAA2B;AAAA,EAChD;AAAA,IACE,UAAU;AAAA,EACZ;AACF;AAEA,MAAM,kBAAc,sBAAM,KAAK;AAC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MAAM,cAAc,MAAM,CAAC,GAAG,EAAE,sBAAAA,QAAO,GAAG,CAAC,CAAC;AAC3D,QAAI,OAAO,UAAU,CAAC,OAAO,MAAM;AACjC,YAAM,IAAI,MAAM,uBAAuB;AAAA,IACzC;AAAA,EACF,OAAO;AACL,UAAM,IAAI,MAAM,aAAa;AAAA,EAC/B;AACF,EAAC;AACD,kBAAkB,IAAI,qCAAqC,MAAY;AACrE,QAAM,SAAS,UAAM,4BAAAC,sBAAoB;AAAA,IACvC;AAAA,IACA,UAAU;AAAA,IACV,cAAc,EAAE,sBAAAD,QAAO;AAAA,EACzB,CAAC;AACD,MAAI,UAAU,WAAW,OAAO,UAAU,CAAC,OAAO,OAAO;AACvD,UAAM,IAAI,MAAM,uBAAuB;AAAA,EACzC;AACF,EAAC;AAED,MAAM,oBAAoB,IAAI,sBAAAF,QAAc,eAAe;AAC3D,kBAAkB,IAAI,cAAc,MAAY;AAC9C,4BAAM,KAAK;AACb,EAAC;AAED,MAAM,sBAAsB,IAAI,sBAAAA,QAAc,iBAAiB;AAC/D,oBAAoB,IAAI,eAAe,MAAY;AACjD,YAAM,iCAAa,oBAAAF,SAAQ,WAAW;AACxC,EAAC;AAED,MAAM,uBAAuB,IAAI,sBAAAE,QAAc,kBAAkB;AACjE,qBAAqB,IAAI,gBAAgB,MAAM;AAC7C,wGAA6C,oBAAAF,SAAQ,WAAW;AAClE,CAAC;AAED,SAAe,OAAO;AAAA;AACpB,UAAM,oBAAoB,IAAI;AAC9B,UAAM,kBAAkB,IAAI;AAC5B,UAAM,qBAAqB,IAAI;AAC/B,UAAM,kBAAkB,IAAI;AAAA,EAC9B;AAAA;AAEA,KAAK;",
4
+ "sourcesContent": ["import fs from \"fs\";\nimport path from \"path\";\nimport NiceBenchmark from \"./nice-benchmark\";\nimport schema from \"./swapi-schema\";\nimport resolvers from \"./swapi-schema/resolvers\";\nimport models from \"./swapi-schema/models\";\nimport {\n execute as graphqlExecute,\n parse,\n // experimentalExecuteIncrementally as graphqlExecute,\n} from \"graphql\";\nimport { compileQuery, isCompiledQuery } from \"graphql-jit\";\nimport { executeWithoutSchema as supermassiveExecute } from \"../executeWithoutSchema\";\nimport { UserResolvers, SchemaFragment } from \"../types\";\nimport { extractMinimalViableSchemaForRequestDocument } from \"../utilities/extractMinimalViableSchemaForRequestDocument\";\n\nconst query = fs.readFileSync(\n path.join(__dirname, \"./fixtures/query1.graphql\"),\n {\n encoding: \"utf-8\",\n },\n);\n\nconst parsedQuery = parse(query);\nconst compiledQuery = compileQuery(schema, parsedQuery);\n\nconst { definitions } = extractMinimalViableSchemaForRequestDocument(\n schema,\n parsedQuery,\n);\n\nconst schemaFragment: SchemaFragment = {\n schemaId: \"benchmark\",\n definitions,\n resolvers: resolvers as UserResolvers,\n};\n\nconst queryRunningSuite = new NiceBenchmark(\"Query Running\");\nqueryRunningSuite.add(\"graphql-js - string queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parse(query),\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-js - parsed queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parsedQuery,\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - uncompiled\", async () => {\n const freshCompiledQuery = compileQuery(schema, parsedQuery);\n if (isCompiledQuery(freshCompiledQuery)) {\n const result = await freshCompiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - precompiled\", async () => {\n if (isCompiledQuery(compiledQuery)) {\n const result = await compiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"supermassive - runtime schemaless\", async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\n\nconst queryParsingSuite = new NiceBenchmark(\"Query parsing\");\nqueryParsingSuite.add(\"graphql-js\", async () => {\n parse(query);\n});\n\nconst queryCompilingSuite = new NiceBenchmark(\"Query compiling\");\nqueryCompilingSuite.add(\"graphql-jit\", async () => {\n await compileQuery(schema, parsedQuery);\n});\n\nconst queryAnnotationSuite = new NiceBenchmark(\"Query annotation\");\nqueryAnnotationSuite.add(\"supermassive\", () => {\n extractMinimalViableSchemaForRequestDocument(schema, parsedQuery);\n});\n\nasync function main() {\n await queryCompilingSuite.run();\n await queryParsingSuite.run();\n await queryAnnotationSuite.run();\n await queryRunningSuite.run();\n}\n\nmain();\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gBAAe;AACf,kBAAiB;AACjB,4BAA0B;AAC1B,0BAAmB;AACnB,uBAAsB;AACtB,oBAAmB;AACnB,qBAIO;AACP,yBAA8C;AAC9C,kCAA4D;AAE5D,0DAA6D;AAE7D,MAAM,QAAQ,UAAAA,QAAG;AAAA,EACf,YAAAC,QAAK,KAAK,WAAW,2BAA2B;AAAA,EAChD;AAAA,IACE,UAAU;AAAA,EACZ;AACF;AAEA,MAAM,kBAAc,sBAAM,KAAK;AAC/B,MAAM,oBAAgB,iCAAa,oBAAAC,SAAQ,WAAW;AAEtD,MAAM,EAAE,YAAY,QAAI;AAAA,EACtB,oBAAAA;AAAA,EACA;AACF;AAEA,MAAM,iBAAiC;AAAA,EACrC,UAAU;AAAA,EACV;AAAA,EACA,WAAW,iBAAAC;AACb;AAEA,MAAM,oBAAoB,IAAI,sBAAAC,QAAc,eAAe;AAC3D,kBAAkB,IAAI,+BAA+B,MAAY;AAC/D,QAAM,SAAS,UAAM,eAAAC,SAAe;AAAA,IAClC,4BAAAH;AAA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,cAAc,EAAE,sBAAAD,QAAO;AAAA,EACzB,CAAC;AACD,MAAI,UAAU,WAAW,OAAO,UAAU,CAAC,OAAO,OAAO;AACvD,UAAM,IAAI,MAAM,uBAAuB;AAAA,EACzC;AACF,EAAC;AAED,MAAM,oBAAoB,IAAI,sBAAAF,QAAc,eAAe;AAC3D,kBAAkB,IAAI,cAAc,MAAY;AAC9C,4BAAM,KAAK;AACb,EAAC;AAED,MAAM,sBAAsB,IAAI,sBAAAA,QAAc,iBAAiB;AAC/D,oBAAoB,IAAI,eAAe,MAAY;AACjD,YAAM,iCAAa,oBAAAF,SAAQ,WAAW;AACxC,EAAC;AAED,MAAM,uBAAuB,IAAI,sBAAAE,QAAc,kBAAkB;AACjE,qBAAqB,IAAI,gBAAgB,MAAM;AAC7C,wGAA6C,oBAAAF,SAAQ,WAAW;AAClE,CAAC;AAED,SAAe,OAAO;AAAA;AACpB,UAAM,oBAAoB,IAAI;AAC9B,UAAM,kBAAkB,IAAI;AAC5B,UAAM,qBAAqB,IAAI;AAC/B,UAAM,kBAAkB,IAAI;AAAA,EAC9B;AAAA;AAEA,KAAK;",
6
6
  "names": ["fs", "path", "schema", "resolvers", "NiceBenchmark", "graphqlExecute", "models", "supermassiveExecute"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/benchmarks/index.ts"],
4
- "sourcesContent": ["import fs from \"fs\";\nimport path from \"path\";\nimport NiceBenchmark from \"./nice-benchmark\";\nimport schema from \"./swapi-schema\";\nimport resolvers from \"./swapi-schema/resolvers\";\nimport models from \"./swapi-schema/models\";\nimport {\n execute as graphqlExecute,\n parse,\n // experimentalExecuteIncrementally as graphqlExecute,\n} from \"graphql\";\nimport { compileQuery, isCompiledQuery } from \"graphql-jit\";\nimport { executeWithoutSchema as supermassiveExecute } from \"../executeWithoutSchema\";\nimport { UserResolvers } from \"../types\";\nimport { extractMinimalViableSchemaForRequestDocument } from \"../utilities/extractMinimalViableSchemaForRequestDocument\";\nimport { SchemaFragment } from \"../schema/fragment\";\n\nconst query = fs.readFileSync(\n path.join(__dirname, \"./fixtures/query1.graphql\"),\n {\n encoding: \"utf-8\",\n },\n);\n\nconst parsedQuery = parse(query);\nconst compiledQuery = compileQuery(schema, parsedQuery);\n\nconst { definitions } = extractMinimalViableSchemaForRequestDocument(\n schema,\n parsedQuery,\n);\n\nconst schemaFragment: SchemaFragment = {\n schemaId: \"benchmark\",\n definitions,\n resolvers: resolvers as UserResolvers,\n};\n\nconst queryRunningSuite = new NiceBenchmark(\"Query Running\");\nqueryRunningSuite.add(\"graphql-js - string queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parse(query),\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-js - parsed queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parsedQuery,\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - uncompiled\", async () => {\n const freshCompiledQuery = compileQuery(schema, parsedQuery);\n if (isCompiledQuery(freshCompiledQuery)) {\n const result = await freshCompiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - precompiled\", async () => {\n if (isCompiledQuery(compiledQuery)) {\n const result = await compiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"supermassive - runtime schemaless\", async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\n\nconst queryParsingSuite = new NiceBenchmark(\"Query parsing\");\nqueryParsingSuite.add(\"graphql-js\", async () => {\n parse(query);\n});\n\nconst queryCompilingSuite = new NiceBenchmark(\"Query compiling\");\nqueryCompilingSuite.add(\"graphql-jit\", async () => {\n await compileQuery(schema, parsedQuery);\n});\n\nconst queryAnnotationSuite = new NiceBenchmark(\"Query annotation\");\nqueryAnnotationSuite.add(\"supermassive\", () => {\n extractMinimalViableSchemaForRequestDocument(schema, parsedQuery);\n});\n\nasync function main() {\n await queryCompilingSuite.run();\n await queryParsingSuite.run();\n await queryAnnotationSuite.run();\n await queryRunningSuite.run();\n}\n\nmain();\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,mBAAmB;AAC1B,OAAO,YAAY;AACnB,OAAO,eAAe;AACtB,OAAO,YAAY;AACnB;AAAA,EACE,WAAW;AAAA,EACX;AAAA,OAEK;AACP,SAAS,cAAc,uBAAuB;AAC9C,SAAS,wBAAwB,2BAA2B;AAE5D,SAAS,oDAAoD;AAd7D;AAAA;AAiBA,QAAM,QAAQ,GAAG;AAAA,MACf,KAAK,KAAK,WAAW,2BAA2B;AAAA,MAChD;AAAA,QACE,UAAU;AAAA,MACZ;AAAA,IACF;AAEA,QAAM,cAAc,MAAM,KAAK;AAC/B,QAAM,gBAAgB,aAAa,QAAQ,WAAW;AAEtD,QAAM,EAAE,YAAY,IAAI;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAEA,QAAM,iBAAiC;AAAA,MACrC,UAAU;AAAA,MACV;AAAA,MACA;AAAA,IACF;AAEA,QAAM,oBAAoB,IAAI,cAAc,eAAe;AAC3D,sBAAkB,IAAI,+BAA+B,MAAY;AAC/D,YAAM,SAAS,MAAM,eAAe;AAAA,QAClC;AAAA,QACA,UAAU,MAAM,KAAK;AAAA,QACrB,cAAc,EAAE,OAAO;AAAA,MACzB,CAAC;AACD,UAAI,OAAO,UAAU,CAAC,OAAO,MAAM;AACjC,cAAM,IAAI,MAA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Ac,eAAe;AAC3D,sBAAkB,IAAI,cAAc,MAAY;AAC9C,YAAM,KAAK;AAAA,IACb,EAAC;AAED,QAAM,sBAAsB,IAAI,cAAc,iBAAiB;AAC/D,wBAAoB,IAAI,eAAe,MAAY;AACjD,YAAM,aAAa,QAAQ,WAAW;AAAA,IACxC,EAAC;AAED,QAAM,uBAAuB,IAAI,cAAc,kBAAkB;AACjE,yBAAqB,IAAI,gBAAgB,MAAM;AAC7C,mDAA6C,QAAQ,WAAW;AAAA,IAClE,CAAC;AAED,aAAe,OAAO;AAAA;AACpB,cAAM,oBAAoB,IAAI;AAC9B,cAAM,kBAAkB,IAAI;AAC5B,cAAM,qBAAqB,IAAI;AAC/B,cAAM,kBAAkB,IAAI;AAAA,MAC9B;AAAA;AAEA,SAAK;AAAA;AAAA;",
4
+ "sourcesContent": ["import fs from \"fs\";\nimport path from \"path\";\nimport NiceBenchmark from \"./nice-benchmark\";\nimport schema from \"./swapi-schema\";\nimport resolvers from \"./swapi-schema/resolvers\";\nimport models from \"./swapi-schema/models\";\nimport {\n execute as graphqlExecute,\n parse,\n // experimentalExecuteIncrementally as graphqlExecute,\n} from \"graphql\";\nimport { compileQuery, isCompiledQuery } from \"graphql-jit\";\nimport { executeWithoutSchema as supermassiveExecute } from \"../executeWithoutSchema\";\nimport { UserResolvers, SchemaFragment } from \"../types\";\nimport { extractMinimalViableSchemaForRequestDocument } from \"../utilities/extractMinimalViableSchemaForRequestDocument\";\n\nconst query = fs.readFileSync(\n path.join(__dirname, \"./fixtures/query1.graphql\"),\n {\n encoding: \"utf-8\",\n },\n);\n\nconst parsedQuery = parse(query);\nconst compiledQuery = compileQuery(schema, parsedQuery);\n\nconst { definitions } = extractMinimalViableSchemaForRequestDocument(\n schema,\n parsedQuery,\n);\n\nconst schemaFragment: SchemaFragment = {\n schemaId: \"benchmark\",\n definitions,\n resolvers: resolvers as UserResolvers,\n};\n\nconst queryRunningSuite = new NiceBenchmark(\"Query Running\");\nqueryRunningSuite.add(\"graphql-js - string queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parse(query),\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-js - parsed queries\", async () => {\n const result = await graphqlExecute({\n schema,\n document: parsedQuery,\n contextValue: { models },\n });\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - uncompiled\", async () => {\n const freshCompiledQuery = compileQuery(schema, parsedQuery);\n if (isCompiledQuery(freshCompiledQuery)) {\n const result = await freshCompiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"graphql-jit - precompiled\", async () => {\n if (isCompiledQuery(compiledQuery)) {\n const result = await compiledQuery.query({}, { models }, {});\n if (result.errors || !result.data) {\n throw new Error(\"Stuff ain't executing\");\n }\n } else {\n throw new Error(\"Wrong query\");\n }\n});\nqueryRunningSuite.add(\"supermassive - runtime schemaless\", async () => {\n const result = await supermassiveExecute({\n schemaFragment,\n document: parsedQuery,\n contextValue: { models },\n });\n if (\"data\" in result && (result.errors || !result.data)) {\n throw new Error(\"Stuff ain't executing\");\n }\n});\n\nconst queryParsingSuite = new NiceBenchmark(\"Query parsing\");\nqueryParsingSuite.add(\"graphql-js\", async () => {\n parse(query);\n});\n\nconst queryCompilingSuite = new NiceBenchmark(\"Query compiling\");\nqueryCompilingSuite.add(\"graphql-jit\", async () => {\n await compileQuery(schema, parsedQuery);\n});\n\nconst queryAnnotationSuite = new NiceBenchmark(\"Query annotation\");\nqueryAnnotationSuite.add(\"supermassive\", () => {\n extractMinimalViableSchemaForRequestDocument(schema, parsedQuery);\n});\n\nasync function main() {\n await queryCompilingSuite.run();\n await queryParsingSuite.run();\n await queryAnnotationSuite.run();\n await queryRunningSuite.run();\n}\n\nmain();\n"],
5
+ "mappings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I;AAC9B,cAAM,kBAAkB,IAAI;AAC5B,cAAM,qBAAqB,IAAI;AAC/B,cAAM,kBAAkB,IAAI;AAAA,MAC9B;AAAA;AAEA,SAAK;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"collectFields.d.ts","sourceRoot":"","sources":["../src/collectFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAMV,MAAM,SAAS,CAAC;AAUjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,gBAAgB,EAC5B,eAAe,EAAE,MAAM,GACtB,gBAAgB,CAalB;AAED;;;;;;;;;GASG;AAEH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,gBAAgB,EAC5B,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,UAAU,GACrB,gBAAgB,CAuBlB"}
1
+ {"version":3,"file":"collectFields.d.ts","sourceRoot":"","sources":["../src/collectFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAMV,MAAM,SAAS,CAAC;AAUjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,gBAAgB,EAC5B,eAAe,EAAE,MAAM,GACtB,gBAAgB,CAalB;AAED;;;;;;;;;GASG;AAEH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,gBAAgB,EAC5B,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,UAAU,GACrB,gBAAgB,CAuBlB"}
@@ -37,6 +37,7 @@ var import_values = require("./values");
37
37
  var import_directives = require("./schema/directives");
38
38
  var import_AccumulatorMap = require("./jsutils/AccumulatorMap");
39
39
  var import_invariant = __toESM(require("invariant"));
40
+ var import_definition = require("./schema/definition");
40
41
  function collectFields(exeContext, runtimeTypeName) {
41
42
  const { operation } = exeContext;
42
43
  const groupedFieldSet = new import_AccumulatorMap.AccumulatorMap();
@@ -87,7 +88,7 @@ function collectFieldsImpl(exeContext, runtimeTypeName, selectionSet, groupedFie
87
88
  if (!shouldIncludeNode(exeContext, selection) || !doesFragmentConditionMatch(
88
89
  selection,
89
90
  runtimeTypeName,
90
- exeContext.partialSchema
91
+ exeContext.schemaFragment
91
92
  )) {
92
93
  continue;
93
94
  }
@@ -131,7 +132,7 @@ function collectFieldsImpl(exeContext, runtimeTypeName, selectionSet, groupedFie
131
132
  if (fragment == null || !doesFragmentConditionMatch(
132
133
  fragment,
133
134
  runtimeTypeName,
134
- exeContext.partialSchema
135
+ exeContext.schemaFragment
135
136
  )) {
136
137
  continue;
137
138
  }
@@ -182,7 +183,7 @@ function shouldIncludeNode(exeContext, node) {
182
183
  }
183
184
  return true;
184
185
  }
185
- function doesFragmentConditionMatch(fragment, typeName, schemaFragment) {
186
+ function doesFragmentConditionMatch(fragment, typeName, { definitions }) {
186
187
  const typeConditionNode = fragment.typeCondition;
187
188
  if (!typeConditionNode) {
188
189
  return true;
@@ -191,8 +192,8 @@ function doesFragmentConditionMatch(fragment, typeName, schemaFragment) {
191
192
  if (conditionalTypeName === typeName) {
192
193
  return true;
193
194
  }
194
- if (schemaFragment.isAbstractType(conditionalTypeName)) {
195
- return schemaFragment.isSubType(conditionalTypeName, typeName);
195
+ if ((0, import_definition.isAbstractType)(definitions, conditionalTypeName)) {
196
+ return (0, import_definition.isSubType)(definitions, conditionalTypeName, typeName);
196
197
  }
197
198
  return false;
198
199
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/collectFields.ts"],
4
- "sourcesContent": ["import {\n Kind,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionNode,\n SelectionSetNode,\n} from \"graphql\";\nimport { getDirectiveValues } from \"./values\";\nimport {\n GraphQLSkipDirective,\n GraphQLIncludeDirective,\n GraphQLDeferDirective,\n} from \"./schema/directives\";\n\nimport { AccumulatorMap } from \"./jsutils/AccumulatorMap\";\nimport invariant from \"invariant\";\nimport { ExecutionContext } from \"./executeWithoutSchema\";\nimport { PartialSchema } from \"./schema/fragment\";\n\nexport type FieldGroup = ReadonlyArray<FieldNode>;\n\nexport type GroupedFieldSet = Map<string, FieldGroup>;\n\nexport interface PatchFields {\n label: string | undefined;\n groupedFieldSet: GroupedFieldSet;\n}\n\nexport interface FieldsAndPatches {\n groupedFieldSet: GroupedFieldSet;\n patches: Array<PatchFields>;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\nexport function collectFields(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n): FieldsAndPatches {\n const { operation } = exeContext;\n const groupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const patches: Array<PatchFields> = [];\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n operation.selectionSet,\n groupedFieldSet,\n patches,\n new Set(),\n );\n return { groupedFieldSet, patches };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n exeContext: ExecutionContext,\n returnTypeName: string,\n fieldGroup: FieldGroup,\n): FieldsAndPatches {\n const subGroupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const visitedFragmentNames = new Set<string>();\n\n const subPatches: Array<PatchFields> = [];\n const subFieldsAndPatches = {\n groupedFieldSet: subGroupedFieldSet,\n patches: subPatches,\n };\n\n for (const node of fieldGroup) {\n if (node.selectionSet) {\n collectFieldsImpl(\n exeContext,\n returnTypeName,\n node.selectionSet,\n subGroupedFieldSet,\n subPatches,\n visitedFragmentNames,\n );\n }\n }\n return subFieldsAndPatches;\n}\n\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldNode>,\n patches: Array<PatchFields>,\n visitedFragmentNames: Set<string>,\n): void {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), selection);\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(exeContext, selection) ||\n !doesFragmentConditionMatch(\n selection,\n runtimeTypeName,\n exeContext.partialSchema,\n )\n ) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n if (visitedFragmentNames.has(fragName) && !defer) {\n continue;\n }\n\n const fragment = exeContext.fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(\n fragment,\n runtimeTypeName,\n exeContext.partialSchema,\n )\n ) {\n continue;\n }\n\n if (!defer) {\n visitedFragmentNames.add(fragName);\n }\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n }\n }\n}\n\n/**\n * Determines if a field should be included based on the @include and @skip\n * directives, where @skip has higher precedence than @include.\n */\nfunction shouldIncludeNode(\n exeContext: ExecutionContext,\n node: SelectionNode,\n): boolean {\n if (!node.directives?.length) {\n return true;\n }\n\n const skip = getDirectiveValues(exeContext, GraphQLSkipDirective, node);\n if (skip?.if === true) {\n return false;\n }\n\n const include = getDirectiveValues(exeContext, GraphQLIncludeDirective, node);\n if (include?.if === false) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n typeName: string,\n // resolvers: Resolvers,\n schemaFragment: PartialSchema,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n\n const conditionalTypeName = typeConditionNode.name.value;\n\n if (conditionalTypeName === typeName) {\n return true;\n }\n if (schemaFragment.isAbstractType(conditionalTypeName)) {\n return schemaFragment.isSubType(conditionalTypeName, typeName);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferValues(\n exeContext: ExecutionContext,\n node: FragmentSpreadNode | InlineFragmentNode,\n): undefined | { label: string | undefined } {\n const defer = getDirectiveValues(exeContext, GraphQLDeferDirective, node);\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n invariant(\n exeContext.operation.operation !== \"subscription\",\n \"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.\",\n );\n\n return {\n label: typeof defer.label === \"string\" ? defer.label : undefined,\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAQO;AACP,oBAAmC;AACnC,wBAIO;AAEP,4BAA+B;AAC/B,uBAAsB;AA2Bf,SAAS,cACd,YACA,iBACkB;AAClB,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,kBAAkB,IAAI,qCAAkC;AAC9D,QAAM,UAA8B,CAAC;AACrC;AAAA,IACE;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,oBAAI,IAAI;AAAA,EACV;AACA,SAAO,EAAE,iBAAiB,QAAQ;AACpC;AAaO,SAAS,iBACd,YACA,gBACA,YACkB;AAClB,QAAM,qBAAqB,IAAI,qCAAkC;AACjE,QAA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ACtD,WAAO,eAAe,UAAU,qBAAqB,QAAQ;AAAA,EAC/D;AACA,SAAO;AACT;AAKA,SAAS,iBAAiB,MAAyB;AACjD,SAAO,KAAK,QAAQ,KAAK,MAAM,QAAQ,KAAK,KAAK;AACnD;AAOA,SAAS,eACP,YACA,MAC2C;AAC3C,QAAM,YAAQ,kCAAmB,YAAY,yCAAuB,IAAI;AAExE,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAEA,MAAI,MAAM,OAAO,OAAO;AACtB;AAAA,EACF;AAEA,uBAAAA;AAAA,IACE,WAAW,UAAU,cAAc;AAAA,IACnC;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ;AAAA,EACzD;AACF;",
4
+ "sourcesContent": ["import {\n Kind,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionNode,\n SelectionSetNode,\n} from \"graphql\";\nimport { getDirectiveValues } from \"./values\";\nimport {\n GraphQLSkipDirective,\n GraphQLIncludeDirective,\n GraphQLDeferDirective,\n} from \"./schema/directives\";\n\nimport { AccumulatorMap } from \"./jsutils/AccumulatorMap\";\nimport invariant from \"invariant\";\nimport { ExecutionContext } from \"./executeWithoutSchema\";\nimport { isAbstractType, isSubType } from \"./schema/definition\";\nimport { SchemaFragment } from \"./types\";\n\nexport type FieldGroup = ReadonlyArray<FieldNode>;\n\nexport type GroupedFieldSet = Map<string, FieldGroup>;\n\nexport interface PatchFields {\n label: string | undefined;\n groupedFieldSet: GroupedFieldSet;\n}\n\nexport interface FieldsAndPatches {\n groupedFieldSet: GroupedFieldSet;\n patches: Array<PatchFields>;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\nexport function collectFields(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n): FieldsAndPatches {\n const { operation } = exeContext;\n const groupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const patches: Array<PatchFields> = [];\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n operation.selectionSet,\n groupedFieldSet,\n patches,\n new Set(),\n );\n return { groupedFieldSet, patches };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n exeContext: ExecutionContext,\n returnTypeName: string,\n fieldGroup: FieldGroup,\n): FieldsAndPatches {\n const subGroupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const visitedFragmentNames = new Set<string>();\n\n const subPatches: Array<PatchFields> = [];\n const subFieldsAndPatches = {\n groupedFieldSet: subGroupedFieldSet,\n patches: subPatches,\n };\n\n for (const node of fieldGroup) {\n if (node.selectionSet) {\n collectFieldsImpl(\n exeContext,\n returnTypeName,\n node.selectionSet,\n subGroupedFieldSet,\n subPatches,\n visitedFragmentNames,\n );\n }\n }\n return subFieldsAndPatches;\n}\n\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldNode>,\n patches: Array<PatchFields>,\n visitedFragmentNames: Set<string>,\n): void {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), selection);\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(exeContext, selection) ||\n !doesFragmentConditionMatch(\n selection,\n runtimeTypeName,\n exeContext.schemaFragment,\n )\n ) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n if (visitedFragmentNames.has(fragName) && !defer) {\n continue;\n }\n\n const fragment = exeContext.fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(\n fragment,\n runtimeTypeName,\n exeContext.schemaFragment,\n )\n ) {\n continue;\n }\n\n if (!defer) {\n visitedFragmentNames.add(fragName);\n }\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n }\n }\n}\n\n/**\n * Determines if a field should be included based on the @include and @skip\n * directives, where @skip has higher precedence than @include.\n */\nfunction shouldIncludeNode(\n exeContext: ExecutionContext,\n node: SelectionNode,\n): boolean {\n if (!node.directives?.length) {\n return true;\n }\n\n const skip = getDirectiveValues(exeContext, GraphQLSkipDirective, node);\n if (skip?.if === true) {\n return false;\n }\n\n const include = getDirectiveValues(exeContext, GraphQLIncludeDirective, node);\n if (include?.if === false) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n typeName: string,\n { definitions }: SchemaFragment,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n\n const conditionalTypeName = typeConditionNode.name.value;\n\n if (conditionalTypeName === typeName) {\n return true;\n }\n if (isAbstractType(definitions, conditionalTypeName)) {\n return isSubType(definitions, conditionalTypeName, typeName);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferValues(\n exeContext: ExecutionContext,\n node: FragmentSpreadNode | InlineFragmentNode,\n): undefined | { label: string | undefined } {\n const defer = getDirectiveValues(exeContext, GraphQLDeferDirective, node);\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n invariant(\n exeContext.operation.operation !== \"subscription\",\n \"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.\",\n );\n\n return {\n label: typeof defer.label === \"string\" ? defer.label : undefined,\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAQO;AACP,oBAAmC;AACnC,wBAIO;AAEP,4BAA+B;AAC/B,uBAAsB;AAEtB,wBAA0C;AA0BnC,SAAS,cACd,YACA,iBACkB;AAClB,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,kBAAkB,IAAI,qCAAkC;AAC9D,QAAM,UAA8B,CAAC;AACrC;AAAA,IACE;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,oBAAI,IAAI;AAAA,EACV;AACA,SAAO,EAAE,iBAAiB,QAAQ;AACpC;AAaO,SAAS,iBACd,YACA,gBACA,YACkB;AAClB,QAAM,qBAAqB,IAAI,qCAAkC;AACjE,QAA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mB,GAAG;AACpD,eAAO,6BAAU,aAAa,qBAAqB,QAAQ;AAAA,EAC7D;AACA,SAAO;AACT;AAKA,SAAS,iBAAiB,MAAyB;AACjD,SAAO,KAAK,QAAQ,KAAK,MAAM,QAAQ,KAAK,KAAK;AACnD;AAOA,SAAS,eACP,YACA,MAC2C;AAC3C,QAAM,YAAQ,kCAAmB,YAAY,yCAAuB,IAAI;AAExE,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAEA,MAAI,MAAM,OAAO,OAAO;AACtB;AAAA,EACF;AAEA,uBAAAA;AAAA,IACE,WAAW,UAAU,cAAc;AAAA,IACnC;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ;AAAA,EACzD;AACF;",
6
6
  "names": ["invariant"]
7
7
  }
@@ -10,6 +10,7 @@ import {
10
10
  } from "./schema/directives.mjs";
11
11
  import { AccumulatorMap } from "./jsutils/AccumulatorMap.mjs";
12
12
  import invariant from "invariant";
13
+ import { isAbstractType, isSubType } from "./schema/definition.mjs";
13
14
  function collectFields(exeContext, runtimeTypeName) {
14
15
  const { operation } = exeContext;
15
16
  const groupedFieldSet = new AccumulatorMap();
@@ -60,7 +61,7 @@ function collectFieldsImpl(exeContext, runtimeTypeName, selectionSet, groupedFie
60
61
  if (!shouldIncludeNode(exeContext, selection) || !doesFragmentConditionMatch(
61
62
  selection,
62
63
  runtimeTypeName,
63
- exeContext.partialSchema
64
+ exeContext.schemaFragment
64
65
  )) {
65
66
  continue;
66
67
  }
@@ -104,7 +105,7 @@ function collectFieldsImpl(exeContext, runtimeTypeName, selectionSet, groupedFie
104
105
  if (fragment == null || !doesFragmentConditionMatch(
105
106
  fragment,
106
107
  runtimeTypeName,
107
- exeContext.partialSchema
108
+ exeContext.schemaFragment
108
109
  )) {
109
110
  continue;
110
111
  }
@@ -155,7 +156,7 @@ function shouldIncludeNode(exeContext, node) {
155
156
  }
156
157
  return true;
157
158
  }
158
- function doesFragmentConditionMatch(fragment, typeName, schemaFragment) {
159
+ function doesFragmentConditionMatch(fragment, typeName, { definitions }) {
159
160
  const typeConditionNode = fragment.typeCondition;
160
161
  if (!typeConditionNode) {
161
162
  return true;
@@ -164,8 +165,8 @@ function doesFragmentConditionMatch(fragment, typeName, schemaFragment) {
164
165
  if (conditionalTypeName === typeName) {
165
166
  return true;
166
167
  }
167
- if (schemaFragment.isAbstractType(conditionalTypeName)) {
168
- return schemaFragment.isSubType(conditionalTypeName, typeName);
168
+ if (isAbstractType(definitions, conditionalTypeName)) {
169
+ return isSubType(definitions, conditionalTypeName, typeName);
169
170
  }
170
171
  return false;
171
172
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/collectFields.ts"],
4
- "sourcesContent": ["import {\n Kind,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionNode,\n SelectionSetNode,\n} from \"graphql\";\nimport { getDirectiveValues } from \"./values\";\nimport {\n GraphQLSkipDirective,\n GraphQLIncludeDirective,\n GraphQLDeferDirective,\n} from \"./schema/directives\";\n\nimport { AccumulatorMap } from \"./jsutils/AccumulatorMap\";\nimport invariant from \"invariant\";\nimport { ExecutionContext } from \"./executeWithoutSchema\";\nimport { PartialSchema } from \"./schema/fragment\";\n\nexport type FieldGroup = ReadonlyArray<FieldNode>;\n\nexport type GroupedFieldSet = Map<string, FieldGroup>;\n\nexport interface PatchFields {\n label: string | undefined;\n groupedFieldSet: GroupedFieldSet;\n}\n\nexport interface FieldsAndPatches {\n groupedFieldSet: GroupedFieldSet;\n patches: Array<PatchFields>;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\nexport function collectFields(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n): FieldsAndPatches {\n const { operation } = exeContext;\n const groupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const patches: Array<PatchFields> = [];\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n operation.selectionSet,\n groupedFieldSet,\n patches,\n new Set(),\n );\n return { groupedFieldSet, patches };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n exeContext: ExecutionContext,\n returnTypeName: string,\n fieldGroup: FieldGroup,\n): FieldsAndPatches {\n const subGroupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const visitedFragmentNames = new Set<string>();\n\n const subPatches: Array<PatchFields> = [];\n const subFieldsAndPatches = {\n groupedFieldSet: subGroupedFieldSet,\n patches: subPatches,\n };\n\n for (const node of fieldGroup) {\n if (node.selectionSet) {\n collectFieldsImpl(\n exeContext,\n returnTypeName,\n node.selectionSet,\n subGroupedFieldSet,\n subPatches,\n visitedFragmentNames,\n );\n }\n }\n return subFieldsAndPatches;\n}\n\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldNode>,\n patches: Array<PatchFields>,\n visitedFragmentNames: Set<string>,\n): void {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), selection);\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(exeContext, selection) ||\n !doesFragmentConditionMatch(\n selection,\n runtimeTypeName,\n exeContext.partialSchema,\n )\n ) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n if (visitedFragmentNames.has(fragName) && !defer) {\n continue;\n }\n\n const fragment = exeContext.fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(\n fragment,\n runtimeTypeName,\n exeContext.partialSchema,\n )\n ) {\n continue;\n }\n\n if (!defer) {\n visitedFragmentNames.add(fragName);\n }\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n }\n }\n}\n\n/**\n * Determines if a field should be included based on the @include and @skip\n * directives, where @skip has higher precedence than @include.\n */\nfunction shouldIncludeNode(\n exeContext: ExecutionContext,\n node: SelectionNode,\n): boolean {\n if (!node.directives?.length) {\n return true;\n }\n\n const skip = getDirectiveValues(exeContext, GraphQLSkipDirective, node);\n if (skip?.if === true) {\n return false;\n }\n\n const include = getDirectiveValues(exeContext, GraphQLIncludeDirective, node);\n if (include?.if === false) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n typeName: string,\n // resolvers: Resolvers,\n schemaFragment: PartialSchema,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n\n const conditionalTypeName = typeConditionNode.name.value;\n\n if (conditionalTypeName === typeName) {\n return true;\n }\n if (schemaFragment.isAbstractType(conditionalTypeName)) {\n return schemaFragment.isSubType(conditionalTypeName, typeName);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferValues(\n exeContext: ExecutionContext,\n node: FragmentSpreadNode | InlineFragmentNode,\n): undefined | { label: string | undefined } {\n const defer = getDirectiveValues(exeContext, GraphQLDeferDirective, node);\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n invariant(\n exeContext.operation.operation !== \"subscription\",\n \"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.\",\n );\n\n return {\n label: typeof defer.label === \"string\" ? defer.label : undefined,\n };\n}\n"],
5
- "mappings": ";AAAA;AAAA,EACE;AAAA,OAOK;AACP,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,sBAAsB;AAC/B,OAAO,eAAe;AA2Bf,SAAS,cACd,YACA,iBACkB;AAClB,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,kBAAkB,IAAI,eAAkC;AAC9D,QAAM,UAA8B,CAAC;AACrC;AAAA,IACE;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,oBAAI,IAAI;AAAA,EACV;AACA,SAAO,EAAE,iBAAiB,QAAQ;AACpC;AAaO,SAAS,iBACd,YACA,gBACA,YACkB;AAClB,QAAM,qBAAqB,IAAI,eAAkC;AACjE,QAAM,uBAAuB,oBAAI,IAAY;A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QAAQ;AAAA,EAC/D;AACA,SAAO;AACT;AAKA,SAAS,iBAAiB,MAAyB;AACjD,SAAO,KAAK,QAAQ,KAAK,MAAM,QAAQ,KAAK,KAAK;AACnD;AAOA,SAAS,eACP,YACA,MAC2C;AAC3C,QAAM,QAAQ,mBAAmB,YAAY,uBAAuB,IAAI;AAExE,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAEA,MAAI,MAAM,OAAO,OAAO;AACtB;AAAA,EACF;AAEA;AAAA,IACE,WAAW,UAAU,cAAc;AAAA,IACnC;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ;AAAA,EACzD;AACF;",
4
+ "sourcesContent": ["import {\n Kind,\n FieldNode,\n FragmentDefinitionNode,\n FragmentSpreadNode,\n InlineFragmentNode,\n SelectionNode,\n SelectionSetNode,\n} from \"graphql\";\nimport { getDirectiveValues } from \"./values\";\nimport {\n GraphQLSkipDirective,\n GraphQLIncludeDirective,\n GraphQLDeferDirective,\n} from \"./schema/directives\";\n\nimport { AccumulatorMap } from \"./jsutils/AccumulatorMap\";\nimport invariant from \"invariant\";\nimport { ExecutionContext } from \"./executeWithoutSchema\";\nimport { isAbstractType, isSubType } from \"./schema/definition\";\nimport { SchemaFragment } from \"./types\";\n\nexport type FieldGroup = ReadonlyArray<FieldNode>;\n\nexport type GroupedFieldSet = Map<string, FieldGroup>;\n\nexport interface PatchFields {\n label: string | undefined;\n groupedFieldSet: GroupedFieldSet;\n}\n\nexport interface FieldsAndPatches {\n groupedFieldSet: GroupedFieldSet;\n patches: Array<PatchFields>;\n}\n\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\nexport function collectFields(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n): FieldsAndPatches {\n const { operation } = exeContext;\n const groupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const patches: Array<PatchFields> = [];\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n operation.selectionSet,\n groupedFieldSet,\n patches,\n new Set(),\n );\n return { groupedFieldSet, patches };\n}\n\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n// eslint-disable-next-line max-params\nexport function collectSubfields(\n exeContext: ExecutionContext,\n returnTypeName: string,\n fieldGroup: FieldGroup,\n): FieldsAndPatches {\n const subGroupedFieldSet = new AccumulatorMap<string, FieldNode>();\n const visitedFragmentNames = new Set<string>();\n\n const subPatches: Array<PatchFields> = [];\n const subFieldsAndPatches = {\n groupedFieldSet: subGroupedFieldSet,\n patches: subPatches,\n };\n\n for (const node of fieldGroup) {\n if (node.selectionSet) {\n collectFieldsImpl(\n exeContext,\n returnTypeName,\n node.selectionSet,\n subGroupedFieldSet,\n subPatches,\n visitedFragmentNames,\n );\n }\n }\n return subFieldsAndPatches;\n}\n\n// eslint-disable-next-line max-params\nfunction collectFieldsImpl(\n exeContext: ExecutionContext,\n runtimeTypeName: string,\n selectionSet: SelectionSetNode,\n groupedFieldSet: AccumulatorMap<string, FieldNode>,\n patches: Array<PatchFields>,\n visitedFragmentNames: Set<string>,\n): void {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n groupedFieldSet.add(getFieldEntryKey(selection), selection);\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(exeContext, selection) ||\n !doesFragmentConditionMatch(\n selection,\n runtimeTypeName,\n exeContext.schemaFragment,\n )\n ) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n selection.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (!shouldIncludeNode(exeContext, selection)) {\n continue;\n }\n\n const defer = getDeferValues(exeContext, selection);\n if (visitedFragmentNames.has(fragName) && !defer) {\n continue;\n }\n\n const fragment = exeContext.fragments[fragName];\n if (\n fragment == null ||\n !doesFragmentConditionMatch(\n fragment,\n runtimeTypeName,\n exeContext.schemaFragment,\n )\n ) {\n continue;\n }\n\n if (!defer) {\n visitedFragmentNames.add(fragName);\n }\n\n if (defer) {\n const patchFields = new AccumulatorMap<string, FieldNode>();\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n patchFields,\n patches,\n visitedFragmentNames,\n );\n patches.push({\n label: defer.label,\n groupedFieldSet: patchFields,\n });\n } else {\n collectFieldsImpl(\n exeContext,\n runtimeTypeName,\n fragment.selectionSet,\n groupedFieldSet,\n patches,\n visitedFragmentNames,\n );\n }\n break;\n }\n }\n }\n}\n\n/**\n * Determines if a field should be included based on the @include and @skip\n * directives, where @skip has higher precedence than @include.\n */\nfunction shouldIncludeNode(\n exeContext: ExecutionContext,\n node: SelectionNode,\n): boolean {\n if (!node.directives?.length) {\n return true;\n }\n\n const skip = getDirectiveValues(exeContext, GraphQLSkipDirective, node);\n if (skip?.if === true) {\n return false;\n }\n\n const include = getDirectiveValues(exeContext, GraphQLIncludeDirective, node);\n if (include?.if === false) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n typeName: string,\n { definitions }: SchemaFragment,\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n\n const conditionalTypeName = typeConditionNode.name.value;\n\n if (conditionalTypeName === typeName) {\n return true;\n }\n if (isAbstractType(definitions, conditionalTypeName)) {\n return isSubType(definitions, conditionalTypeName, typeName);\n }\n return false;\n}\n\n/**\n * Implements the logic to compute the key of a given field's entry\n */\nfunction getFieldEntryKey(node: FieldNode): string {\n return node.alias ? node.alias.value : node.name.value;\n}\n\n/**\n * Returns an object containing the `@defer` arguments if a field should be\n * deferred based on the experimental flag, defer directive present and\n * not disabled by the \"if\" argument.\n */\nfunction getDeferValues(\n exeContext: ExecutionContext,\n node: FragmentSpreadNode | InlineFragmentNode,\n): undefined | { label: string | undefined } {\n const defer = getDirectiveValues(exeContext, GraphQLDeferDirective, node);\n\n if (!defer) {\n return;\n }\n\n if (defer.if === false) {\n return;\n }\n\n invariant(\n exeContext.operation.operation !== \"subscription\",\n \"`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.\",\n );\n\n return {\n label: typeof defer.label === \"string\" ? defer.label : undefined,\n };\n}\n"],
5
+ "mappings": ";AAAA;AAAA,EACE;AAAA,OAOK;AACP,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,sBAAsB;AAC/B,OAAO,eAAe;AAEtB,SAAS,gBAAgB,iBAAiB;AA0BnC,SAAS,cACd,YACA,iBACkB;AAClB,QAAM,EAAE,UAAU,IAAI;AACtB,QAAM,kBAAkB,IAAI,eAAkC;AAC9D,QAAM,UAA8B,CAAC;AACrC;AAAA,IACE;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,oBAAI,IAAI;AAAA,EACV;AACA,SAAO,EAAE,iBAAiB,QAAQ;AACpC;AAaO,SAAS,iBACd,YACA,gBACA,YACkB;AAClB,QAAM,qBAAqB,IAAI,eAAkC;AACjE,QAAM,uBAAuB,oBAAI,IAAY;AAE7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AAqB,QAAQ;AAAA,EAC7D;AACA,SAAO;AACT;AAKA,SAAS,iBAAiB,MAAyB;AACjD,SAAO,KAAK,QAAQ,KAAK,MAAM,QAAQ,KAAK,KAAK;AACnD;AAOA,SAAS,eACP,YACA,MAC2C;AAC3C,QAAM,QAAQ,mBAAmB,YAAY,uBAAuB,IAAI;AAExE,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAEA,MAAI,MAAM,OAAO,OAAO;AACtB;AAAA,EACF;AAEA;AAAA,IACE,WAAW,UAAU,cAAc;AAAA,IACnC;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ;AAAA,EACzD;AACF;",
6
6
  "names": []
7
7
  }
@@ -4,9 +4,8 @@ import type { Maybe } from "./jsutils/Maybe";
4
4
  import type { ObjMap } from "./jsutils/ObjMap";
5
5
  import type { Path } from "./jsutils/Path";
6
6
  import type { PromiseOrValue } from "./jsutils/PromiseOrValue";
7
- import { ExecutionWithoutSchemaArgs, FunctionFieldResolver, ResolveInfo, TypeResolver, ExecutionResult, IncrementalExecutionResult } from "./types";
7
+ import type { ExecutionWithoutSchemaArgs, FunctionFieldResolver, ResolveInfo, TypeResolver, ExecutionResult, IncrementalExecutionResult, SchemaFragment, SchemaFragmentLoader } from "./types";
8
8
  import { ExecutionHooks } from "./hooks/types";
9
- import { PartialSchema, SchemaFragment, SchemaFragmentLoader } from "./schema/fragment";
10
9
  /**
11
10
  * Terminology
12
11
  *
@@ -33,7 +32,6 @@ import { PartialSchema, SchemaFragment, SchemaFragmentLoader } from "./schema/fr
33
32
  * and the fragments defined in the query document
34
33
  */
35
34
  export interface ExecutionContext {
36
- partialSchema: PartialSchema;
37
35
  schemaFragment: SchemaFragment;
38
36
  schemaFragmentLoader?: SchemaFragmentLoader;
39
37
  fragments: ObjMap<FragmentDefinitionNode>;
@@ -1 +1 @@
1
- {"version":3,"file":"executeWithoutSchema.d.ts","sourceRoot":"","sources":["../src/execute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