graphql
Index
Classes
Functions
- ExecutableDefinitionsRule
- FieldsOnCorrectTypeRule
- FragmentsOnCompositeTypesRule
- KnownArgumentNamesRule
- KnownDirectivesRule
- KnownFragmentNamesRule
- KnownOperationTypesRule
- KnownTypeNamesRule
- LoneAnonymousOperationRule
- LoneSchemaDefinitionRule
- NoDeprecatedCustomRule
- NoFragmentCyclesRule
- NoSchemaIntrospectionCustomRule
- NoUndefinedVariablesRule
- NoUnusedFragmentsRule
- NoUnusedVariablesRule
- OverlappingFieldsCanBeMergedRule
- PossibleFragmentSpreadsRule
- PossibleTypeExtensionsRule
- ProvidedRequiredArgumentsRule
- ScalarLeafsRule
- SingleFieldSubscriptionsRule
- UniqueArgumentDefinitionNamesRule
- UniqueArgumentNamesRule
- UniqueDirectiveNamesRule
- UniqueDirectivesPerLocationRule
- UniqueEnumValueNamesRule
- UniqueFieldDefinitionNamesRule
- UniqueFragmentNamesRule
- UniqueInputFieldNamesRule
- UniqueOperationNamesRule
- UniqueOperationTypesRule
- UniqueTypeNamesRule
- UniqueVariableNamesRule
- ValuesOfCorrectTypeRule
- VariablesAreInputTypesRule
- VariablesInAllowedPositionRule
- assertAbstractType
- assertArgument
- assertCompositeType
- assertDirective
- assertEnumType
- assertEnumValue
- assertField
- assertInputField
- assertInputObjectType
- assertInputType
- assertInterfaceType
- assertLeafType
- assertListType
- assertName
- assertNamedType
- assertNonNullType
- assertNullableType
- assertObjectType
- assertOutputType
- assertScalarType
- assertSchema
- assertType
- assertUnionType
- assertValidSchema
- assertWrappingType
- astFromValue
- buildASTSchema
- buildClientSchema
- buildSchema
- coerceInputLiteral
- coerceInputValue
- concatAST
- createSourceEventStream
- defaultFieldResolver
- defaultTypeResolver
- doTypesOverlap
- execute
- executeQueryOrMutationOrSubscriptionEvent
- executeSubscriptionEvent
- executeSync
- experimentalExecuteIncrementally
- experimentalExecuteQueryOrMutationOrSubscriptionEvent
- extendSchema
- findBreakingChanges
- findDangerousChanges
- findSchemaChanges
- getArgumentValues
- getDirectiveValues
- getEnterLeaveForKind
- getIntrospectionQuery
- getLocation
- getNamedType
- getNullableType
- getOperationAST
- getVariableValues
- graphql
- graphqlSync
- introspectionFromSchema
- isAbstractType
- isArgument
- isCompositeType
- isConstValueNode
- isDefinitionNode
- isDirective
- isEnumType
- isEnumValue
- isEqualType
- isExecutableDefinitionNode
- isField
- isInputField
- isInputObjectType
- isInputType
- isInterfaceType
- isIntrospectionType
- isLeafType
- isListType
- isNamedType
- isNonNullType
- isNullableType
- isObjectType
- isOutputType
- isRequiredArgument
- isRequiredInputField
- isScalarType
- isSchema
- isSelectionNode
- isSpecifiedDirective
- isSpecifiedScalarType
- isType
- isTypeDefinitionNode
- isTypeExtensionNode
- isTypeNode
- isTypeSubTypeOf
- isTypeSystemDefinitionNode
- isTypeSystemExtensionNode
- isUnionType
- isValueNode
- isWrappingType
- lexicographicSortSchema
- locatedError
- parse
- parseConstValue
- parseType
- parseValue
- printDirective
- printIntrospectionSchema
- printLocation
- printSchema
- printSourceLocation
- printType
- replaceVariables
- resolveObjMapThunk
- resolveReadonlyArrayThunk
- responsePathAsArray
- separateOperations
- stripIgnoredCharacters
- subscribe
- syntaxError
- typeFromAST
- validate
- validateInputLiteral
- validateInputValue
- validateSchema
- valueFromAST
- valueFromASTUntyped
- valueToLiteral
- visit
- visitInParallel
- visitWithTypeInfo
Interfaces
- ArgumentNode
- BooleanValueNode
- BreakingChange
- BuildSchemaOptions
- ConstArgumentNode
- ConstDirectiveNode
- ConstListValueNode
- ConstObjectFieldNode
- ConstObjectValueNode
- DangerousChange
- DirectiveDefinitionNode
- DirectiveNode
- DocumentNode
- EnumTypeDefinitionNode
- EnumTypeExtensionNode
- EnumValueDefinitionNode
- EnumValueNode
- ExecutionArgs
- ExecutionResult
- ExperimentalIncrementalExecutionResults
- FieldDefinitionNode
- FieldNode
- FloatValueNode
- FormattedExecutionResult
- FormattedIncrementalDeferResult
- FormattedIncrementalStreamResult
- FormattedInitialIncrementalExecutionResult
- FormattedSubsequentIncrementalExecutionResult
- FragmentArgumentNode
- FragmentDefinitionNode
- FragmentSpreadNode
- GraphQLArgs
- GraphQLArgumentConfig
- GraphQLArgumentExtensions
- GraphQLDirectiveConfig
- GraphQLDirectiveExtensions
- GraphQLEnumTypeConfig
- GraphQLEnumTypeExtensions
- GraphQLEnumValueConfig
- GraphQLEnumValueExtensions
- GraphQLErrorExtensions
- GraphQLErrorOptions
- GraphQLFieldConfig
- GraphQLFieldExtensions
- GraphQLFormattedError
- GraphQLInputFieldConfig
- GraphQLInputFieldExtensions
- GraphQLInputObjectTypeConfig
- GraphQLInputObjectTypeExtensions
- GraphQLInterfaceTypeConfig
- GraphQLInterfaceTypeExtensions
- GraphQLObjectTypeConfig
- GraphQLObjectTypeExtensions
- GraphQLResolveInfo
- GraphQLScalarTypeConfig
- GraphQLScalarTypeExtensions
- GraphQLSchemaConfig
- GraphQLSchemaExtensions
- GraphQLUnionTypeConfig
- GraphQLUnionTypeExtensions
- IncrementalDeferResult
- IncrementalStreamResult
- InitialIncrementalExecutionResult
- InlineFragmentNode
- InputObjectTypeDefinitionNode
- InputObjectTypeExtensionNode
- InputValueDefinitionNode
- IntValueNode
- InterfaceTypeDefinitionNode
- InterfaceTypeExtensionNode
- IntrospectionDirective
- IntrospectionEnumType
- IntrospectionEnumValue
- IntrospectionField
- IntrospectionInputObjectType
- IntrospectionInputValue
- IntrospectionInterfaceType
- IntrospectionListTypeRef
- IntrospectionNamedTypeRef
- IntrospectionNonNullTypeRef
- IntrospectionObjectType
- IntrospectionOptions
- IntrospectionQuery
- IntrospectionScalarType
- IntrospectionSchema
- IntrospectionUnionType
- ListTypeNode
- ListValueNode
- NameNode
- NamedTypeNode
- NonNullTypeNode
- NullValueNode
- ObjectFieldNode
- ObjectTypeDefinitionNode
- ObjectTypeExtensionNode
- ObjectValueNode
- OperationDefinitionNode
- OperationTypeDefinitionNode
- ParseOptions
- ResponsePath
- SafeChange
- ScalarTypeDefinitionNode
- ScalarTypeExtensionNode
- SchemaDefinitionNode
- SchemaExtensionNode
- SelectionSetNode
- SourceLocation
- StringValueNode
- SubsequentIncrementalExecutionResult
- TypedQueryDocumentNode
- UnionTypeDefinitionNode
- UnionTypeExtensionNode
- ValidatedExecutionArgs
- VariableDefinitionNode
- VariableNode
Namespaces
References
Type Aliases
- ASTKindToNode
- ASTNode
- ASTVisitFn
- ASTVisitor
- ASTVisitorKeyMap
- BreakingChangeType
- ConstValueNode
- DangerousChangeType
- DefinitionNode
- DirectiveLocation
- ExecutableDefinitionNode
- FormattedIncrementalResult
- GraphQLAbstractType
- GraphQLCompositeType
- GraphQLDefaultValueUsage
- GraphQLEnumValueConfigMap
- GraphQLFieldConfigArgumentMap
- GraphQLFieldConfigMap
- GraphQLFieldMap
- GraphQLFieldResolver
- GraphQLInputFieldConfigMap
- GraphQLInputFieldMap
- GraphQLInputType
- GraphQLIsTypeOfFn
- GraphQLLeafType
- GraphQLNamedInputType
- GraphQLNamedOutputType
- GraphQLNamedType
- GraphQLNullableInputType
- GraphQLNullableOutputType
- GraphQLNullableType
- GraphQLOutputType
- GraphQLScalarInputLiteralCoercer
- GraphQLScalarInputValueCoercer
- GraphQLScalarLiteralParser
- GraphQLScalarOutputValueCoercer
- GraphQLScalarSerializer
- GraphQLScalarValueParser
- GraphQLType
- GraphQLTypeResolver
- GraphQLWrappingType
- IncrementalResult
- IntrospectionInputType
- IntrospectionInputTypeRef
- IntrospectionOutputType
- IntrospectionOutputTypeRef
- IntrospectionType
- IntrospectionTypeRef
- OperationTypeNode
- SafeChangeType
- SelectionNode
- ThunkObjMap
- ThunkReadonlyArray
- TokenKind
- TypeDefinitionNode
- TypeExtensionNode
- TypeKind
- TypeNode
- TypeSystemDefinitionNode
- TypeSystemExtensionNode
- ValidationRule
- ValueNode
Variables
- BREAK
- BreakingChangeType
- DEFAULT_DEPRECATION_REASON
- DangerousChangeType
- DirectiveLocation
- GRAPHQL_MAX_INT
- GRAPHQL_MIN_INT
- GraphQLBoolean
- GraphQLDeferDirective
- GraphQLDeprecatedDirective
- GraphQLFloat
- GraphQLID
- GraphQLIncludeDirective
- GraphQLInt
- GraphQLOneOfDirective
- GraphQLSkipDirective
- GraphQLSpecifiedByDirective
- GraphQLStreamDirective
- GraphQLString
- OperationTypeNode
- SafeChangeType
- SchemaMetaFieldDef
- TokenKind
- TypeKind
- TypeMetaFieldDef
- TypeNameMetaFieldDef
- __Directive
- __DirectiveLocation
- __EnumValue
- __Field
- __InputValue
- __Schema
- __Type
- __TypeKind
- introspectionTypes
- recommendedRules
- specifiedDirectives
- specifiedRules
- specifiedScalarTypes
- version
- versionInfo
References
MaxIntrospectionDepthRule
Type Aliases
ASTKindToNode
Utility type listing all nodes indexed by their kind.
ASTNode
The list of all possible AST node types.
ASTVisitFn
A visitor is comprised of visit functions, which are called on each node during the visitor's traversal.
Type parameters
- TVisitedNode: ASTNode
ASTVisitor
A visitor is provided to visit, it contains the collection of relevant functions to be called during the visitor's traversal.
ASTVisitorKeyMap
A KeyMap describes each the traversable properties of each kind of node.
BreakingChangeType
ConstValueNode
DangerousChangeType
DefinitionNode
DirectiveLocation
ExecutableDefinitionNode
FormattedIncrementalResult
Type parameters
- TData = unknown
- TExtensions = ObjMap<unknown>
GraphQLAbstractType
These types may describe the parent context of a selection set.
GraphQLCompositeType
These types may describe the parent context of a selection set.
GraphQLDefaultValueUsage
GraphQLEnumValueConfigMap
GraphQLFieldConfigArgumentMap
GraphQLFieldConfigMap
Type parameters
- TSource
- TContext
GraphQLFieldMap
Type parameters
- TSource
- TContext
GraphQLFieldResolver
Type parameters
- TSource
- TContext
- TArgs = any
- TResult = unknown
Type declaration
Parameters
source: TSource
args: TArgs
context: TContext
info: GraphQLResolveInfo
abortSignal: AbortSignal | undefined
Returns TResult
GraphQLInputFieldConfigMap
GraphQLInputFieldMap
GraphQLInputType
GraphQLIsTypeOfFn
Type parameters
- TSource
- TContext
Type declaration
Parameters
source: TSource
context: TContext
info: GraphQLResolveInfo
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
These types can all accept null as a value.
GraphQLOutputType
GraphQLScalarInputLiteralCoercer
Type parameters
- TInternal
Type declaration
Parameters
valueNode: ConstValueNode
Returns Maybe<TInternal>
GraphQLScalarInputValueCoercer
Type parameters
- TInternal
Type declaration
Parameters
inputValue: unknown
Returns TInternal
GraphQLScalarLiteralParser
Type parameters
- TInternal
Type declaration
Parameters
valueNode: ValueNode
variables: Maybe<ObjMap<unknown>>
Returns Maybe<TInternal>
GraphQLScalarOutputValueCoercer
Type parameters
- TExternal
Type declaration
Parameters
outputValue: unknown
Returns TExternal
GraphQLScalarSerializer
Type parameters
- TExternal
Type declaration
Parameters
outputValue: unknown
Returns TExternal
GraphQLScalarValueParser
Type parameters
- TInternal
Type declaration
Parameters
inputValue: unknown
Returns TInternal
GraphQLType
These are all of the possible kinds of types.
GraphQLTypeResolver
Type parameters
- TSource
- TContext
Type declaration
Parameters
value: TSource
context: TContext
info: GraphQLResolveInfo
abstractType: GraphQLAbstractType
Returns PromiseOrValue<string | undefined>
GraphQLWrappingType
These types wrap and modify other types
IncrementalResult
Type parameters
- TData = unknown
- TExtensions = ObjMap<unknown>
IntrospectionInputType
IntrospectionInputTypeRef
IntrospectionOutputType
IntrospectionOutputTypeRef
IntrospectionType
IntrospectionTypeRef
OperationTypeNode
SafeChangeType
SelectionNode
ThunkObjMap
Type parameters
- T
ThunkReadonlyArray
Used while defining GraphQL types to allow for circular references in otherwise immutable type definitions.
Type parameters
- T
TokenKind
TypeDefinitionNode
Type Definition
TypeExtensionNode
Type Extensions
TypeKind
TypeNode
Type Reference
TypeSystemDefinitionNode
Type System Definition
TypeSystemExtensionNode
Type System Extensions
ValidationRule
Type declaration
Parameters
context: ValidationContext
Returns ASTVisitor
ValueNode
Values
Variables
constBREAK
constBreakingChangeType
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
Constant string used for default reason for a deprecation.
constDangerousChangeType
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
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
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
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
constGraphQLDeferDirective
Used to conditionally defer fragments.
constGraphQLDeprecatedDirective
Used to declare element of a GraphQL schema as deprecated.
constGraphQLFloat
constGraphQLID
constGraphQLIncludeDirective
Used to conditionally include fields or fragments.
constGraphQLInt
constGraphQLOneOfDirective
Used to indicate an Input Object is a OneOf Input Object.
constGraphQLSkipDirective
Used to conditionally skip (exclude) fields or fragments.
constGraphQLSpecifiedByDirective
Used to provide a URL for specifying the behavior of custom scalar definitions.
constGraphQLStreamDirective
Used to conditionally stream list fields.
constGraphQLString
constOperationTypeNode
Type declaration
readonlyMUTATION: mutation
readonlyQUERY: query
readonlySUBSCRIPTION: subscription
constSafeChangeType
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
constTokenKind
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
Type declaration
readonlyENUM: ENUM
readonlyINPUT_OBJECT: INPUT_OBJECT
readonlyINTERFACE: INTERFACE
readonlyLIST: LIST
readonlyNON_NULL: NON_NULL
readonlyOBJECT: OBJECT
readonlySCALAR: SCALAR
readonlyUNION: UNION
constTypeMetaFieldDef
constTypeNameMetaFieldDef
const__Directive
const__DirectiveLocation
const__EnumValue
const__Field
const__InputValue
const__Schema
const__Type
const__TypeKind
constintrospectionTypes
constrecommendedRules
Technically these aren't part of the spec but they are strongly encouraged validation rules.
constspecifiedDirectives
The full list of specified directives.
constspecifiedRules
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
constversion
A string containing the version of the GraphQL.js library
constversionInfo
An object containing the components of the GraphQL.js version string
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:
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: