{"version":3,"sources":["../src/ast.ts"],"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  Source,\n  Location\n} from \"graphql\";\nimport { type CompilationContext, GLOBAL_VARIABLES_NAME } from \"./execution.js\";\nimport createInspect from \"./inspect.js\";\nimport { getGraphQLErrorOptions, resolveFieldDef } 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    selectionSet: SelectionSetNode;\n    parentResponsePath: string;\n    previousShouldInclude: string[];\n  }\n\n  const stack: StackItem[] = [];\n\n  stack.push({\n    selectionSet,\n    parentResponsePath,\n    previousShouldInclude\n  });\n\n  while (stack.length > 0) {\n    const { selectionSet, parentResponsePath, previousShouldInclude } =\n      stack.pop()!;\n\n    for (const selection of selectionSet.selections) {\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            continue;\n          }\n\n          // current fragment's shouldInclude\n          const compiledSkipInclude = compileSkipInclude(\n            compilationContext,\n            selection\n          );\n\n          // push to stack\n          stack.push({\n            selectionSet: selection.selectionSet,\n            parentResponsePath: parentResponsePath,\n            previousShouldInclude: joinShouldIncludeCompilations(\n              // `should include`s from previous fragments\n              previousShouldInclude,\n              // current fragment's shouldInclude\n              [compiledSkipInclude]\n            )\n          });\n          break;\n        }\n\n        case Kind.FRAGMENT_SPREAD: {\n          const fragName = selection.name.value;\n          if (visitedFragmentNames[fragName]) {\n            continue;\n          }\n          visitedFragmentNames[fragName] = true;\n          const fragment = compilationContext.fragments[fragName];\n          if (\n            !fragment ||\n            !doesFragmentConditionMatch(\n              compilationContext,\n              fragment,\n              runtimeType\n            )\n          ) {\n            continue;\n          }\n\n          // current fragment's shouldInclude\n          const compiledSkipInclude = compileSkipInclude(\n            compilationContext,\n            selection\n          );\n\n          // push to stack\n          stack.push({\n            selectionSet: fragment.selectionSet,\n            parentResponsePath,\n            previousShouldInclude: joinShouldIncludeCompilations(\n              // `should include`s from previous fragments\n              previousShouldInclude,\n              // current fragment's shouldInclude\n              [compiledSkipInclude]\n            )\n          });\n          break;\n        }\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 (argDef.defaultValue !== undefined) {\n      // Set the coerced value to the default\n      values[name] = argDef.defaultValue;\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 (field.defaultValue !== undefined) {\n        coercedObj[field.name] = field.defaultValue;\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 parseLiteral().\n    // Invalid values represent a failure to parse correctly, in which case\n    // no value is returned.\n    let result: any;\n    try {\n      if (type.parseLiteral.length > 1) {\n        // eslint-disable-next-line\n        console.error(\n          \"Scalar with variable inputs detected for parsing AST literals. This is not supported.\"\n        );\n      }\n      result = type.parseLiteral(valueNode, {});\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"],"mappings":"AAAA;AAAA,EAQE;AAAA,EAEA;AAAA,EAGA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAGA;AAAA,EAGA;AAAA,OAGK;AACP,SAAkC,6BAA6B;AAC/D,OAAO,mBAAmB;AAC1B,SAAS,wBAAwB,uBAAuB;AAuBxD,MAAM,UAAU,cAAc;AAUvB,SAAS,cACd,oBACA,aACA,cACA,QACA,sBACA,oBACgB;AAChB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kCAAkC,kBAAkB;AAAA,EACtD;AACF;AAMA,SAAS,kBACP,oBACA,aACA,cACA,QACA,sBACA,wBAAkC,CAAC,GACnC,qBAAqB,IACL;AAOhB,QAAM,QAAqB,CAAC;AAE5B,QAAM,KAAK;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO,MAAM,SAAS,GAAG;AACvB,UAAM,EAAE,cAA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KAAK;AAAA,EACd;AACA,SAAO;AACT;AASO,SAAS,oBAAoB,GAAW,GAAW;AACxD,MAAI,GAAG;AACL,QAAI,GAAG;AACL,aAAO,GAAG,CAAC,IAAI,CAAC;AAAA,IAClB;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,SAAS,UAAU,OAAqB;AAEtC,SAAO,UAAU,UAAa,UAAU;AAC1C;","names":["selectionSet","parentResponsePath","previousShouldInclude","selection","valueNode"]}