Skip to main content

graphql

GraphQL.js provides a reference implementation for the GraphQL specification but is also a useful utility for operating on GraphQL files and building sophisticated tools.

This primary module exports a general purpose function for fulfilling all steps of the GraphQL specification in a single operation, but also includes utilities for every part of the GraphQL specification:

  • Parsing the GraphQL language.
  • Building a GraphQL type schema.
  • Validating a GraphQL request against a type schema.
  • Executing a GraphQL request against a type schema.

This also includes utility functions for operating on GraphQL types and GraphQL documents to facilitate building tools.

You may also import from each sub-directory directly. For example, the following two import statements are equivalent:

import { parse } from 'graphql';
import { parse } from 'graphql/language';

Index

Classes

Functions

Interfaces

References

Type Aliases

Variables

References

MaxIntrospectionDepthRule

Renames and re-exports __type

Type Aliases

ASTKindToNode

ASTKindToNode: { [ NodeT in ASTNode as NodeT[kind] ]: NodeT }

Utility type listing all nodes indexed by their kind.

ASTNode

The list of all possible AST node types.

ASTVisitFn

ASTVisitFn<TVisitedNode>: (node: TVisitedNode, key: string | number | undefined, parent: ASTNode | ReadonlyArray<ASTNode> | undefined, path: ReadonlyArray<string | number>, ancestors: ReadonlyArray<ASTNode | ReadonlyArray<ASTNode>>) => any

A visitor is comprised of visit functions, which are called on each node during the visitor's traversal.


Type parameters

Type declaration

    • (node: TVisitedNode, key: string | number | undefined, parent: ASTNode | ReadonlyArray<ASTNode> | undefined, path: ReadonlyArray<string | number>, ancestors: ReadonlyArray<ASTNode | ReadonlyArray<ASTNode>>): any
    • Parameters

      • node: TVisitedNode
      • key: string | number | undefined
      • parent: ASTNode | ReadonlyArray<ASTNode> | undefined
      • path: ReadonlyArray<string | number>
      • ancestors: ReadonlyArray<ASTNode | ReadonlyArray<ASTNode>>

      Returns any

ASTVisitor

ASTVisitor: EnterLeaveVisitor<ASTNode> | KindVisitor

A visitor is provided to visit, it contains the collection of relevant functions to be called during the visitor's traversal.

ASTVisitorKeyMap

ASTVisitorKeyMap: { [ NodeT in ASTNode as NodeT[kind] ]?: ReadonlyArray<keyof NodeT> }

A KeyMap describes each the traversable properties of each kind of node.

BreakingChangeType

BreakingChangeType: typeof BreakingChangeType[keyof typeof BreakingChangeType]

ConstValueNode

DangerousChangeType

DangerousChangeType: typeof DangerousChangeType[keyof typeof DangerousChangeType]

DefinitionNode

DirectiveLocation

DirectiveLocation: typeof DirectiveLocation[keyof typeof DirectiveLocation]

ExecutableDefinitionNode

FormattedIncrementalResult

FormattedIncrementalResult<TData, TExtensions>: FormattedIncrementalDeferResult<TData, TExtensions> | FormattedIncrementalStreamResult<TData, TExtensions>

Type parameters

  • TData = unknown
  • TExtensions = ObjMap<unknown>

GraphQLAbstractType

GraphQLAbstractType: GraphQLInterfaceType | GraphQLUnionType

These types may describe the parent context of a selection set.

GraphQLCompositeType

These types may describe the parent context of a selection set.

GraphQLDefaultValueUsage

GraphQLDefaultValueUsage: { literal?: never; value: unknown } | { literal: ConstValueNode; value?: never }

GraphQLEnumValueConfigMap

GraphQLEnumValueConfigMap: ObjMap<GraphQLEnumValueConfig>

GraphQLFieldConfigArgumentMap

GraphQLFieldConfigArgumentMap: ObjMap<GraphQLArgumentConfig>

GraphQLFieldConfigMap

GraphQLFieldConfigMap<TSource, TContext>: ObjMap<GraphQLFieldConfig<TSource, TContext>>

Type parameters

  • TSource
  • TContext

GraphQLFieldMap

GraphQLFieldMap<TSource, TContext>: ObjMap<GraphQLField<TSource, TContext>>

Type parameters

  • TSource
  • TContext

GraphQLFieldResolver

GraphQLFieldResolver<TSource, TContext, TArgs, TResult>: (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo, abortSignal: AbortSignal | undefined) => TResult

Type parameters

  • TSource
  • TContext
  • TArgs = any
  • TResult = unknown

Type declaration

    • (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo, abortSignal: AbortSignal | undefined): TResult
    • Parameters

      • source: TSource
      • args: TArgs
      • context: TContext
      • info: GraphQLResolveInfo
      • abortSignal: AbortSignal | undefined

      Returns TResult

GraphQLInputFieldConfigMap

GraphQLInputFieldConfigMap: ObjMap<GraphQLInputFieldConfig>

GraphQLInputFieldMap

GraphQLInputFieldMap: ObjMap<GraphQLInputField>

GraphQLInputType

GraphQLIsTypeOfFn

GraphQLIsTypeOfFn<TSource, TContext>: (source: TSource, context: TContext, info: GraphQLResolveInfo) => PromiseOrValue<boolean>

Type parameters

  • TSource
  • TContext

Type declaration

    • Parameters

      Returns PromiseOrValue<boolean>

GraphQLLeafType

These types may describe types which may be leaf values.

GraphQLNamedInputType

GraphQLNamedOutputType

GraphQLNamedType

These named types do not include modifiers like List or NonNull.

GraphQLNullableInputType

These types may be used as input types for arguments and directives.

GraphQLNullableOutputType

These types may be used as output types as the result of fields.

GraphQLNullableType

GraphQLNullableType: GraphQLNamedType | GraphQLList<GraphQLType>

These types can all accept null as a value.

GraphQLOutputType

GraphQLScalarInputLiteralCoercer

GraphQLScalarInputLiteralCoercer<TInternal>: (valueNode: ConstValueNode) => Maybe<TInternal>

Type parameters

  • TInternal

Type declaration

GraphQLScalarInputValueCoercer

GraphQLScalarInputValueCoercer<TInternal>: (inputValue: unknown) => TInternal

Type parameters

  • TInternal

Type declaration

    • (inputValue: unknown): TInternal
    • Parameters

      • inputValue: unknown

      Returns TInternal

GraphQLScalarLiteralParser

GraphQLScalarLiteralParser<TInternal>: (valueNode: ValueNode, variables: Maybe<ObjMap<unknown>>) => Maybe<TInternal>

Type parameters

  • TInternal

Type declaration

    • (valueNode: ValueNode, variables: Maybe<ObjMap<unknown>>): Maybe<TInternal>
    • Parameters

      • valueNode: ValueNode
      • variables: Maybe<ObjMap<unknown>>

      Returns Maybe<TInternal>

GraphQLScalarOutputValueCoercer

GraphQLScalarOutputValueCoercer<TExternal>: (outputValue: unknown) => TExternal

Type parameters

  • TExternal

Type declaration

    • (outputValue: unknown): TExternal
    • Parameters

      • outputValue: unknown

      Returns TExternal

GraphQLScalarSerializer

GraphQLScalarSerializer<TExternal>: (outputValue: unknown) => TExternal

Type parameters

  • TExternal

Type declaration

    • (outputValue: unknown): TExternal
    • Parameters

      • outputValue: unknown

      Returns TExternal

GraphQLScalarValueParser

GraphQLScalarValueParser<TInternal>: (inputValue: unknown) => TInternal

Type parameters

  • TInternal

Type declaration

    • (inputValue: unknown): TInternal
    • Parameters

      • inputValue: unknown

      Returns TInternal

GraphQLType

These are all of the possible kinds of types.

GraphQLTypeResolver

GraphQLTypeResolver<TSource, TContext>: (value: TSource, context: TContext, info: GraphQLResolveInfo, abstractType: GraphQLAbstractType) => PromiseOrValue<string | undefined>

Type parameters

  • TSource
  • TContext

Type declaration

GraphQLWrappingType

These types wrap and modify other types

IncrementalResult

IncrementalResult<TData, TExtensions>: IncrementalDeferResult<TData, TExtensions> | IncrementalStreamResult<TData, TExtensions>

Type parameters

  • TData = unknown
  • TExtensions = ObjMap<unknown>

IntrospectionInputType

IntrospectionInputTypeRef

IntrospectionOutputType

IntrospectionOutputTypeRef

IntrospectionType

IntrospectionTypeRef

Kind

Kind: typeof Kind[keyof typeof Kind]

OperationTypeNode

OperationTypeNode: typeof OperationTypeNode[keyof typeof OperationTypeNode]

SafeChangeType

SafeChangeType: typeof SafeChangeType[keyof typeof SafeChangeType]

SelectionNode

ThunkObjMap

ThunkObjMap<T>: () => ObjMap<T> | ObjMap<T>

Type parameters

  • T

ThunkReadonlyArray

ThunkReadonlyArray<T>: () => ReadonlyArray<T> | ReadonlyArray<T>

Used while defining GraphQL types to allow for circular references in otherwise immutable type definitions.


Type parameters

  • T

TokenKind

TokenKind: typeof TokenKind[keyof typeof TokenKind]

TypeDefinitionNode

Type Definition

TypeExtensionNode

Type Extensions

TypeKind

TypeKind: typeof TypeKind[keyof typeof TypeKind]

TypeNode

Type Reference

TypeSystemDefinitionNode

Type System Definition

TypeSystemExtensionNode

TypeSystemExtensionNode: SchemaExtensionNode | TypeExtensionNode

Type System Extensions

ValidationRule

ValidationRule: (context: ValidationContext) => ASTVisitor

Type declaration

ValueNode

Values

Variables

constBREAK

BREAK: unknown = ...

constBreakingChangeType

BreakingChangeType: { ARG_CHANGED_KIND: ARG_CHANGED_KIND; ARG_REMOVED: ARG_REMOVED; DIRECTIVE_ARG_REMOVED: DIRECTIVE_ARG_REMOVED; DIRECTIVE_LOCATION_REMOVED: DIRECTIVE_LOCATION_REMOVED; DIRECTIVE_REMOVED: DIRECTIVE_REMOVED; DIRECTIVE_REPEATABLE_REMOVED: DIRECTIVE_REPEATABLE_REMOVED; FIELD_CHANGED_KIND: FIELD_CHANGED_KIND; FIELD_REMOVED: FIELD_REMOVED; IMPLEMENTED_INTERFACE_REMOVED: IMPLEMENTED_INTERFACE_REMOVED; REQUIRED_ARG_ADDED: REQUIRED_ARG_ADDED; REQUIRED_DIRECTIVE_ARG_ADDED: REQUIRED_DIRECTIVE_ARG_ADDED; REQUIRED_INPUT_FIELD_ADDED: REQUIRED_INPUT_FIELD_ADDED; TYPE_CHANGED_KIND: TYPE_CHANGED_KIND; TYPE_REMOVED: TYPE_REMOVED; TYPE_REMOVED_FROM_UNION: TYPE_REMOVED_FROM_UNION; VALUE_REMOVED_FROM_ENUM: VALUE_REMOVED_FROM_ENUM } = ...

Type declaration

  • readonlyARG_CHANGED_KIND: ARG_CHANGED_KIND
  • readonlyARG_REMOVED: ARG_REMOVED
  • readonlyDIRECTIVE_ARG_REMOVED: DIRECTIVE_ARG_REMOVED
  • readonlyDIRECTIVE_LOCATION_REMOVED: DIRECTIVE_LOCATION_REMOVED
  • readonlyDIRECTIVE_REMOVED: DIRECTIVE_REMOVED
  • readonlyDIRECTIVE_REPEATABLE_REMOVED: DIRECTIVE_REPEATABLE_REMOVED
  • readonlyFIELD_CHANGED_KIND: FIELD_CHANGED_KIND
  • readonlyFIELD_REMOVED: FIELD_REMOVED
  • readonlyIMPLEMENTED_INTERFACE_REMOVED: IMPLEMENTED_INTERFACE_REMOVED
  • readonlyREQUIRED_ARG_ADDED: REQUIRED_ARG_ADDED
  • readonlyREQUIRED_DIRECTIVE_ARG_ADDED: REQUIRED_DIRECTIVE_ARG_ADDED
  • readonlyREQUIRED_INPUT_FIELD_ADDED: REQUIRED_INPUT_FIELD_ADDED
  • readonlyTYPE_CHANGED_KIND: TYPE_CHANGED_KIND
  • readonlyTYPE_REMOVED: TYPE_REMOVED
  • readonlyTYPE_REMOVED_FROM_UNION: TYPE_REMOVED_FROM_UNION
  • readonlyVALUE_REMOVED_FROM_ENUM: VALUE_REMOVED_FROM_ENUM

constDEFAULT_DEPRECATION_REASON

DEFAULT_DEPRECATION_REASON: No longer supported = 'No longer supported'

Constant string used for default reason for a deprecation.

constDangerousChangeType

DangerousChangeType: { ARG_DEFAULT_VALUE_CHANGE: ARG_DEFAULT_VALUE_CHANGE; IMPLEMENTED_INTERFACE_ADDED: IMPLEMENTED_INTERFACE_ADDED; OPTIONAL_ARG_ADDED: OPTIONAL_ARG_ADDED; OPTIONAL_INPUT_FIELD_ADDED: OPTIONAL_INPUT_FIELD_ADDED; TYPE_ADDED_TO_UNION: TYPE_ADDED_TO_UNION; VALUE_ADDED_TO_ENUM: VALUE_ADDED_TO_ENUM } = ...

Type declaration

  • ARG_DEFAULT_VALUE_CHANGE: ARG_DEFAULT_VALUE_CHANGE
  • IMPLEMENTED_INTERFACE_ADDED: IMPLEMENTED_INTERFACE_ADDED
  • OPTIONAL_ARG_ADDED: OPTIONAL_ARG_ADDED
  • OPTIONAL_INPUT_FIELD_ADDED: OPTIONAL_INPUT_FIELD_ADDED
  • TYPE_ADDED_TO_UNION: TYPE_ADDED_TO_UNION
  • VALUE_ADDED_TO_ENUM: VALUE_ADDED_TO_ENUM

constDirectiveLocation

DirectiveLocation: { ARGUMENT_DEFINITION: ARGUMENT_DEFINITION; ENUM: ENUM; ENUM_VALUE: ENUM_VALUE; FIELD: FIELD; FIELD_DEFINITION: FIELD_DEFINITION; FRAGMENT_DEFINITION: FRAGMENT_DEFINITION; FRAGMENT_SPREAD: FRAGMENT_SPREAD; FRAGMENT_VARIABLE_DEFINITION: FRAGMENT_VARIABLE_DEFINITION; INLINE_FRAGMENT: INLINE_FRAGMENT; INPUT_FIELD_DEFINITION: INPUT_FIELD_DEFINITION; INPUT_OBJECT: INPUT_OBJECT; INTERFACE: INTERFACE; MUTATION: MUTATION; OBJECT: OBJECT; QUERY: QUERY; SCALAR: SCALAR; SCHEMA: SCHEMA; SUBSCRIPTION: SUBSCRIPTION; UNION: UNION; VARIABLE_DEFINITION: VARIABLE_DEFINITION } = ...

The set of allowed directive location values.


Type declaration

  • readonlyARGUMENT_DEFINITION: ARGUMENT_DEFINITION
  • readonlyENUM: ENUM
  • readonlyENUM_VALUE: ENUM_VALUE
  • readonlyFIELD: FIELD
  • readonlyFIELD_DEFINITION: FIELD_DEFINITION
  • readonlyFRAGMENT_DEFINITION: FRAGMENT_DEFINITION
  • readonlyFRAGMENT_SPREAD: FRAGMENT_SPREAD
  • readonlyFRAGMENT_VARIABLE_DEFINITION: FRAGMENT_VARIABLE_DEFINITION
  • readonlyINLINE_FRAGMENT: INLINE_FRAGMENT
  • readonlyINPUT_FIELD_DEFINITION: INPUT_FIELD_DEFINITION
  • readonlyINPUT_OBJECT: INPUT_OBJECT
  • readonlyINTERFACE: INTERFACE
  • readonlyMUTATION: MUTATION
  • readonlyOBJECT: OBJECT
  • readonlyQUERY: QUERY

    Request Definitions

  • readonlySCALAR: SCALAR
  • readonlySCHEMA: SCHEMA

    Type System Definitions

  • readonlySUBSCRIPTION: SUBSCRIPTION
  • readonlyUNION: UNION
  • readonlyVARIABLE_DEFINITION: VARIABLE_DEFINITION

constGRAPHQL_MAX_INT

GRAPHQL_MAX_INT: 2147483647 = 2147483647

Maximum possible Int value as per GraphQL Spec (32-bit signed integer). n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1

constGRAPHQL_MIN_INT

GRAPHQL_MIN_INT: -2147483648 = -2147483648

Minimum possible Int value as per GraphQL Spec (32-bit signed integer). n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1)

constGraphQLBoolean

GraphQLBoolean: GraphQLScalarType<boolean, boolean> = ...

constGraphQLDeferDirective

GraphQLDeferDirective: GraphQLDirective = ...

Used to conditionally defer fragments.

constGraphQLDeprecatedDirective

GraphQLDeprecatedDirective: GraphQLDirective = ...

Used to declare element of a GraphQL schema as deprecated.

constGraphQLFloat

GraphQLFloat: GraphQLScalarType<number, number> = ...

constGraphQLID

GraphQLID: GraphQLScalarType<string, string> = ...

constGraphQLIncludeDirective

GraphQLIncludeDirective: GraphQLDirective = ...

Used to conditionally include fields or fragments.

constGraphQLInt

GraphQLInt: GraphQLScalarType<number, number> = ...

constGraphQLOneOfDirective

GraphQLOneOfDirective: GraphQLDirective = ...

Used to indicate an Input Object is a OneOf Input Object.

constGraphQLSkipDirective

GraphQLSkipDirective: GraphQLDirective = ...

Used to conditionally skip (exclude) fields or fragments.

constGraphQLSpecifiedByDirective

GraphQLSpecifiedByDirective: GraphQLDirective = ...

Used to provide a URL for specifying the behavior of custom scalar definitions.

constGraphQLStreamDirective

GraphQLStreamDirective: GraphQLDirective = ...

Used to conditionally stream list fields.

constGraphQLString

GraphQLString: GraphQLScalarType<string, string> = ...

constKind

Kind: { ARGUMENT: Argument; BOOLEAN: BooleanValue; DIRECTIVE: Directive; DIRECTIVE_DEFINITION: DirectiveDefinition; DOCUMENT: Document; ENUM: EnumValue; ENUM_TYPE_DEFINITION: EnumTypeDefinition; ENUM_TYPE_EXTENSION: EnumTypeExtension; ENUM_VALUE_DEFINITION: EnumValueDefinition; FIELD: Field; FIELD_DEFINITION: FieldDefinition; FLOAT: FloatValue; FRAGMENT_ARGUMENT: FragmentArgument; FRAGMENT_DEFINITION: FragmentDefinition; FRAGMENT_SPREAD: FragmentSpread; INLINE_FRAGMENT: InlineFragment; INPUT_OBJECT_TYPE_DEFINITION: InputObjectTypeDefinition; INPUT_OBJECT_TYPE_EXTENSION: InputObjectTypeExtension; INPUT_VALUE_DEFINITION: InputValueDefinition; INT: IntValue; INTERFACE_TYPE_DEFINITION: InterfaceTypeDefinition; INTERFACE_TYPE_EXTENSION: InterfaceTypeExtension; LIST: ListValue; LIST_TYPE: ListType; NAME: Name; NAMED_TYPE: NamedType; NON_NULL_TYPE: NonNullType; NULL: NullValue; OBJECT: ObjectValue; OBJECT_FIELD: ObjectField; OBJECT_TYPE_DEFINITION: ObjectTypeDefinition; OBJECT_TYPE_EXTENSION: ObjectTypeExtension; OPERATION_DEFINITION: OperationDefinition; OPERATION_TYPE_DEFINITION: OperationTypeDefinition; SCALAR_TYPE_DEFINITION: ScalarTypeDefinition; SCALAR_TYPE_EXTENSION: ScalarTypeExtension; SCHEMA_DEFINITION: SchemaDefinition; SCHEMA_EXTENSION: SchemaExtension; SELECTION_SET: SelectionSet; STRING: StringValue; UNION_TYPE_DEFINITION: UnionTypeDefinition; UNION_TYPE_EXTENSION: UnionTypeExtension; VARIABLE: Variable; VARIABLE_DEFINITION: VariableDefinition } = ...

The set of allowed kind values for AST nodes.


Type declaration

  • ARGUMENT: Argument
  • BOOLEAN: BooleanValue
  • DIRECTIVE: Directive

    Directives

  • DIRECTIVE_DEFINITION: DirectiveDefinition

    Directive Definitions

  • DOCUMENT: Document

    Document

  • ENUM: EnumValue
  • ENUM_TYPE_DEFINITION: EnumTypeDefinition
  • ENUM_TYPE_EXTENSION: EnumTypeExtension
  • ENUM_VALUE_DEFINITION: EnumValueDefinition
  • FIELD: Field
  • FIELD_DEFINITION: FieldDefinition
  • FLOAT: FloatValue
  • FRAGMENT_ARGUMENT: FragmentArgument
  • FRAGMENT_DEFINITION: FragmentDefinition
  • FRAGMENT_SPREAD: FragmentSpread

    Fragments

  • INLINE_FRAGMENT: InlineFragment
  • INPUT_OBJECT_TYPE_DEFINITION: InputObjectTypeDefinition
  • INPUT_OBJECT_TYPE_EXTENSION: InputObjectTypeExtension
  • INPUT_VALUE_DEFINITION: InputValueDefinition
  • INT: IntValue
  • INTERFACE_TYPE_DEFINITION: InterfaceTypeDefinition
  • INTERFACE_TYPE_EXTENSION: InterfaceTypeExtension
  • LIST: ListValue
  • LIST_TYPE: ListType
  • NAME: Name

    Name

  • NAMED_TYPE: NamedType

    Types

  • NON_NULL_TYPE: NonNullType
  • NULL: NullValue
  • OBJECT: ObjectValue
  • OBJECT_FIELD: ObjectField
  • OBJECT_TYPE_DEFINITION: ObjectTypeDefinition
  • OBJECT_TYPE_EXTENSION: ObjectTypeExtension
  • OPERATION_DEFINITION: OperationDefinition
  • OPERATION_TYPE_DEFINITION: OperationTypeDefinition
  • SCALAR_TYPE_DEFINITION: ScalarTypeDefinition

    Type Definitions

  • SCALAR_TYPE_EXTENSION: ScalarTypeExtension

    Type Extensions

  • SCHEMA_DEFINITION: SchemaDefinition

    Type System Definitions

  • SCHEMA_EXTENSION: SchemaExtension

    Type System Extensions

  • SELECTION_SET: SelectionSet
  • STRING: StringValue
  • UNION_TYPE_DEFINITION: UnionTypeDefinition
  • UNION_TYPE_EXTENSION: UnionTypeExtension
  • VARIABLE: Variable

    Values

  • VARIABLE_DEFINITION: VariableDefinition

constOperationTypeNode

OperationTypeNode: { MUTATION: mutation; QUERY: query; SUBSCRIPTION: subscription } = ...

Type declaration

  • readonlyMUTATION: mutation
  • readonlyQUERY: query
  • readonlySUBSCRIPTION: subscription

constSafeChangeType

SafeChangeType: { ARG_CHANGED_KIND_SAFE: ARG_CHANGED_KIND_SAFE; ARG_DEFAULT_VALUE_ADDED: ARG_DEFAULT_VALUE_ADDED; DESCRIPTION_CHANGED: DESCRIPTION_CHANGED; DIRECTIVE_ADDED: DIRECTIVE_ADDED; DIRECTIVE_LOCATION_ADDED: DIRECTIVE_LOCATION_ADDED; DIRECTIVE_REPEATABLE_ADDED: DIRECTIVE_REPEATABLE_ADDED; FIELD_ADDED: FIELD_ADDED; FIELD_CHANGED_KIND_SAFE: FIELD_CHANGED_KIND_SAFE; OPTIONAL_ARG_ADDED: OPTIONAL_ARG_ADDED; OPTIONAL_DIRECTIVE_ARG_ADDED: OPTIONAL_DIRECTIVE_ARG_ADDED; OPTIONAL_INPUT_FIELD_ADDED: OPTIONAL_INPUT_FIELD_ADDED; TYPE_ADDED: TYPE_ADDED } = ...

Type declaration

  • ARG_CHANGED_KIND_SAFE: ARG_CHANGED_KIND_SAFE
  • ARG_DEFAULT_VALUE_ADDED: ARG_DEFAULT_VALUE_ADDED
  • DESCRIPTION_CHANGED: DESCRIPTION_CHANGED
  • DIRECTIVE_ADDED: DIRECTIVE_ADDED
  • DIRECTIVE_LOCATION_ADDED: DIRECTIVE_LOCATION_ADDED
  • DIRECTIVE_REPEATABLE_ADDED: DIRECTIVE_REPEATABLE_ADDED
  • FIELD_ADDED: FIELD_ADDED
  • FIELD_CHANGED_KIND_SAFE: FIELD_CHANGED_KIND_SAFE
  • OPTIONAL_ARG_ADDED: OPTIONAL_ARG_ADDED
  • OPTIONAL_DIRECTIVE_ARG_ADDED: OPTIONAL_DIRECTIVE_ARG_ADDED
  • OPTIONAL_INPUT_FIELD_ADDED: OPTIONAL_INPUT_FIELD_ADDED
  • TYPE_ADDED: TYPE_ADDED

constSchemaMetaFieldDef

SchemaMetaFieldDef: GraphQLField<unknown, unknown> = ...

Note that these are GraphQLField and not GraphQLFieldConfig, so the format for args is different.

constTokenKind

TokenKind: { AMP: &; AT: @; BANG: !; BLOCK_STRING: BlockString; BRACE_L: {; BRACE_R: }; BRACKET_L: [; BRACKET_R: ]; COLON: :; COMMENT: Comment; DOLLAR: $; EOF: <EOF>; EQUALS: =; FLOAT: Float; INT: Int; NAME: Name; PAREN_L: (; PAREN_R: ); PIPE: |; SOF: <SOF>; SPREAD: ...; STRING: String } = ...

An exported enum describing the different kinds of tokens that the lexer emits.


Type declaration

  • readonlyAMP: &
  • readonlyAT: @
  • readonlyBANG: !
  • readonlyBLOCK_STRING: BlockString
  • readonlyBRACE_L: {
  • readonlyBRACE_R: }
  • readonlyBRACKET_L: [
  • readonlyBRACKET_R: ]
  • readonlyCOLON: :
  • readonlyCOMMENT: Comment
  • readonlyDOLLAR: $
  • readonlyEOF: <EOF>
  • readonlyEQUALS: =
  • readonlyFLOAT: Float
  • readonlyINT: Int
  • readonlyNAME: Name
  • readonlyPAREN_L: (
  • readonlyPAREN_R: )
  • readonlyPIPE: |
  • readonlySOF: <SOF>
  • readonlySPREAD: ...
  • readonlySTRING: String

constTypeKind

TypeKind: { ENUM: ENUM; INPUT_OBJECT: INPUT_OBJECT; INTERFACE: INTERFACE; LIST: LIST; NON_NULL: NON_NULL; OBJECT: OBJECT; SCALAR: SCALAR; UNION: UNION } = ...

Type declaration

  • readonlyENUM: ENUM
  • readonlyINPUT_OBJECT: INPUT_OBJECT
  • readonlyINTERFACE: INTERFACE
  • readonlyLIST: LIST
  • readonlyNON_NULL: NON_NULL
  • readonlyOBJECT: OBJECT
  • readonlySCALAR: SCALAR
  • readonlyUNION: UNION

constTypeMetaFieldDef

TypeMetaFieldDef: GraphQLField<unknown, unknown> = ...

constTypeNameMetaFieldDef

TypeNameMetaFieldDef: GraphQLField<unknown, unknown> = ...

const__Directive

__Directive: GraphQLObjectType = ...

const__DirectiveLocation

__DirectiveLocation: GraphQLEnumType = ...

const__EnumValue

__EnumValue: GraphQLObjectType = ...

const__Field

__Field: GraphQLObjectType = ...

const__InputValue

__InputValue: GraphQLObjectType = ...

const__Schema

__Schema: GraphQLObjectType = ...

const__Type

__Type: GraphQLObjectType = ...

const__TypeKind

__TypeKind: GraphQLEnumType = ...

constintrospectionTypes

introspectionTypes: ReadonlyArray<GraphQLNamedType> = ...

constrecommendedRules

recommendedRules: readonly (context: ValidationContext) => ASTVisitor[] = ...

Technically these aren't part of the spec but they are strongly encouraged validation rules.

constspecifiedDirectives

specifiedDirectives: ReadonlyArray<GraphQLDirective> = ...

The full list of specified directives.

constspecifiedRules

specifiedRules: ReadonlyArray<ValidationRule> = ...

This set includes all validation rules defined by the GraphQL spec.

The order of the rules in this list has been adjusted to lead to the most clear output when encountering multiple validation errors.

constspecifiedScalarTypes

specifiedScalarTypes: ReadonlyArray<GraphQLScalarType> = ...

constversion

version: string = ...

A string containing the version of the GraphQL.js library

constversionInfo

versionInfo: Readonly<{ major: number; minor: number; patch: number; preReleaseTag: null | string }> = ...

An object containing the components of the GraphQL.js version string

Page Options