graphql-jit 0.8.9 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +25 -0
  2. package/dist/cjs/ast.d.ts +89 -0
  3. package/dist/cjs/ast.js +766 -0
  4. package/dist/cjs/ast.js.map +1 -0
  5. package/dist/cjs/compat.d.ts +70 -0
  6. package/dist/cjs/compat.js +144 -0
  7. package/dist/cjs/compat.js.map +1 -0
  8. package/dist/cjs/debug.d.ts +29 -0
  9. package/dist/cjs/debug.js +46 -0
  10. package/dist/cjs/debug.js.map +1 -0
  11. package/dist/cjs/error.d.ts +7 -0
  12. package/dist/cjs/error.js +58 -0
  13. package/dist/cjs/error.js.map +1 -0
  14. package/dist/cjs/execution.d.ts +154 -0
  15. package/dist/cjs/execution.js +1240 -0
  16. package/dist/cjs/execution.js.map +1 -0
  17. package/dist/cjs/generate.d.ts +4 -0
  18. package/dist/cjs/generate.js +13 -0
  19. package/dist/cjs/generate.js.map +1 -0
  20. package/dist/cjs/index.d.ts +3 -0
  21. package/dist/cjs/index.js +10 -0
  22. package/dist/cjs/index.js.map +1 -0
  23. package/dist/cjs/inspect.d.ts +5 -0
  24. package/dist/cjs/inspect.js +110 -0
  25. package/dist/cjs/inspect.js.map +1 -0
  26. package/dist/cjs/json.d.ts +9 -0
  27. package/dist/cjs/json.js +144 -0
  28. package/dist/cjs/json.js.map +1 -0
  29. package/dist/cjs/memoize.d.ts +5 -0
  30. package/dist/cjs/memoize.js +28 -0
  31. package/dist/cjs/memoize.js.map +1 -0
  32. package/dist/cjs/non-null.d.ts +9 -0
  33. package/dist/cjs/non-null.js +205 -0
  34. package/dist/cjs/non-null.js.map +1 -0
  35. package/dist/cjs/package.json +3 -0
  36. package/dist/{resolve-info.d.ts → cjs/resolve-info.d.ts} +10 -12
  37. package/dist/cjs/resolve-info.js +232 -0
  38. package/dist/cjs/resolve-info.js.map +1 -0
  39. package/dist/cjs/runtime.d.ts +14 -0
  40. package/dist/cjs/runtime.js +92 -0
  41. package/dist/cjs/runtime.js.map +1 -0
  42. package/dist/cjs/types.d.ts +1 -0
  43. package/dist/cjs/types.js +3 -0
  44. package/dist/cjs/types.js.map +1 -0
  45. package/dist/cjs/variables.d.ts +20 -0
  46. package/dist/cjs/variables.js +357 -0
  47. package/dist/cjs/variables.js.map +1 -0
  48. package/dist/esm/ast.d.ts +89 -0
  49. package/dist/esm/ast.js +751 -0
  50. package/dist/esm/ast.js.map +1 -0
  51. package/dist/esm/compat.d.ts +70 -0
  52. package/dist/esm/compat.js +102 -0
  53. package/dist/esm/compat.js.map +1 -0
  54. package/dist/esm/debug.d.ts +29 -0
  55. package/dist/esm/debug.js +40 -0
  56. package/dist/esm/debug.js.map +1 -0
  57. package/dist/esm/error.d.ts +7 -0
  58. package/dist/esm/error.js +55 -0
  59. package/dist/esm/error.js.map +1 -0
  60. package/dist/esm/execution.d.ts +154 -0
  61. package/dist/esm/execution.js +1227 -0
  62. package/dist/esm/execution.js.map +1 -0
  63. package/dist/esm/generate.d.ts +4 -0
  64. package/dist/esm/generate.js +10 -0
  65. package/dist/esm/generate.js.map +1 -0
  66. package/dist/esm/index.d.ts +3 -0
  67. package/dist/esm/index.js +3 -0
  68. package/dist/esm/index.js.map +1 -0
  69. package/dist/esm/inspect.d.ts +5 -0
  70. package/dist/esm/inspect.js +106 -0
  71. package/dist/esm/inspect.js.map +1 -0
  72. package/dist/esm/json.d.ts +9 -0
  73. package/dist/esm/json.js +141 -0
  74. package/dist/esm/json.js.map +1 -0
  75. package/dist/esm/memoize.d.ts +5 -0
  76. package/dist/esm/memoize.js +20 -0
  77. package/dist/esm/memoize.js.map +1 -0
  78. package/dist/esm/non-null.d.ts +9 -0
  79. package/dist/esm/non-null.js +199 -0
  80. package/dist/esm/non-null.js.map +1 -0
  81. package/dist/esm/package.json +3 -0
  82. package/dist/{resolve-info.d.mts → esm/resolve-info.d.ts} +10 -12
  83. package/dist/esm/resolve-info.js +224 -0
  84. package/dist/esm/resolve-info.js.map +1 -0
  85. package/dist/esm/runtime.d.ts +14 -0
  86. package/dist/esm/runtime.js +89 -0
  87. package/dist/esm/runtime.js.map +1 -0
  88. package/dist/esm/types.d.ts +1 -0
  89. package/dist/esm/types.js +2 -0
  90. package/dist/esm/types.js.map +1 -0
  91. package/dist/esm/variables.d.ts +20 -0
  92. package/dist/esm/variables.js +350 -0
  93. package/dist/esm/variables.js.map +1 -0
  94. package/package.json +39 -35
  95. package/dist/ast.d.mts +0 -7
  96. package/dist/ast.d.ts +0 -7
  97. package/dist/ast.js +0 -635
  98. package/dist/ast.js.map +0 -1
  99. package/dist/ast.mjs +0 -612
  100. package/dist/ast.mjs.map +0 -1
  101. package/dist/compat.d.mts +0 -7
  102. package/dist/compat.d.ts +0 -7
  103. package/dist/compat.js +0 -113
  104. package/dist/compat.js.map +0 -1
  105. package/dist/compat.mjs +0 -75
  106. package/dist/compat.mjs.map +0 -1
  107. package/dist/error.d.mts +0 -11
  108. package/dist/error.d.ts +0 -11
  109. package/dist/error.js +0 -79
  110. package/dist/error.js.map +0 -1
  111. package/dist/error.mjs +0 -57
  112. package/dist/error.mjs.map +0 -1
  113. package/dist/execution.d.mts +0 -7
  114. package/dist/execution.d.ts +0 -7
  115. package/dist/execution.js +0 -1262
  116. package/dist/execution.js.map +0 -1
  117. package/dist/execution.mjs +0 -1248
  118. package/dist/execution.mjs.map +0 -1
  119. package/dist/generate.d.mts +0 -6
  120. package/dist/generate.d.ts +0 -6
  121. package/dist/generate.js +0 -37
  122. package/dist/generate.js.map +0 -1
  123. package/dist/generate.mjs +0 -13
  124. package/dist/generate.mjs.map +0 -1
  125. package/dist/index-CeluTkd4.d.mts +0 -329
  126. package/dist/index-mKv2zpdA.d.ts +0 -329
  127. package/dist/index.d.mts +0 -7
  128. package/dist/index.d.ts +0 -7
  129. package/dist/index.js +0 -36
  130. package/dist/index.js.map +0 -1
  131. package/dist/index.mjs +0 -15
  132. package/dist/index.mjs.map +0 -1
  133. package/dist/inspect.d.mts +0 -7
  134. package/dist/inspect.d.ts +0 -7
  135. package/dist/inspect.js +0 -121
  136. package/dist/inspect.js.map +0 -1
  137. package/dist/inspect.mjs +0 -97
  138. package/dist/inspect.mjs.map +0 -1
  139. package/dist/json.d.mts +0 -18
  140. package/dist/json.d.ts +0 -18
  141. package/dist/json.js +0 -181
  142. package/dist/json.js.map +0 -1
  143. package/dist/json.mjs +0 -164
  144. package/dist/json.mjs.map +0 -1
  145. package/dist/memoize.d.mts +0 -6
  146. package/dist/memoize.d.ts +0 -6
  147. package/dist/memoize.js +0 -67
  148. package/dist/memoize.js.map +0 -1
  149. package/dist/memoize.mjs +0 -31
  150. package/dist/memoize.mjs.map +0 -1
  151. package/dist/non-null.d.mts +0 -7
  152. package/dist/non-null.d.ts +0 -7
  153. package/dist/non-null.js +0 -196
  154. package/dist/non-null.js.map +0 -1
  155. package/dist/non-null.mjs +0 -167
  156. package/dist/non-null.mjs.map +0 -1
  157. package/dist/resolve-info.js +0 -245
  158. package/dist/resolve-info.js.map +0 -1
  159. package/dist/resolve-info.mjs +0 -219
  160. package/dist/resolve-info.mjs.map +0 -1
  161. package/dist/runtime.d.mts +0 -7
  162. package/dist/runtime.d.ts +0 -7
  163. package/dist/runtime.js +0 -115
  164. package/dist/runtime.js.map +0 -1
  165. package/dist/runtime.mjs +0 -91
  166. package/dist/runtime.mjs.map +0 -1
  167. package/dist/types.d.mts +0 -3
  168. package/dist/types.d.ts +0 -3
  169. package/dist/types.js +0 -17
  170. package/dist/types.js.map +0 -1
  171. package/dist/types.mjs +0 -1
  172. package/dist/types.mjs.map +0 -1
  173. package/dist/variables.d.mts +0 -17
  174. package/dist/variables.d.ts +0 -17
  175. package/dist/variables.js +0 -412
  176. package/dist/variables.js.map +0 -1
  177. package/dist/variables.mjs +0 -391
  178. package/dist/variables.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"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3B,2CAA2C;IAC3C,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,CAAC;AAChD,CAAC","sourcesContent":["import {\n type ArgumentNode,\n type ASTNode,\n type DirectiveNode,\n type FieldNode,\n type FragmentDefinitionNode,\n type GraphQLArgument,\n GraphQLDirective,\n GraphQLError,\n type GraphQLField,\n GraphQLIncludeDirective,\n type GraphQLInputType,\n GraphQLObjectType,\n GraphQLSkipDirective,\n type InlineFragmentNode,\n isEnumType,\n isInputObjectType,\n isListType,\n isNonNullType,\n isScalarType,\n print,\n type SelectionSetNode,\n type SourceLocation,\n typeFromAST,\n valueFromASTUntyped,\n type ValueNode,\n type VariableNode,\n Kind,\n type SelectionNode,\n type TypeNode,\n isAbstractType,\n Location,\n type ConstValueNode\n} from \"graphql\";\nimport { type CompilationContext, GLOBAL_VARIABLES_NAME } from \"./execution.js\";\nimport createInspect from \"./inspect.js\";\nimport {\n coerceInputLiteral,\n getDefaultValue,\n getGraphQLErrorOptions,\n hasDefaultValue,\n resolveFieldDef\n} from \"./compat.js\";\n\nexport interface JitFieldNode extends FieldNode {\n /**\n * @deprecated Use __internalShouldIncludePath instead\n * @see __internalShouldIncludePath\n */\n __internalShouldInclude?: string[];\n\n // The shouldInclude logic is specific to the current path\n // This is because the same fieldNode can be reached from different paths\n // - for example, the same fragment used in two different places\n __internalShouldIncludePath?: {\n // Key is the stringified ObjectPath,\n // Value is the shouldInclude logic for that path\n [path: string]: string[];\n };\n}\n\nexport interface FieldsAndNodes {\n [key: string]: JitFieldNode[];\n}\n\nconst inspect = createInspect();\n\n/**\n * Given a selectionSet, adds all of the fields in that selection to\n * the passed in map of fields, and returns it at the end.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field which\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * Object type returned by that field.\n */\nexport function collectFields(\n compilationContext: CompilationContext,\n runtimeType: GraphQLObjectType,\n selectionSet: SelectionSetNode,\n fields: FieldsAndNodes,\n visitedFragmentNames: { [key: string]: boolean },\n parentResponsePath?: ObjectPath\n): FieldsAndNodes {\n return collectFieldsImpl(\n compilationContext,\n runtimeType,\n selectionSet,\n fields,\n visitedFragmentNames,\n undefined,\n serializeObjectPathForSkipInclude(parentResponsePath)\n );\n}\n\n/**\n * Implementation of collectFields defined above with extra parameters\n * used for recursion and need not be exposed publically\n */\nfunction collectFieldsImpl(\n compilationContext: CompilationContext,\n runtimeType: GraphQLObjectType,\n selectionSet: SelectionSetNode,\n fields: FieldsAndNodes,\n visitedFragmentNames: { [key: string]: boolean },\n previousShouldInclude: string[] = [],\n parentResponsePath = \"\"\n): FieldsAndNodes {\n interface StackItem {\n selection: SelectionNode;\n parentResponsePath: string;\n previousShouldInclude: string[];\n }\n\n const stack: StackItem[] = [];\n\n // Push in reverse so that stack.pop() will process in document order\n for (let i = selectionSet.selections.length - 1; i >= 0; i--) {\n stack.push({\n selection: selectionSet.selections[i],\n parentResponsePath,\n previousShouldInclude\n });\n }\n\n while (stack.length > 0) {\n const { selection, parentResponsePath, previousShouldInclude } =\n stack.pop()!;\n\n switch (selection.kind) {\n case Kind.FIELD: {\n collectFieldsForField({\n compilationContext,\n fields,\n parentResponsePath,\n previousShouldInclude,\n selection\n });\n break;\n }\n\n case Kind.INLINE_FRAGMENT: {\n if (\n !doesFragmentConditionMatch(\n compilationContext,\n selection,\n runtimeType\n )\n ) {\n break;\n }\n\n // current fragment's shouldInclude\n const compiledSkipInclude = compileSkipInclude(\n compilationContext,\n selection\n );\n\n const mergedShouldInclude = joinShouldIncludeCompilations(\n previousShouldInclude,\n [compiledSkipInclude]\n );\n\n // Push in reverse so that stack.pop() will process in document order\n const selectionsLength = selection.selectionSet.selections.length;\n for (let i = selectionsLength - 1; i >= 0; i--) {\n stack.push({\n selection: selection.selectionSet.selections[i],\n parentResponsePath,\n previousShouldInclude: mergedShouldInclude\n });\n }\n break;\n }\n\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n if (visitedFragmentNames[fragName]) {\n break;\n }\n visitedFragmentNames[fragName] = true;\n const fragment = compilationContext.fragments[fragName];\n if (\n !fragment ||\n !doesFragmentConditionMatch(compilationContext, fragment, runtimeType)\n ) {\n break;\n }\n\n // current fragment's shouldInclude\n const compiledSkipInclude = compileSkipInclude(\n compilationContext,\n selection\n );\n\n const mergedShouldInclude = joinShouldIncludeCompilations(\n previousShouldInclude,\n [compiledSkipInclude]\n );\n\n // Push in reverse so that stack.pop() will process in document order\n const selectionsLength = fragment.selectionSet.selections.length;\n for (let i = selectionsLength - 1; i >= 0; i--) {\n stack.push({\n selection: fragment.selectionSet.selections[i],\n parentResponsePath,\n previousShouldInclude: mergedShouldInclude\n });\n }\n break;\n }\n }\n }\n\n return fields;\n}\n\nfunction collectFieldsForField({\n compilationContext,\n fields,\n parentResponsePath,\n previousShouldInclude,\n selection\n}: {\n compilationContext: CompilationContext;\n fields: FieldsAndNodes;\n parentResponsePath: string;\n previousShouldInclude: string[];\n selection: FieldNode;\n}) {\n const name = getFieldEntryKey(selection);\n if (!fields[name]) {\n fields[name] = [];\n }\n const fieldNode: JitFieldNode = selection;\n\n // the current path of the field\n // This is used to generate per path skip/include code\n // because the same field can be reached from different paths (e.g. fragment reuse)\n const currentPath = joinSkipIncludePath(\n parentResponsePath,\n\n // use alias(instead of selection.name.value) if available as the responsePath used for lookup uses alias\n name\n );\n\n // `should include`s generated for the current fieldNode\n const compiledSkipInclude = compileSkipInclude(compilationContext, selection);\n\n /**\n * Carry over fragment's skip and include code\n *\n * fieldNode.__internalShouldInclude\n * ---------------------------------\n * When the parent field has a skip or include, the current one\n * should be skipped if the parent is skipped in the path.\n *\n * previousShouldInclude\n * ---------------------\n * `should include`s from fragment spread and inline fragments\n *\n * compileSkipInclude(selection)\n * -----------------------------\n * `should include`s generated for the current fieldNode\n */\n if (compilationContext.options.useExperimentalPathBasedSkipInclude) {\n if (!fieldNode.__internalShouldIncludePath)\n fieldNode.__internalShouldIncludePath = {};\n\n fieldNode.__internalShouldIncludePath[currentPath] =\n joinShouldIncludeCompilations(\n fieldNode.__internalShouldIncludePath?.[currentPath] ?? [],\n previousShouldInclude,\n [compiledSkipInclude]\n );\n } else {\n // @deprecated\n fieldNode.__internalShouldInclude = joinShouldIncludeCompilations(\n fieldNode.__internalShouldInclude ?? [],\n previousShouldInclude,\n [compiledSkipInclude]\n );\n }\n /**\n * We augment the entire subtree as the parent object's skip/include\n * directives influence the child even if the child doesn't have\n * skip/include on it's own.\n *\n * Refer the function definition for example.\n */\n augmentFieldNodeTree(compilationContext, fieldNode, currentPath);\n\n fields[name].push(fieldNode);\n}\n\n/**\n * Augment __internalShouldInclude code for all sub-fields in the\n * tree with @param rootfieldNode as the root.\n *\n * This is required to handle cases where there are multiple paths to\n * the same node. And each of those paths contain different skip/include\n * values.\n *\n * For example,\n *\n * ```\n * {\n * foo @skip(if: $c1) {\n * bar @skip(if: $c2)\n * }\n * ... {\n * foo @skip(if: $c3) {\n * bar\n * }\n * }\n * }\n * ```\n *\n * We decide shouldInclude at runtime per fieldNode. When we handle the\n * field `foo`, the logic is straight forward - it requires one of $c1 or $c3\n * to be false.\n *\n * But, when we handle the field `bar`, and we are in the context of the fieldNode,\n * not enough information is available. This is because, if we only included $c2\n * to decide if bar is included, consider the case -\n *\n * $c1: true, $c2: true, $c3: false\n *\n * If we considered only $c2, we would have skipped bar. But the correct implementation\n * is to include bar, because foo($c3) { bar } is not skipped. The entire sub-tree's\n * logic is required to handle bar.\n *\n * So, to handle this case, we augment the tree at each point to consider the\n * skip/include logic from the parent as well.\n *\n * @param compilationContext {CompilationContext} Required for getFragment by\n * name to handle fragment spread operation.\n *\n * @param rootFieldNode {JitFieldNode} The root field to traverse from for\n * adding __internalShouldInclude to all sub field nodes.\n *\n * @param parentResponsePath {string} The response path of the parent field.\n */\nfunction augmentFieldNodeTree(\n compilationContext: CompilationContext,\n rootFieldNode: JitFieldNode,\n parentResponsePath: string\n) {\n for (const selection of rootFieldNode.selectionSet?.selections ?? []) {\n /**\n * Traverse through sub-selection and combine `shouldInclude`s\n * from parent and current ones.\n */\n interface StackItem {\n parentFieldNode: JitFieldNode;\n selection: SelectionNode;\n comesFromFragmentSpread: boolean;\n parentResponsePath: string;\n }\n\n const stack: StackItem[] = [];\n\n stack.push({\n parentFieldNode: rootFieldNode,\n selection,\n comesFromFragmentSpread: false,\n parentResponsePath\n });\n\n while (stack.length > 0) {\n const {\n parentFieldNode,\n selection,\n comesFromFragmentSpread,\n parentResponsePath\n } = stack.pop()!;\n\n switch (selection.kind) {\n case Kind.FIELD: {\n const jitFieldNode: JitFieldNode = selection;\n const currentPath = joinSkipIncludePath(\n parentResponsePath,\n\n // use alias(instead of selection.name.value) if available as the responsePath used for lookup uses alias\n getFieldEntryKey(jitFieldNode)\n );\n\n if (!comesFromFragmentSpread) {\n if (\n compilationContext.options.useExperimentalPathBasedSkipInclude\n ) {\n if (!jitFieldNode.__internalShouldIncludePath)\n jitFieldNode.__internalShouldIncludePath = {};\n\n jitFieldNode.__internalShouldIncludePath[currentPath] =\n joinShouldIncludeCompilations(\n parentFieldNode.__internalShouldIncludePath?.[\n parentResponsePath\n ] ?? [],\n jitFieldNode.__internalShouldIncludePath?.[currentPath] ?? []\n );\n } else {\n // @deprecated\n jitFieldNode.__internalShouldInclude =\n joinShouldIncludeCompilations(\n parentFieldNode.__internalShouldInclude ?? [],\n jitFieldNode.__internalShouldInclude ?? []\n );\n }\n }\n // go further down the query tree\n for (const selection of jitFieldNode.selectionSet?.selections ?? []) {\n stack.push({\n parentFieldNode: jitFieldNode,\n selection,\n comesFromFragmentSpread: false,\n parentResponsePath: currentPath\n });\n }\n break;\n }\n case Kind.INLINE_FRAGMENT: {\n for (const subSelection of selection.selectionSet.selections) {\n stack.push({\n parentFieldNode,\n selection: subSelection,\n comesFromFragmentSpread: true,\n parentResponsePath\n });\n }\n break;\n }\n case Kind.FRAGMENT_SPREAD: {\n const fragment = compilationContext.fragments[selection.name.value];\n for (const subSelection of fragment.selectionSet.selections) {\n stack.push({\n parentFieldNode,\n selection: subSelection,\n comesFromFragmentSpread: true,\n parentResponsePath\n });\n }\n }\n }\n }\n }\n}\n\n/**\n * Joins a list of shouldInclude compiled code into a single logical\n * statement.\n *\n * The operation is `&&` because, it is used to join parent->child\n * relations in the query tree. Note: parent can be either parent field\n * or fragment.\n *\n * For example,\n * {\n * foo @skip(if: $c1) {\n * ... @skip(if: $c2) {\n * bar @skip(if: $c3)\n * }\n * }\n * }\n *\n * Only when a parent is included, the child is included. So, we use `&&`.\n *\n * compilationFor($c1) && compilationFor($c2) && compilationFor($c3)\n *\n * @param compilations\n */\nfunction joinShouldIncludeCompilations(...compilations: string[][]): string[] {\n // remove \"true\" since we are joining with '&&' as `true && X` = `X`\n // This prevents an explosion of `&& true` which could break\n // V8's internal size limit for string.\n //\n // Note: the `true` appears if a field does not have a skip/include directive\n // So, the more nested the query is, the more of unnecessary `&& true`\n // we get.\n //\n // Failing to do this results in [RangeError: invalid array length]\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n\n const conditionsSet = new Set<string>();\n for (const conditions of compilations) {\n for (const condition of conditions) {\n if (condition !== \"true\") {\n conditionsSet.add(condition);\n }\n }\n }\n\n return Array.from(conditionsSet);\n}\n\n/**\n * Compiles directives `skip` and `include` and generates the compilation\n * code based on GraphQL specification.\n *\n * @param node {SelectionNode} The selection node (field/fragment/inline-fragment)\n * for which we generate the compiled skipInclude.\n */\nfunction compileSkipInclude(\n compilationContext: CompilationContext,\n node: SelectionNode\n): string {\n // minor optimization to avoid compilation if there are no directives\n if (node.directives == null || node.directives.length < 1) {\n return \"true\";\n }\n\n const { skipValue, includeValue } = compileSkipIncludeDirectiveValues(\n compilationContext,\n node\n );\n\n /**\n * Spec: https://spec.graphql.org/June2018/#sec--include\n *\n * Neither @skip nor @include has precedence over the other.\n * In the case that both the @skip and @include directives\n * are provided in on the same the field or fragment, it must\n * be queried only if the @skip condition is false and the\n * @include condition is true. Stated conversely, the field\n * or fragment must not be queried if either the @skip\n * condition is true or the @include condition is false.\n */\n if (skipValue != null && includeValue != null) {\n return `${skipValue} === false && ${includeValue} === true`;\n } else if (skipValue != null) {\n return `(${skipValue} === false)`;\n } else if (includeValue != null) {\n return `(${includeValue} === true)`;\n } else {\n return `true`;\n }\n}\n\n/**\n * Compile skip or include directive values into JIT compatible\n * runtime code.\n *\n * @param node {SelectionNode}\n */\nfunction compileSkipIncludeDirectiveValues(\n compilationContext: CompilationContext,\n node: SelectionNode\n) {\n const skipDirective = node.directives?.find(\n (it) => it.name.value === GraphQLSkipDirective.name\n );\n const includeDirective = node.directives?.find(\n (it) => it.name.value === GraphQLIncludeDirective.name\n );\n\n const skipValue = skipDirective\n ? compileSkipIncludeDirective(compilationContext, skipDirective)\n : // The null here indicates the absense of the directive\n // which is later used to determine if both skip and include\n // are present\n null;\n const includeValue = includeDirective\n ? compileSkipIncludeDirective(compilationContext, includeDirective)\n : // The null here indicates the absense of the directive\n // which is later used to determine if both skip and include\n // are present\n null;\n\n return { skipValue, includeValue };\n}\n\n/**\n * Compile the skip/include directive node. Resolve variables to it's\n * path from context, resolve scalars to their respective values.\n *\n * @param directive {DirectiveNode}\n */\nfunction compileSkipIncludeDirective(\n compilationContext: CompilationContext,\n directive: DirectiveNode\n) {\n const ifNode = directive.arguments?.find((it) => it.name.value === \"if\");\n if (ifNode == null) {\n throw new GraphQLError(\n `Directive '${directive.name.value}' is missing required arguments: 'if'`,\n getGraphQLErrorOptions([directive])\n );\n }\n\n switch (ifNode.value.kind) {\n case Kind.VARIABLE:\n validateSkipIncludeVariableType(compilationContext, ifNode.value);\n return `${GLOBAL_VARIABLES_NAME}[\"${ifNode.value.name.value}\"]`;\n case Kind.BOOLEAN:\n return `${ifNode.value.value.toString()}`;\n default:\n throw new GraphQLError(\n `Argument 'if' on Directive '${\n directive.name.value\n }' has an invalid value (${valueFromASTUntyped(\n ifNode.value\n )}). Expected type 'Boolean!'`,\n getGraphQLErrorOptions([ifNode])\n );\n }\n}\n\n/**\n * Validate the skip and include directive's argument values at compile time.\n *\n * This validation step is required as these directives are part of an\n * implicit schema in GraphQL.\n *\n * @param compilationContext {CompilationContext}\n * @param variable {VariableNode} the variable used in 'if' argument of the skip/include directive\n */\nfunction validateSkipIncludeVariableType(\n compilationContext: CompilationContext,\n variable: VariableNode\n) {\n const variableDefinition =\n compilationContext.operation.variableDefinitions?.find(\n (it) => it.variable.name.value === variable.name.value\n );\n if (variableDefinition == null) {\n throw new GraphQLError(\n `Variable '${variable.name.value}' is not defined`,\n getGraphQLErrorOptions([variable])\n );\n }\n\n // Part of Spec text: https://spec.graphql.org/June2018/#sec-All-Variable-Usages-are-Allowed\n if (\n !(\n // The variable defintion is a Non-nullable Boolean type\n (\n (variableDefinition.type.kind === Kind.NON_NULL_TYPE &&\n variableDefinition.type.type.kind === Kind.NAMED_TYPE &&\n variableDefinition.type.type.name.value === \"Boolean\") ||\n // or the variable definition is a nullable Boolean type with a default value\n (variableDefinition.type.kind === Kind.NAMED_TYPE &&\n variableDefinition.type.name.value === \"Boolean\" &&\n variableDefinition.defaultValue != null)\n )\n )\n ) {\n throw new GraphQLError(\n `Variable '${variable.name.value}' of type '${typeNodeToString(\n variableDefinition.type\n )}' used in position expecting type 'Boolean!'`,\n getGraphQLErrorOptions([variableDefinition])\n );\n }\n}\n\n/**\n * Print the string representation of the TypeNode for error messages\n *\n * @param type {TypeNode} type node to be converted to string representation\n */\nfunction typeNodeToString(type: TypeNode): string {\n switch (type.kind) {\n case Kind.NAMED_TYPE:\n return type.name.value;\n case Kind.NON_NULL_TYPE:\n return `${typeNodeToString(type.type)}!`;\n case Kind.LIST_TYPE:\n return `[${typeNodeToString(type.type)}]`;\n }\n}\n\n/**\n * Determines if a fragment is applicable to the given type.\n */\nfunction doesFragmentConditionMatch(\n compilationContext: CompilationContext,\n fragment: FragmentDefinitionNode | InlineFragmentNode,\n type: GraphQLObjectType\n): boolean {\n const typeConditionNode = fragment.typeCondition;\n if (!typeConditionNode) {\n return true;\n }\n const conditionalType = typeFromAST(\n compilationContext.schema,\n typeConditionNode\n );\n if (conditionalType === type) {\n return true;\n }\n if (!conditionalType) {\n return false;\n }\n if (isAbstractType(conditionalType)) {\n return compilationContext.schema.isSubType(conditionalType, type);\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\nexport { resolveFieldDef };\n\nexport function collectSubfields(\n compilationContext: CompilationContext,\n returnType: GraphQLObjectType,\n fieldNodes: FieldNode[],\n parentResponsePath?: ObjectPath\n): { [key: string]: FieldNode[] } {\n let subFieldNodes = Object.create(null);\n const visitedFragmentNames = Object.create(null);\n for (const fieldNode of fieldNodes) {\n const selectionSet = fieldNode.selectionSet;\n if (selectionSet) {\n subFieldNodes = collectFields(\n compilationContext,\n returnType,\n selectionSet,\n subFieldNodes,\n visitedFragmentNames,\n parentResponsePath\n );\n }\n }\n return subFieldNodes;\n}\n\n// response path is used for identifying\n// the info resolver function as well as the path in errros,\n// the meta type is used for elements that are only to be used for\n// the function name\ntype ResponsePathType = \"variable\" | \"literal\" | \"meta\";\n\nexport interface ObjectPath {\n prev: ObjectPath | undefined;\n key: string;\n type: ResponsePathType;\n}\n\ninterface MissingVariablePath {\n valueNode: VariableNode;\n path?: ObjectPath;\n argument?: { definition: GraphQLArgument; node: ArgumentNode };\n}\n\nexport interface Arguments {\n values: { [argument: string]: any };\n missing: MissingVariablePath[];\n}\n\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getArgumentDefs(\n def: GraphQLField<any, any> | GraphQLDirective,\n node: FieldNode | DirectiveNode\n): Arguments {\n const values: { [key: string]: any } = {};\n const missing: MissingVariablePath[] = [];\n const argDefs = def.args;\n const argNodes = node.arguments || [];\n const argNodeMap = keyMap(argNodes, (arg) => arg.name.value);\n for (const argDef of argDefs) {\n const name = argDef.name;\n if (hasDefaultValue(argDef)) {\n // handle both v16 defaultValue and v17 default.value\n values[name] = getDefaultValue(argDef);\n }\n const argType = argDef.type;\n const argumentNode = argNodeMap[name];\n let hasVariables = false;\n if (argumentNode && argumentNode.value.kind === Kind.VARIABLE) {\n hasVariables = true;\n missing.push({\n valueNode: argumentNode.value,\n path: addPath(undefined, name, \"literal\"),\n argument: { definition: argDef, node: argumentNode }\n });\n } else if (argumentNode) {\n const coercedValue = valueFromAST(argumentNode.value, argType);\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectType validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n `Argument \"${name}\" of type \"${argType}\" has invalid value ${print(\n argumentNode.value\n )}.`,\n getGraphQLErrorOptions(argumentNode.value)\n );\n }\n\n if (isASTValueWithVariables(coercedValue)) {\n missing.push(\n ...coercedValue.variables.map(({ valueNode, path }) => ({\n valueNode,\n path: addPath(path, name, \"literal\")\n }))\n );\n }\n values[name] = coercedValue.value;\n }\n if (isNonNullType(argType) && values[name] === undefined && !hasVariables) {\n // If no value or a nullish value was provided to a variable with a\n // non-null type (required), produce an error.\n throw new GraphQLError(\n argumentNode\n ? `Argument \"${name}\" of non-null type ` +\n `\"${argType}\" must not be null.`\n : `Argument \"${name}\" of required type ` +\n `\"${argType}\" was not provided.`,\n getGraphQLErrorOptions(node)\n );\n }\n }\n return { values, missing };\n}\n\ninterface ASTValueWithVariables {\n value: object | string | boolean | symbol | number | null | any[];\n variables: MissingVariablePath[];\n}\n\nfunction isASTValueWithVariables(x: any): x is ASTValueWithVariables {\n return !!x.variables;\n}\n\ninterface ASTValue {\n value: object | string | boolean | symbol | number | null | any[];\n}\n\nexport function valueFromAST(\n valueNode: ValueNode,\n type: GraphQLInputType\n): undefined | ASTValue | ASTValueWithVariables {\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return valueFromAST(valueNode, type.ofType);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return {\n value: null\n };\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n return { value: null, variables: [{ valueNode, path: undefined }] };\n }\n\n if (isListType(type)) {\n const itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n const coercedValues = [];\n const variables: MissingVariablePath[] = [];\n const itemNodes = valueNode.values;\n for (let i = 0; i < itemNodes.length; i++) {\n const itemNode = itemNodes[i];\n if (itemNode.kind === Kind.VARIABLE) {\n coercedValues.push(null);\n variables.push({\n valueNode: itemNode,\n path: addPath(undefined, i.toString(), \"literal\")\n });\n } else {\n const itemValue = valueFromAST(itemNode, itemType);\n if (!itemValue) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(itemValue.value);\n if (isASTValueWithVariables(itemValue)) {\n variables.push(\n ...itemValue.variables.map(({ valueNode, path }) => ({\n valueNode,\n path: addPath(path, i.toString(), \"literal\")\n }))\n );\n }\n }\n }\n return { value: coercedValues, variables };\n }\n // Single item which will be coerced to a list\n const coercedValue = valueFromAST(valueNode, itemType);\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n if (isASTValueWithVariables(coercedValue)) {\n return {\n value: [coercedValue.value],\n variables: coercedValue.variables.map(({ valueNode, path }) => ({\n valueNode,\n path: addPath(path, \"0\", \"literal\")\n }))\n };\n }\n return { value: [coercedValue.value] };\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n const coercedObj = Object.create(null);\n const variables: MissingVariablePath[] = [];\n const fieldNodes = keyMap(valueNode.fields, (field) => field.name.value);\n const fields = Object.values(type.getFields());\n for (const field of fields) {\n if (hasDefaultValue(field)) {\n coercedObj[field.name] = getDefaultValue(field);\n }\n const fieldNode = fieldNodes[field.name];\n if (!fieldNode) {\n continue;\n }\n const fieldValue = valueFromAST(fieldNode.value, field.type);\n if (!fieldValue) {\n return; // Invalid: intentionally return no value.\n }\n if (isASTValueWithVariables(fieldValue)) {\n variables.push(\n ...fieldValue.variables.map(({ valueNode, path }) => ({\n valueNode,\n path: addPath(path, field.name, \"literal\")\n }))\n );\n }\n coercedObj[field.name] = fieldValue.value;\n }\n return { value: coercedObj, variables };\n }\n\n if (isEnumType(type)) {\n if (valueNode.kind !== Kind.ENUM) {\n return; // Invalid: intentionally return no value.\n }\n const enumValue = type.getValue(valueNode.value);\n if (!enumValue) {\n return; // Invalid: intentionally return no value.\n }\n return { value: enumValue.value };\n }\n\n if (isScalarType(type)) {\n // Scalars fulfill parsing a literal value via coerceInputLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n let result: any;\n try {\n // By this point, we've filtered out VARIABLE nodes, so valueNode is a ConstValueNode\n result = coerceInputLiteral(type, valueNode as ConstValueNode);\n } catch (error) {\n return; // Invalid: intentionally return no value.\n }\n if (isInvalid(result)) {\n return; // Invalid: intentionally return no value.\n }\n return { value: result };\n }\n\n // Not reachable. All possible input types have been considered.\n /* istanbul ignore next */\n throw new Error(`Unexpected input type: \"${inspect(type)}\".`);\n}\n\n/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: { name: 'Jon', num: '555-1234' },\n * // Jenny: { name: 'Jenny', num: '867-5309' } }\n * const entriesByName = keyMap(\n * phoneBook,\n * entry => entry.name\n * )\n *\n * // { name: 'Jenny', num: '857-6309' }\n * const jennyEntry = entriesByName['Jenny']\n *\n */\nfunction keyMap<T>(\n list: ReadonlyArray<T>,\n keyFn: (item: T) => string\n): { [key: string]: T } {\n return list.reduce(\n // eslint-disable-next-line no-sequences\n (map, item) => ((map[keyFn(item)] = item), map),\n Object.create(null)\n );\n}\n\nexport function computeLocations(nodes: ASTNode[]): SourceLocation[] {\n return nodes.reduce((list, node) => {\n if (node.loc) {\n list.push(getLocation(node.loc));\n }\n return list;\n }, [] as SourceLocation[]);\n}\n\n/**\n * This is an alternate faster implementation of getLocation in graphql-js\n *\n * Optimization:\n * In graphql-js, getLocation is implemented as finding line and column\n * from a given position in the source. Since the use-case in GraphQL-JIT\n * is to find the location of a node, we can directly use the line and\n * column from the startToken of the node's location.\n *\n * @param loc the Node's location\n * @returns the SourceLocation for the position\n */\nfunction getLocation(loc: Location): SourceLocation {\n // If the location already contains line and column, return it directly\n return {\n line: loc.startToken.line,\n column: loc.startToken.column\n };\n}\n\nexport function addPath(\n responsePath: ObjectPath | undefined,\n key: string,\n type: ResponsePathType = \"literal\"\n): ObjectPath {\n return { prev: responsePath, key, type };\n}\n\nexport function flattenPath(\n path: ObjectPath\n): Array<{ key: string; type: ResponsePathType }> {\n const flattened = [];\n let curr: ObjectPath | undefined = path;\n while (curr) {\n flattened.push({ key: curr.key, type: curr.type });\n curr = curr.prev;\n }\n return flattened;\n}\n\n/**\n * Serialize a path for use in the skip/include directives.\n *\n * @param path The path to serialize\n * @returns The path serialized as a string, with the root path first.\n */\nexport function serializeObjectPathForSkipInclude(\n path: ObjectPath | undefined\n) {\n let serialized = \"\";\n let curr = path;\n while (curr) {\n if (curr.type === \"literal\") {\n serialized = joinSkipIncludePath(curr.key, serialized);\n }\n curr = curr.prev;\n }\n return serialized;\n}\n\n/**\n * join two path segments to a dot notation, handling empty strings\n *\n * @param a path segment\n * @param b path segment\n * @returns combined path in dot notation\n */\nexport function joinSkipIncludePath(a: string, b: string) {\n if (a) {\n if (b) {\n return `${a}.${b}`;\n }\n return a;\n }\n return b;\n}\n\nfunction isInvalid(value: any): boolean {\n // eslint-disable-next-line no-self-compare\n return value === undefined || value !== value;\n}\n"]}
@@ -0,0 +1,70 @@
1
+ import { GraphQLSchema, GraphQLError, type FieldNode, type GraphQLField, type ASTNode, type OperationDefinitionNode, type GraphQLObjectType, type GraphQLFormattedError, type ConstValueNode, GraphQLScalarType } from "graphql";
2
+ import { type Maybe } from "./types.js";
3
+ import { type CompilationContext } from "./execution.js";
4
+ /**
5
+ * A helper file to support backward compatibility for different versions of graphql-js.
6
+ */
7
+ /**
8
+ * v15 does not have schema.getRootType
9
+ * v16 has both
10
+ * v17 will not have getOperationRootType
11
+ *
12
+ * To support all these 3 versions of graphql-js, at least for migration, this helper
13
+ * would be useful.
14
+ *
15
+ * This can be removed once we drop support for v15.
16
+ *
17
+ * GraphQL v17 would remove getOperationRootType.
18
+ */
19
+ export declare function getOperationRootType(schema: GraphQLSchema, operation: OperationDefinitionNode): GraphQLObjectType;
20
+ /**
21
+ * v16 and lower versions don't have .toJSON method on GraphQLError
22
+ * v17 does have .toJSON and doesn't have "formatError" export anymore
23
+ */
24
+ export declare function formatError(error: GraphQLError): GraphQLFormattedError;
25
+ /**
26
+ * v17 dropped support for positional arguments in GraphQLError constructor
27
+ * https://github.com/graphql/graphql-js/pull/3577
28
+ */
29
+ export declare function getGraphQLErrorOptions(nodes: Maybe<ReadonlyArray<ASTNode> | ASTNode>): ConstructorParameters<typeof GraphQLError>[1];
30
+ /**
31
+ * Resolves the field on the given source object. In particular, this
32
+ * figures out the value that the field returns by calling its resolve function,
33
+ * then calls completeValue to complete promises, serialize scalars, or execute
34
+ * the sub-selection-set for objects.
35
+ */
36
+ export declare function resolveFieldDef(compilationContext: CompilationContext, parentType: GraphQLObjectType, fieldNodes: FieldNode[]): Maybe<GraphQLField<any, any>>;
37
+ /**
38
+ * v17 introduces `arg.default = { value }` for SDL-built schemas.
39
+ * Programmatic schemas still use `arg.defaultValue`.
40
+ * This helper normalizes both to a single value.
41
+ */
42
+ export declare function getDefaultValue(argOrField: {
43
+ defaultValue?: unknown;
44
+ default?: {
45
+ value?: unknown;
46
+ literal?: unknown;
47
+ };
48
+ }): unknown;
49
+ export declare function hasDefaultValue(argOrField: {
50
+ defaultValue?: unknown;
51
+ default?: {
52
+ value?: unknown;
53
+ literal?: unknown;
54
+ };
55
+ }): boolean;
56
+ /**
57
+ * v17 deprecates parseLiteral in favor of coerceInputLiteral for custom scalars
58
+ * However, custom scalars may still only define parseLiteral, so we check
59
+ * for the method's existence rather than just the version.
60
+ */
61
+ export declare function coerceInputLiteral(type: GraphQLScalarType<unknown, unknown>, valueNode: ConstValueNode): any;
62
+ /**
63
+ * V17 removes execution context
64
+ * This is a minimal interface to support the execution context for v16 and v17+
65
+ */
66
+ export interface ExecutionContext {
67
+ errors: Array<GraphQLError> | undefined;
68
+ completed: boolean;
69
+ errorPropagation: boolean;
70
+ }
@@ -0,0 +1,102 @@
1
+ import * as graphql from "graphql";
2
+ import { versionInfo, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from "graphql";
3
+ /**
4
+ * A helper file to support backward compatibility for different versions of graphql-js.
5
+ */
6
+ /**
7
+ * v15 does not have schema.getRootType
8
+ * v16 has both
9
+ * v17 will not have getOperationRootType
10
+ *
11
+ * To support all these 3 versions of graphql-js, at least for migration, this helper
12
+ * would be useful.
13
+ *
14
+ * This can be removed once we drop support for v15.
15
+ *
16
+ * GraphQL v17 would remove getOperationRootType.
17
+ */
18
+ export function getOperationRootType(schema, operation) {
19
+ if (versionInfo.major < 16) {
20
+ return graphql.getOperationRootType(schema, operation);
21
+ }
22
+ const type = schema.getRootType(operation.operation);
23
+ if (!type) {
24
+ throw new Error(`No root type for operation ${operation.operation}`);
25
+ }
26
+ return type;
27
+ }
28
+ /**
29
+ * v16 and lower versions don't have .toJSON method on GraphQLError
30
+ * v17 does have .toJSON and doesn't have "formatError" export anymore
31
+ */
32
+ export function formatError(error) {
33
+ if (versionInfo.major < 16) {
34
+ return graphql.formatError(error);
35
+ }
36
+ return error.toJSON();
37
+ }
38
+ /**
39
+ * v17 dropped support for positional arguments in GraphQLError constructor
40
+ * https://github.com/graphql/graphql-js/pull/3577
41
+ */
42
+ export function getGraphQLErrorOptions(nodes) {
43
+ if (versionInfo.major < 16) {
44
+ return nodes;
45
+ }
46
+ return { nodes };
47
+ }
48
+ /**
49
+ * Resolves the field on the given source object. In particular, this
50
+ * figures out the value that the field returns by calling its resolve function,
51
+ * then calls completeValue to complete promises, serialize scalars, or execute
52
+ * the sub-selection-set for objects.
53
+ */
54
+ export function resolveFieldDef(compilationContext, parentType, fieldNodes) {
55
+ const fieldNode = fieldNodes[0];
56
+ const fieldName = fieldNode.name.value;
57
+ if (versionInfo.major < 17) {
58
+ const schema = compilationContext.schema;
59
+ if (fieldName === SchemaMetaFieldDef.name &&
60
+ schema.getQueryType() === parentType) {
61
+ return SchemaMetaFieldDef;
62
+ }
63
+ if (fieldName === TypeMetaFieldDef.name &&
64
+ schema.getQueryType() === parentType) {
65
+ return TypeMetaFieldDef;
66
+ }
67
+ if (fieldName === TypeNameMetaFieldDef.name) {
68
+ return TypeNameMetaFieldDef;
69
+ }
70
+ return parentType.getFields()[fieldName];
71
+ }
72
+ return compilationContext.schema.getField(parentType, fieldName);
73
+ }
74
+ /**
75
+ * v17 introduces `arg.default = { value }` for SDL-built schemas.
76
+ * Programmatic schemas still use `arg.defaultValue`.
77
+ * This helper normalizes both to a single value.
78
+ */
79
+ export function getDefaultValue(argOrField) {
80
+ if (argOrField.default !== undefined) {
81
+ // v17 SDL-built default — `.value` holds the JS value
82
+ return argOrField.default.value;
83
+ }
84
+ return argOrField.defaultValue;
85
+ }
86
+ export function hasDefaultValue(argOrField) {
87
+ return (argOrField.default !== undefined || argOrField.defaultValue !== undefined);
88
+ }
89
+ /**
90
+ * v17 deprecates parseLiteral in favor of coerceInputLiteral for custom scalars
91
+ * However, custom scalars may still only define parseLiteral, so we check
92
+ * for the method's existence rather than just the version.
93
+ */
94
+ export function coerceInputLiteral(type, valueNode) {
95
+ // Use coerceInputLiteral if available (built-in scalars in v17+)
96
+ // Otherwise fall back to parseLiteral (custom scalars, or v16)
97
+ if (type.coerceInputLiteral) {
98
+ return type.coerceInputLiteral(valueNode);
99
+ }
100
+ return type.parseLiteral(valueNode, {});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AAkB,EAAE,CAAC;QACrC,OAAQ,IAAY,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;IAED,OAAQ,IAAY,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import * as graphql from \"graphql\";\nimport {\n GraphQLSchema,\n GraphQLError,\n versionInfo,\n type FieldNode,\n type GraphQLField,\n type ASTNode,\n type OperationDefinitionNode,\n type GraphQLObjectType,\n type GraphQLFormattedError,\n type ConstValueNode,\n GraphQLScalarType,\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef\n} from \"graphql\";\nimport { type Maybe } from \"./types.js\";\nimport { type CompilationContext } from \"./execution.js\";\n\n/**\n * A helper file to support backward compatibility for different versions of graphql-js.\n */\n\n/**\n * v15 does not have schema.getRootType\n * v16 has both\n * v17 will not have getOperationRootType\n *\n * To support all these 3 versions of graphql-js, at least for migration, this helper\n * would be useful.\n *\n * This can be removed once we drop support for v15.\n *\n * GraphQL v17 would remove getOperationRootType.\n */\nexport function getOperationRootType(\n schema: GraphQLSchema,\n operation: OperationDefinitionNode\n): GraphQLObjectType {\n if (versionInfo.major < 16) {\n return (graphql as any).getOperationRootType(schema, operation);\n }\n\n const type = (schema as any).getRootType(operation.operation);\n\n if (!type) {\n throw new Error(`No root type for operation ${operation.operation}`);\n }\n\n return type;\n}\n\n/**\n * v16 and lower versions don't have .toJSON method on GraphQLError\n * v17 does have .toJSON and doesn't have \"formatError\" export anymore\n */\nexport function formatError(error: GraphQLError): GraphQLFormattedError {\n if (versionInfo.major < 16) {\n return (graphql as any).formatError(error);\n }\n\n return (error as any).toJSON();\n}\n\n/**\n * v17 dropped support for positional arguments in GraphQLError constructor\n * https://github.com/graphql/graphql-js/pull/3577\n */\nexport function getGraphQLErrorOptions(\n nodes: Maybe<ReadonlyArray<ASTNode> | ASTNode>\n): ConstructorParameters<typeof GraphQLError>[1] {\n if (versionInfo.major < 16) {\n return nodes as any;\n }\n\n return { nodes } as any;\n}\n\n/**\n * Resolves the field on the given source object. In particular, this\n * figures out the value that the field returns by calling its resolve function,\n * then calls completeValue to complete promises, serialize scalars, or execute\n * the sub-selection-set for objects.\n */\nexport function resolveFieldDef(\n compilationContext: CompilationContext,\n parentType: GraphQLObjectType,\n fieldNodes: FieldNode[]\n): Maybe<GraphQLField<any, any>> {\n const fieldNode = fieldNodes[0];\n const fieldName = fieldNode.name.value;\n\n if (versionInfo.major < 17) {\n const schema = compilationContext.schema;\n if (\n fieldName === SchemaMetaFieldDef.name &&\n schema.getQueryType() === parentType\n ) {\n return SchemaMetaFieldDef;\n }\n if (\n fieldName === TypeMetaFieldDef.name &&\n schema.getQueryType() === parentType\n ) {\n return TypeMetaFieldDef;\n }\n if (fieldName === TypeNameMetaFieldDef.name) {\n return TypeNameMetaFieldDef;\n }\n return parentType.getFields()[fieldName];\n }\n\n return (compilationContext.schema as any).getField(parentType, fieldName);\n}\n\n/**\n * v17 introduces `arg.default = { value }` for SDL-built schemas.\n * Programmatic schemas still use `arg.defaultValue`.\n * This helper normalizes both to a single value.\n */\nexport function getDefaultValue(argOrField: {\n defaultValue?: unknown;\n default?: { value?: unknown; literal?: unknown };\n}): unknown {\n if (argOrField.default !== undefined) {\n // v17 SDL-built default — `.value` holds the JS value\n return (argOrField.default as any).value;\n }\n return argOrField.defaultValue;\n}\n\nexport function hasDefaultValue(argOrField: {\n defaultValue?: unknown;\n default?: { value?: unknown; literal?: unknown };\n}): boolean {\n return (\n argOrField.default !== undefined || argOrField.defaultValue !== undefined\n );\n}\n\n/**\n * v17 deprecates parseLiteral in favor of coerceInputLiteral for custom scalars\n * However, custom scalars may still only define parseLiteral, so we check\n * for the method's existence rather than just the version.\n */\nexport function coerceInputLiteral(\n type: GraphQLScalarType<unknown, unknown>,\n valueNode: ConstValueNode\n): any {\n // Use coerceInputLiteral if available (built-in scalars in v17+)\n // Otherwise fall back to parseLiteral (custom scalars, or v16)\n if ((type as any).coerceInputLiteral) {\n return (type as any).coerceInputLiteral(valueNode);\n }\n\n return (type as any).parseLiteral(valueNode, {});\n}\n\n/**\n * V17 removes execution context\n * This is a minimal interface to support the execution context for v16 and v17+\n */\nexport interface ExecutionContext {\n errors: Array<GraphQLError> | undefined;\n completed: boolean;\n errorPropagation: boolean;\n}\n"]}
@@ -0,0 +1,29 @@
1
+ export interface CompilerDebugOptions {
2
+ /** Enables debug-compatible source generation */
3
+ enabled: boolean;
4
+ /**
5
+ * Name shown for the generated query executor in JavaScript debuggers.
6
+ *
7
+ * This is normally a virtual URL, for example
8
+ * `graphql-jit://graphql-jit/my-service/GetUser.query.js`.
9
+ */
10
+ querySourceName?: string;
11
+ /**
12
+ * Name shown for the generated variable coercer in JavaScript debuggers.
13
+ *
14
+ * This is normally a virtual URL, for example
15
+ * `graphql-jit://graphql-jit/my-service/GetUser.variables.js`.
16
+ */
17
+ variablesSourceName?: string;
18
+ /**
19
+ * Formats generated source before it is compiled.
20
+ *
21
+ * The formatter must return a string synchronously. For example,
22
+ * applications can use `@prettier/sync` in development.
23
+ */
24
+ formatSourceCode?: (source: string) => string;
25
+ }
26
+ export declare function normalizeDebugOptions(debug: CompilerDebugOptions | undefined): CompilerDebugOptions | undefined;
27
+ export declare function formatDebugSource(source: string, formatSourceCode: CompilerDebugOptions["formatSourceCode"]): string;
28
+ export declare function appendSourceURL(source: string, sourceName: string): string;
29
+ export declare function createGeneratedSourceName(operationName: string | undefined, options: CompilerDebugOptions, compilation: "query" | "variables"): string;
@@ -0,0 +1,40 @@
1
+ export function normalizeDebugOptions(debug) {
2
+ if (!debug || !debug.enabled) {
3
+ return undefined;
4
+ }
5
+ if (/\r|\n/.test(debug.querySourceName || "")) {
6
+ throw new Error("debug.querySourceName must not contain a line break.");
7
+ }
8
+ if (/\r|\n/.test(debug.variablesSourceName || "")) {
9
+ throw new Error("debug.variablesSourceName must not contain a line break.");
10
+ }
11
+ if (debug.formatSourceCode !== undefined &&
12
+ typeof debug.formatSourceCode !== "function") {
13
+ throw new Error("debug.formatSourceCode must be a function.");
14
+ }
15
+ return debug;
16
+ }
17
+ export function formatDebugSource(source, formatSourceCode) {
18
+ if (!formatSourceCode) {
19
+ return source;
20
+ }
21
+ const formattedSource = formatSourceCode(source);
22
+ if (typeof formattedSource !== "string") {
23
+ throw new Error("debug.formatSourceCode must return a string synchronously.");
24
+ }
25
+ return formattedSource;
26
+ }
27
+ export function appendSourceURL(source, sourceName) {
28
+ return `${source}\n//# sourceURL=${sourceName}`;
29
+ }
30
+ export function createGeneratedSourceName(operationName, options, compilation) {
31
+ const configuredSourceName = compilation === "query"
32
+ ? options.querySourceName
33
+ : options.variablesSourceName;
34
+ if (configuredSourceName) {
35
+ return configuredSourceName;
36
+ }
37
+ const operation = encodeURIComponent(operationName || "anonymous");
38
+ return `graphql-jit://graphql-jit/operation/${operation}.${compilation}.js`;
39
+ }
40
+ //# sourceMappingURL=debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AA6BA,MAAM,UAAU,qBAAqB,CACnC,KAAuC;IAEvC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IACD,IACE,KAAK,CAAC,gBAAgB,KAAK,SAAS;QACpC,OAAO,KAAK,CAAC,gBAAgB,KAAK,UAAU,EAC5C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,MAAc,EACd,gBAA0D;IAE1D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,UAAkB;IAChE,OAAO,GAAG,MAAM,mBAAmB,UAAU,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,aAAiC,EACjC,OAA6B,EAC7B,WAAkC;IAElC,MAAM,oBAAoB,GACxB,WAAW,KAAK,OAAO;QACrB,CAAC,CAAC,OAAO,CAAC,eAAe;QACzB,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;IAClC,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,MAAM,SAAS,GAAG,kBAAkB,CAAC,aAAa,IAAI,WAAW,CAAC,CAAC;IACnE,OAAO,uCAAuC,SAAS,IAAI,WAAW,KAAK,CAAC;AAC9E,CAAC","sourcesContent":["export interface CompilerDebugOptions {\n /** Enables debug-compatible source generation */\n enabled: boolean;\n\n /**\n * Name shown for the generated query executor in JavaScript debuggers.\n *\n * This is normally a virtual URL, for example\n * `graphql-jit://graphql-jit/my-service/GetUser.query.js`.\n */\n querySourceName?: string;\n\n /**\n * Name shown for the generated variable coercer in JavaScript debuggers.\n *\n * This is normally a virtual URL, for example\n * `graphql-jit://graphql-jit/my-service/GetUser.variables.js`.\n */\n variablesSourceName?: string;\n\n /**\n * Formats generated source before it is compiled.\n *\n * The formatter must return a string synchronously. For example,\n * applications can use `@prettier/sync` in development.\n */\n formatSourceCode?: (source: string) => string;\n}\n\nexport function normalizeDebugOptions(\n debug: CompilerDebugOptions | undefined\n): CompilerDebugOptions | undefined {\n if (!debug || !debug.enabled) {\n return undefined;\n }\n if (/\\r|\\n/.test(debug.querySourceName || \"\")) {\n throw new Error(\"debug.querySourceName must not contain a line break.\");\n }\n if (/\\r|\\n/.test(debug.variablesSourceName || \"\")) {\n throw new Error(\"debug.variablesSourceName must not contain a line break.\");\n }\n if (\n debug.formatSourceCode !== undefined &&\n typeof debug.formatSourceCode !== \"function\"\n ) {\n throw new Error(\"debug.formatSourceCode must be a function.\");\n }\n return debug;\n}\n\nexport function formatDebugSource(\n source: string,\n formatSourceCode: CompilerDebugOptions[\"formatSourceCode\"]\n): string {\n if (!formatSourceCode) {\n return source;\n }\n const formattedSource = formatSourceCode(source);\n if (typeof formattedSource !== \"string\") {\n throw new Error(\n \"debug.formatSourceCode must return a string synchronously.\"\n );\n }\n return formattedSource;\n}\n\nexport function appendSourceURL(source: string, sourceName: string): string {\n return `${source}\\n//# sourceURL=${sourceName}`;\n}\n\nexport function createGeneratedSourceName(\n operationName: string | undefined,\n options: CompilerDebugOptions,\n compilation: \"query\" | \"variables\"\n): string {\n const configuredSourceName =\n compilation === \"query\"\n ? options.querySourceName\n : options.variablesSourceName;\n if (configuredSourceName) {\n return configuredSourceName;\n }\n const operation = encodeURIComponent(operationName || \"anonymous\");\n return `graphql-jit://graphql-jit/operation/${operation}.${compilation}.js`;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Based on https://github.com/graphql/graphql-js/blob/master/src/error/GraphQLError.js
3
+ */
4
+ import { type SourceLocation } from "graphql";
5
+ export declare function GraphQLError(message: string, locations?: ReadonlyArray<SourceLocation>, path?: ReadonlyArray<string | number>, originalError?: Error & {
6
+ extensions?: any;
7
+ }, skipStackCapturing?: boolean): void;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Based on https://github.com/graphql/graphql-js/blob/master/src/error/GraphQLError.js
3
+ */
4
+ import { GraphQLError as UpstreamGraphQLError } from "graphql";
5
+ export function GraphQLError(message, locations, path, originalError, skipStackCapturing) {
6
+ const extensions = originalError && originalError.extensions;
7
+ Object.defineProperties(this, {
8
+ message: {
9
+ value: message,
10
+ enumerable: true
11
+ },
12
+ locations: {
13
+ value: locations || undefined,
14
+ enumerable: locations && locations.length > 0
15
+ },
16
+ path: {
17
+ value: path || undefined,
18
+ enumerable: Boolean(path)
19
+ },
20
+ originalError: {
21
+ value: originalError
22
+ },
23
+ extensions: {
24
+ // Coercing falsey values to undefined ensures they will not be included
25
+ // in JSON.stringify() when not provided.
26
+ value: extensions || undefined,
27
+ enumerable: Boolean(extensions)
28
+ }
29
+ });
30
+ // Include (non-enumerable) stack trace.
31
+ if (originalError && originalError.stack) {
32
+ Object.defineProperty(this, "stack", {
33
+ value: originalError.stack,
34
+ writable: true,
35
+ configurable: true
36
+ });
37
+ }
38
+ else if (!skipStackCapturing) {
39
+ if (Error.captureStackTrace) {
40
+ Error.captureStackTrace(this, GraphQLError);
41
+ }
42
+ else {
43
+ Object.defineProperty(this, "stack", {
44
+ value: Error().stack,
45
+ writable: true,
46
+ configurable: true
47
+ });
48
+ }
49
+ }
50
+ }
51
+ GraphQLError.prototype = Object.create(UpstreamGraphQLError.prototype, {
52
+ constructor: { value: GraphQLError },
53
+ name: { value: "GraphQLError" }
54
+ });
55
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,YAAY,IAAI,oBAAoB,EAErC,MAAM,SAAS,CAAC;AAEjB,MAAM,UAAU,YAAY,CAC1B,OAAe,EACf,SAAyC,EACzC,IAAqC,EACrC,aAA4C,EAC5C,kBAA4B;IAE5B,MAAM,UAAU,GAAG,aAAa,IAAI,aAAa,CAAC,UAAU,CAAC;IAC7D,MAA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AE,KAAK,EAAE,YAAY,EAAE;IACpC,IAAI,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE;CAChC,CACF,CAAC","sourcesContent":["/**\n * Based on https://github.com/graphql/graphql-js/blob/master/src/error/GraphQLError.js\n */\n\nimport {\n GraphQLError as UpstreamGraphQLError,\n type SourceLocation\n} from \"graphql\";\n\nexport function GraphQLError(\n message: string,\n locations?: ReadonlyArray<SourceLocation>,\n path?: ReadonlyArray<string | number>,\n originalError?: Error & { extensions?: any },\n skipStackCapturing?: boolean\n) {\n const extensions = originalError && originalError.extensions;\n Object.defineProperties(this, {\n message: {\n value: message,\n enumerable: true\n },\n locations: {\n value: locations || undefined,\n enumerable: locations && locations.length > 0\n },\n path: {\n value: path || undefined,\n enumerable: Boolean(path)\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: extensions || undefined,\n enumerable: Boolean(extensions)\n }\n });\n\n // Include (non-enumerable) stack trace.\n if (originalError && originalError.stack) {\n Object.defineProperty(this, \"stack\", {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (!skipStackCapturing) {\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, \"stack\", {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n }\n}\n\n(GraphQLError as any).prototype = Object.create(\n UpstreamGraphQLError.prototype,\n {\n constructor: { value: GraphQLError },\n name: { value: \"GraphQLError\" }\n }\n);\n"]}
@@ -0,0 +1,154 @@
1
+ import { type TypedDocumentNode } from "@graphql-typed-document-node/core";
2
+ import { type JitRuntime } from "./runtime.js";
3
+ import { type CompilerDebugOptions } from "./debug.js";
4
+ import { type DocumentNode, type ExecutionResult, type FragmentDefinitionNode, GraphQLError, type GraphQLFieldResolver, type GraphQLIsTypeOfFn, GraphQLObjectType, type GraphQLOutputType, GraphQLSchema, type FieldNode, type OperationDefinitionNode, type GraphQLTypeResolver } from "graphql";
5
+ import { type ExecutionContext as GraphQLContext } from "./compat.js";
6
+ import { type Arguments, type ObjectPath } from "./ast.js";
7
+ import { GraphQLError as GraphqlJitError } from "./error.js";
8
+ import { type NullTrimmer } from "./non-null.js";
9
+ import { type ResolveInfoEnricherInput } from "./resolve-info.js";
10
+ import { type Maybe } from "./types.js";
11
+ import { type CoercedVariableValues } from "./variables.js";
12
+ declare const inspect: (value: any) => string;
13
+ export interface CompilerOptions {
14
+ customJSONSerializer: boolean;
15
+ disableLeafSerialization: boolean;
16
+ disablingCapturingStackErrors: boolean;
17
+ customSerializers: {
18
+ [key: string]: (v: any) => any;
19
+ };
20
+ resolverInfoEnricher?: (inp: ResolveInfoEnricherInput) => object;
21
+ /**
22
+ * This option is a temporary workaround to rollout and test the new skip/include behavior.
23
+ * It will be removed in the next version along with the old behavior.
24
+ *
25
+ * Set this to true if you face issues with skip/include in fragment spreads.
26
+ *
27
+ * default: false
28
+ *
29
+ * @see https://github.com/zalando-incubator/graphql-jit/pull/197
30
+ *
31
+ */
32
+ useExperimentalPathBasedSkipInclude: boolean;
33
+ /** Expose generated executors to JavaScript debuggers with virtual names. */
34
+ debug?: CompilerDebugOptions;
35
+ }
36
+ export interface ExecutionContext {
37
+ promiseCounter: number;
38
+ data: any;
39
+ errors: GraphQLError[];
40
+ nullErrors: GraphQLError[];
41
+ resolve?: (ctx: ExecutionContext) => void;
42
+ rt: JitRuntime;
43
+ inspect: typeof inspect;
44
+ variables: {
45
+ [key: string]: any;
46
+ };
47
+ context: any;
48
+ rootValue: any;
49
+ GraphQLError: typeof GraphqlJitError;
50
+ resolvers: {
51
+ [key: string]: GraphQLFieldResolver<any, any, any>;
52
+ };
53
+ trimmer: NullTrimmer;
54
+ serializers: {
55
+ [key: string]: (c: ExecutionContext, v: any, onError: (c: ExecutionContext, msg: string) => void) => any;
56
+ };
57
+ typeResolvers: {
58
+ [key: string]: GraphQLTypeResolver<any, any>;
59
+ };
60
+ isTypeOfs: {
61
+ [key: string]: GraphQLIsTypeOfFn<any, any>;
62
+ };
63
+ resolveInfos: {
64
+ [key: string]: any;
65
+ };
66
+ }
67
+ interface DeferredField {
68
+ name: string;
69
+ responsePath: ObjectPath;
70
+ originPaths: string[];
71
+ originPathsFormatted: string;
72
+ destinationPaths: string[];
73
+ parentType: GraphQLObjectType;
74
+ fieldName: string;
75
+ jsFieldName: string;
76
+ fieldType: GraphQLOutputType;
77
+ fieldNodes: FieldNode[];
78
+ args: Arguments;
79
+ }
80
+ /**
81
+ * The context used during compilation.
82
+ *
83
+ * It stores deferred nodes to be processed later as well as the function arguments to be bounded at top level
84
+ */
85
+ export interface CompilationContext extends GraphQLContext {
86
+ resolvers: {
87
+ [key: string]: GraphQLFieldResolver<any, any, any>;
88
+ };
89
+ serializers: {
90
+ [key: string]: (c: ExecutionContext, v: any, onError: (c: ExecutionContext, msg: string) => void) => any;
91
+ };
92
+ hoistedFunctions: string[];
93
+ hoistedFunctionNames: Map<string, number>;
94
+ leafErrHandlerCache: Map<string, string>;
95
+ trivialTypeNameVar?: string;
96
+ typeResolvers: {
97
+ [key: string]: GraphQLTypeResolver<any, any>;
98
+ };
99
+ isTypeOfs: {
100
+ [key: string]: GraphQLIsTypeOfFn<any, any>;
101
+ };
102
+ resolveInfos: {
103
+ [key: string]: any;
104
+ };
105
+ deferred: DeferredField[];
106
+ options: CompilerOptions;
107
+ depth: number;
108
+ schema: GraphQLSchema;
109
+ operation: OperationDefinitionNode;
110
+ fragments: {
111
+ [key: string]: FragmentDefinitionNode;
112
+ };
113
+ }
114
+ export declare const GLOBAL_VARIABLES_NAME = "__context.variables";
115
+ export interface CompiledQuery<TResult = {
116
+ [key: string]: any;
117
+ }, TVariables = {
118
+ [key: string]: any;
119
+ }> {
120
+ operationName?: string;
121
+ query: (root: any, context: any, variables: Maybe<TVariables>) => Promise<ExecutionResult<TResult>> | ExecutionResult<TResult>;
122
+ subscribe?: (root: any, context: any, variables: Maybe<TVariables>) => Promise<AsyncIterableIterator<ExecutionResult<TResult>> | ExecutionResult<TResult>>;
123
+ stringify: (v: any) => string;
124
+ }
125
+ /**
126
+ * It compiles a GraphQL query to an executable function
127
+ * @param {GraphQLSchema} schema GraphQL schema
128
+ * @param {DocumentNode} document Query being submitted
129
+ * @param {string} operationName name of the operation
130
+ * @param partialOptions compilation options to tune the compiler features
131
+ * @returns {CompiledQuery} the cacheable result
132
+ */
133
+ export declare function compileQuery<TResult = {
134
+ [key: string]: any;
135
+ }, TVariables = {
136
+ [key: string]: any;
137
+ }>(schema: GraphQLSchema, document: TypedDocumentNode<TResult, TVariables>, operationName?: string, partialOptions?: Partial<CompilerOptions>): CompiledQuery<TResult, TVariables> | ExecutionResult<TResult>;
138
+ export declare function isCompiledQuery<C extends CompiledQuery, E extends ExecutionResult>(query: C | E): query is C;
139
+ export declare function createBoundQuery(compilationContext: CompilationContext, document: DocumentNode, func: (context: ExecutionContext) => Promise<any> | undefined, getVariableValues: (inputs: {
140
+ [key: string]: any;
141
+ }) => CoercedVariableValues, operationName?: string): (rootValue: any, context: any, variables: Maybe<{
142
+ [key: string]: any;
143
+ }>) => Promise<ExecutionResult> | ExecutionResult;
144
+ export declare function isPromise(value: any): value is Promise<any>;
145
+ export declare function isPromiseInliner(value: string): string;
146
+ /**
147
+ * Constructs a ExecutionContext object from the arguments passed to
148
+ * execute, which we will pass throughout the other execution methods.
149
+ *
150
+ * Throws a GraphQLError if a valid execution context cannot be created.
151
+ */
152
+ export declare function buildCompilationContext(schema: GraphQLSchema, document: DocumentNode, options: CompilerOptions, operationName?: string): CompilationContext;
153
+ export declare function isAsyncIterable<T = unknown>(val: unknown): val is AsyncIterableIterator<T>;
154
+ export {};