graphql
Index
Classes
Enumerations
Functions
- ExecutableDefinitionsRule
- FieldsOnCorrectTypeRule
- FragmentsOnCompositeTypesRule
- KnownArgumentNamesRule
- KnownDirectivesRule
- KnownFragmentNamesRule
- 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
- assertCompositeType
- assertDirective
- assertEnumType
- assertInputObjectType
- assertInputType
- assertInterfaceType
- assertLeafType
- assertListType
- assertName
- assertNamedType
- assertNonNullType
- assertNullableType
- assertObjectType
- assertOutputType
- assertScalarType
- assertSchema
- assertType
- assertUnionType
- assertValidName
- assertValidSchema
- assertWrappingType
- astFromValue
- buildASTSchema
- buildClientSchema
- buildSchema
- coerceInputValue
- concatAST
- createSourceEventStream
- defaultFieldResolver
- defaultTypeResolver
- doTypesOverlap
- execute
- executeSync
- extendSchema
- findBreakingChanges
- findDangerousChanges
- formatError
- getArgumentValues
- getDirectiveValues
- getEnterLeaveForKind
- getIntrospectionQuery
- getLocation
- getNamedType
- getNullableType
- getOperationAST
- getOperationRootType
- getVariableValues
- getVisitFn
- graphql
- graphqlSync
- introspectionFromSchema
- isAbstractType
- isCompositeType
- isConstValueNode
- isDefinitionNode
- isDirective
- isEnumType
- isEqualType
- isExecutableDefinitionNode
- 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
- isValidNameError
- isValueNode
- isWrappingType
- lexicographicSortSchema
- locatedError
- parse
- parseConstValue
- parseType
- parseValue
- printError
- printIntrospectionSchema
- printLocation
- printSchema
- printSourceLocation
- printType
- resolveObjMapThunk
- resolveReadonlyArrayThunk
- responsePathAsArray
- separateOperations
- stripIgnoredCharacters
- subscribe
- syntaxError
- typeFromAST
- validate
- validateSchema
- valueFromAST
- valueFromASTUntyped
- visit
- visitInParallel
- visitWithTypeInfo
Interfaces
- ArgumentNode
- BooleanValueNode
- BreakingChange
- BuildSchemaOptions
- ConstArgumentNode
- ConstDirectiveNode
- ConstListValueNode
- ConstObjectFieldNode
- ConstObjectValueNode
- DangerousChange
- DirectiveDefinitionNode
- DirectiveNode
- DocumentNode
- EnumTypeDefinitionNode
- EnumTypeExtensionNode
- EnumValueDefinitionNode
- EnumValueNode
- ExecutionArgs
- ExecutionResult
- FieldDefinitionNode
- FieldNode
- FloatValueNode
- FormattedExecutionResult
- FragmentDefinitionNode
- FragmentSpreadNode
- GraphQLArgs
- GraphQLArgument
- GraphQLArgumentConfig
- GraphQLArgumentExtensions
- GraphQLDirectiveConfig
- GraphQLDirectiveExtensions
- GraphQLEnumTypeConfig
- GraphQLEnumTypeExtensions
- GraphQLEnumValue
- GraphQLEnumValueConfig
- GraphQLEnumValueExtensions
- GraphQLErrorExtensions
- GraphQLField
- GraphQLFieldConfig
- GraphQLFieldExtensions
- GraphQLFormattedError
- GraphQLInputField
- GraphQLInputFieldConfig
- GraphQLInputFieldExtensions
- GraphQLInputObjectTypeConfig
- GraphQLInputObjectTypeExtensions
- GraphQLInterfaceTypeConfig
- GraphQLInterfaceTypeExtensions
- GraphQLObjectTypeConfig
- GraphQLObjectTypeExtensions
- GraphQLResolveInfo
- GraphQLScalarTypeConfig
- GraphQLScalarTypeExtensions
- GraphQLSchemaConfig
- GraphQLSchemaExtensions
- GraphQLUnionTypeConfig
- GraphQLUnionTypeExtensions
- 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
- ScalarTypeDefinitionNode
- ScalarTypeExtensionNode
- SchemaDefinitionNode
- SchemaExtensionNode
- SelectionSetNode
- SourceLocation
- StringValueNode
- SubscriptionArgs
- TypedQueryDocumentNode
- UnionTypeDefinitionNode
- UnionTypeExtensionNode
- VariableDefinitionNode
- VariableNode
Type aliases
- ASTKindToNode
- ASTNode
- ASTVisitFn
- ASTVisitor
- ASTVisitorKeyMap
- ConstValueNode
- DefinitionNode
- DirectiveLocationEnum
- ExecutableDefinitionNode
- GraphQLAbstractType
- GraphQLCompositeType
- GraphQLEnumValueConfigMap
- GraphQLFieldConfigArgumentMap
- GraphQLFieldConfigMap
- GraphQLFieldMap
- GraphQLFieldResolver
- GraphQLInputFieldConfigMap
- GraphQLInputFieldMap
- GraphQLInputType
- GraphQLIsTypeOfFn
- GraphQLLeafType
- GraphQLNamedInputType
- GraphQLNamedOutputType
- GraphQLNamedType
- GraphQLNullableType
- GraphQLOutputType
- GraphQLScalarLiteralParser
- GraphQLScalarSerializer
- GraphQLScalarValueParser
- GraphQLType
- GraphQLTypeResolver
- GraphQLWrappingType
- IntrospectionInputType
- IntrospectionInputTypeRef
- IntrospectionOutputType
- IntrospectionOutputTypeRef
- IntrospectionType
- IntrospectionTypeRef
- KindEnum
- SelectionNode
- ThunkObjMap
- ThunkReadonlyArray
- TokenKindEnum
- TypeDefinitionNode
- TypeExtensionNode
- TypeNode
- TypeSystemDefinitionNode
- TypeSystemExtensionNode
- ValidationRule
- ValueNode
Variables
- BREAK
- DEFAULT_DEPRECATION_REASON
- GRAPHQL_MAX_INT
- GRAPHQL_MIN_INT
- GraphQLBoolean
- GraphQLDeprecatedDirective
- GraphQLFloat
- GraphQLID
- GraphQLIncludeDirective
- GraphQLInt
- GraphQLSkipDirective
- GraphQLSpecifiedByDirective
- GraphQLString
- SchemaMetaFieldDef
- TypeMetaFieldDef
- TypeNameMetaFieldDef
- __Directive
- __DirectiveLocation
- __EnumValue
- __Field
- __InputValue
- __Schema
- __Type
- __TypeKind
- introspectionTypes
- specifiedDirectives
- specifiedRules
- specifiedScalarTypes
- version
- versionInfo
Type aliases
ASTKindToNode
Utility type listing all nodes indexed by their kind.
ASTNode
The list of all possible AST node types.
ASTVisitFn
Type parameters
- TVisitedNode: ASTNode
Type declaration
A visitor is comprised of visit functions, which are called on each node during the visitor’s traversal.
Parameters
node: TVisitedNode
key: string | number | undefined
parent: ASTNode | ReadonlyArray<ASTNode> | undefined
path: ReadonlyArray<string | number>
ancestors: ReadonlyArray<ASTNode | ReadonlyArray<ASTNode>>
Returns any
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.
ConstValueNode
DefinitionNode
DirectiveLocationEnum
The enum type representing the directive location values.
ExecutableDefinitionNode
GraphQLAbstractType
These types may describe the parent context of a selection set.
GraphQLCompositeType
These types may describe the parent context of a selection set.
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
Returns TResult
GraphQLInputFieldConfigMap
GraphQLInputFieldMap
GraphQLInputType
These types may be used as input types for arguments and directives.
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.
GraphQLNullableType
These types can all accept null as a value.
GraphQLOutputType
These types may be used as output types as the result of fields.
GraphQLScalarLiteralParser
Type parameters
- TInternal
Type declaration
Parameters
valueNode: ValueNode
optionalvariables: Maybe<ObjMap<unknown>>
Returns TInternal
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
IntrospectionInputType
IntrospectionInputTypeRef
IntrospectionOutputType
IntrospectionOutputTypeRef
IntrospectionType
IntrospectionTypeRef
KindEnum
The enum type representing the possible kind values of AST nodes.
SelectionNode
ThunkObjMap
Type parameters
- T
ThunkReadonlyArray
Used while defining GraphQL types to allow for circular references in otherwise immutable type definitions.
Type parameters
- T
TokenKindEnum
The enum type representing the token kinds values.
TypeDefinitionNode
Type Definition
TypeExtensionNode
Type Extensions
TypeNode
Type Reference
TypeSystemDefinitionNode
Type System Definition
TypeSystemExtensionNode
Type System Extensions
ValidationRule
Type declaration
Parameters
context: ValidationContext
Returns ASTVisitor
ValueNode
Values
Variables
constBREAK
constDEFAULT_DEPRECATION_REASON
Constant string used for default reason for a deprecation.
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
constGraphQLDeprecatedDirective
Used to declare element of a GraphQL schema as deprecated.
constGraphQLFloat
constGraphQLID
constGraphQLIncludeDirective
Used to conditionally include fields or fragments.
constGraphQLInt
constGraphQLSkipDirective
Used to conditionally skip (exclude) fields or fragments.
constGraphQLSpecifiedByDirective
Used to provide a URL for specifying the behavior of custom scalar definitions.
constGraphQLString
constSchemaMetaFieldDef
Note that these are GraphQLField and not GraphQLFieldConfig, so the format for args is different.
constTypeMetaFieldDef
constTypeNameMetaFieldDef
const__Directive
const__DirectiveLocation
const__EnumValue
const__Field
const__InputValue
const__Schema
const__Type
const__TypeKind
constintrospectionTypes
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: