Docs
API Reference
Packages
utils

@graphql-tools/utils

Table of contents

References

Enumerations

Interfaces

Type Aliases

Variables

Functions

References

extractExtensionsFromSchema

Re-exports extractExtensionsFromSchema


withCancel

Renames and re-exports getAsyncIterableWithCancel

Type Aliases

ASTVisitorKeyMap

Ƭ ASTVisitorKeyMap: Partial<Parameters<typeof visit>[2]>

Defined in

packages/utils/src/types.ts:64 (opens in a new tab)


AbstractTypeMapper

Ƭ AbstractTypeMapper: (type: GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLInterfaceType | GraphQLUnionType | null | undefined

Type declaration

▸ (type, schema): GraphQLInterfaceType | GraphQLUnionType | null | undefined

Parameters
NameType
typeGraphQLInterfaceType | GraphQLUnionType
schemaGraphQLSchema
Returns

GraphQLInterfaceType | GraphQLUnionType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:436 (opens in a new tab)


ArgumentFilter

Ƭ ArgumentFilter: (typeName?: string, fieldName?: string, argName?: string, argConfig?: GraphQLArgumentConfig) => boolean

Type declaration

▸ (typeName?, fieldName?, argName?, argConfig?): boolean

Parameters
NameType
typeName?string
fieldName?string
argName?string
argConfig?GraphQLArgumentConfig
Returns

boolean

Defined in

packages/utils/src/Interfaces.ts:238 (opens in a new tab)


ArgumentMapper

Ƭ ArgumentMapper: (argumentConfig: GraphQLArgumentConfig, fieldName: string, typeName: string, schema: GraphQLSchema) => GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined

Type declaration

▸ (argumentConfig, fieldName, typeName, schema): GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined

Parameters
NameType
argumentConfigGraphQLArgumentConfig
fieldNamestring
typeNamestring
schemaGraphQLSchema
Returns

GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined

Defined in

packages/utils/src/Interfaces.ts:462 (opens in a new tab)


ArgumentToDirectives

Ƭ ArgumentToDirectives: Object

Index signature

▪ [argumentName: string]: DirectiveUsage[]

Defined in

packages/utils/src/get-arguments-with-directives.ts:9 (opens in a new tab)


AsyncExecutor

Ƭ AsyncExecutor<TBaseContext, TBaseExtensions>: <TReturn, TArgs, TContext, TRoot, TExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>

Type parameters

NameType
TBaseContextRecord<string, any>
TBaseExtensionsRecord<string, any>

Type declaration

▸ <TReturn, TArgs, TContext, TRoot, TExtensions>(request): Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>

Type parameters
NameType
TReturnany
TArgsextends Record<string, any> = Record<string, any>
TContextextends TBaseContext = TBaseContext
TRootany
TExtensionsextends TBaseExtensions = TBaseExtensions
Parameters
NameType
requestExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>
Returns

Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>

Defined in

packages/utils/src/executor.ts:6 (opens in a new tab)


BaseLoaderOptions

Ƭ BaseLoaderOptions: GraphQLParseOptions & BuildSchemaOptions & { cwd?: string ; ignore?: string | string[] }

Defined in

packages/utils/src/loaders.ts:11 (opens in a new tab)


Callback

Ƭ Callback: (value?: any) => any

Type declaration

▸ (value?): any

Parameters
NameType
value?any
Returns

any

Defined in

packages/utils/src/observableToAsyncIterable.ts:13 (opens in a new tab)


CompositeTypeMapper

Ƭ CompositeTypeMapper: (type: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined

Type declaration

▸ (type, schema): GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined

Parameters
NameType
typeGraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType
schemaGraphQLSchema
Returns

GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:424 (opens in a new tab)


Constructor

Ƭ Constructor<T>: (...args: any[]) => T

Type parameters

Name
T

Type declaration

• (...args)

Parameters
NameType
...argsany[]

Defined in

packages/utils/src/types.ts:24 (opens in a new tab)


DirectiveArgs

Ƭ DirectiveArgs: Object

Index signature

▪ [name: string]: any

Defined in

packages/utils/src/types.ts:135 (opens in a new tab)


DirectiveLocationEnum

Ƭ DirectiveLocationEnum: typeof DirectiveLocation

Defined in

packages/utils/src/types.ts:66 (opens in a new tab)


DirectiveMapper

Ƭ DirectiveMapper: (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined

Type declaration

▸ (directive, schema): GraphQLDirective | null | undefined

Parameters
NameType
directiveGraphQLDirective
schemaGraphQLSchema
Returns

GraphQLDirective | null | undefined

Defined in

packages/utils/src/Interfaces.ts:448 (opens in a new tab)


DirectiveUsage

Ƭ DirectiveUsage: Object

Type declaration

NameType
argsDirectiveArgs
namestring

Defined in

packages/utils/src/types.ts:136 (opens in a new tab)


ElementOf

Ƭ ElementOf<TList>: TList extends infer TElement[] ? TElement : never

Type parameters

Name
TList

Defined in

packages/utils/src/loaders.ts:18 (opens in a new tab)


EnumTypeExtensions

Ƭ EnumTypeExtensions: Object

Type declaration

NameType
type"enum"
valuesRecord<string, ExtensionsObject>

Defined in

packages/utils/src/types.ts:117 (opens in a new tab)


EnumTypeMapper

Ƭ EnumTypeMapper: (type: GraphQLEnumType, schema: GraphQLSchema) => GraphQLEnumType | null | undefined

Type declaration

▸ (type, schema): GraphQLEnumType | null | undefined

Parameters
NameType
typeGraphQLEnumType
schemaGraphQLSchema
Returns

GraphQLEnumType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:415 (opens in a new tab)


EnumValueMapper

Ƭ EnumValueMapper: (valueConfig: GraphQLEnumValueConfig, typeName: string, schema: GraphQLSchema, externalValue: string) => GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined

Type declaration

▸ (valueConfig, typeName, schema, externalValue): GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined

Parameters
NameType
valueConfigGraphQLEnumValueConfig
typeNamestring
schemaGraphQLSchema
externalValuestring
Returns

GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined

Defined in

packages/utils/src/Interfaces.ts:417 (opens in a new tab)


ErrorVisitor

Ƭ ErrorVisitor: (error: GraphQLError, pathIndex: number) => GraphQLError

Type declaration

▸ (error, pathIndex): GraphQLError

Parameters
NameType
errorGraphQLError
pathIndexnumber
Returns

GraphQLError

Defined in

packages/utils/src/visitResult.ts:33 (opens in a new tab)


ErrorVisitorMap

Ƭ ErrorVisitorMap: { __unpathed?: (error: GraphQLError) => GraphQLError } & Record<string, Record<string, ErrorVisitor>>

Defined in

packages/utils/src/visitResult.ts:35 (opens in a new tab)


Executor

Ƭ Executor<TBaseContext, TBaseExtensions>: <TReturn, TArgs, TContext, TRoot, TExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>

Type parameters

NameType
TBaseContextRecord<string, any>
TBaseExtensionsRecord<string, any>

Type declaration

▸ <TReturn, TArgs, TContext, TRoot, TExtensions>(request): MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>

Type parameters
NameType
TReturnany
TArgsextends Record<string, any> = Record<string, any>
TContextextends TBaseContext = TBaseContext
TRootany
TExtensionsextends TBaseExtensions = TBaseExtensions
Parameters
NameType
requestExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>
Returns

MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>

Defined in

packages/utils/src/executor.ts:26 (opens in a new tab)


ExtensionsObject

Ƭ ExtensionsObject: Record<string, any>

Defined in

packages/utils/src/types.ts:92 (opens in a new tab)


FieldFilter

Ƭ FieldFilter: (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig) => boolean

Type declaration

▸ (typeName, fieldName, fieldConfig): boolean

Parameters
NameType
typeNamestring
fieldNamestring
fieldConfigGraphQLFieldConfig<any, any> | GraphQLInputFieldConfig
Returns

boolean

Defined in

packages/utils/src/Interfaces.ts:218 (opens in a new tab)


FieldMapper

Ƭ FieldMapper: GenericFieldMapper<GraphQLFieldConfig<any, any>>

Defined in

packages/utils/src/Interfaces.ts:460 (opens in a new tab)


FieldNodeMapper

Ƭ FieldNodeMapper: (fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => SelectionNode | SelectionNode[]

Type declaration

▸ (fieldNode, fragments, transformationContext): SelectionNode | SelectionNode[]

Parameters
NameType
fieldNodeFieldNode
fragmentsRecord<string, FragmentDefinitionNode>
transformationContextRecord<string, any>
Returns

SelectionNode | SelectionNode[]

Defined in

packages/utils/src/Interfaces.ts:204 (opens in a new tab)


FieldNodeMappers

Ƭ FieldNodeMappers: Record<string, Record<string, FieldNodeMapper>>

Defined in

packages/utils/src/Interfaces.ts:210 (opens in a new tab)


Force

Ƭ Force: string[]

Defined in

packages/utils/src/build-operation-for-field.ts:49 (opens in a new tab)


GenericFieldMapper

Ƭ GenericFieldMapper<F>: (fieldConfig: F, fieldName: string, typeName: string, schema: GraphQLSchema) => F | [string, F] | null | undefined

Type parameters

NameType
Fextends GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig

Type declaration

▸ (fieldConfig, fieldName, typeName, schema): F | [string, F] | null | undefined

Parameters
NameType
fieldConfigF
fieldNamestring
typeNamestring
schemaGraphQLSchema
Returns

F | [string, F] | null | undefined

Defined in

packages/utils/src/Interfaces.ts:453 (opens in a new tab)


IDefaultValueIteratorFn

Ƭ IDefaultValueIteratorFn: (type: GraphQLInputType, value: any) => void

Type declaration

▸ (type, value): void

Parameters
NameType
typeGraphQLInputType
valueany
Returns

void

Defined in

packages/utils/src/Interfaces.ts:325 (opens in a new tab)


IEnumTypeResolver

Ƭ IEnumTypeResolver: Record<string, any> & { __astNode?: EnumTypeDefinitionNode ; __description?: string ; __extensionASTNodes?: EnumTypeExtensionNode[] ; __extensions?: Record<string, any> ; __name?: string }

Defined in

packages/utils/src/Interfaces.ts:183 (opens in a new tab)


IFieldIteratorFn

Ƭ IFieldIteratorFn: (fieldDef: GraphQLField<any, any>, typeName: string, fieldName: string) => void

Type declaration

▸ (fieldDef, typeName, fieldName): void

Parameters
NameType
fieldDefGraphQLField<any, any>
typeNamestring
fieldNamestring
Returns

void

Defined in

packages/utils/src/Interfaces.ts:323 (opens in a new tab)


IFieldResolver

Ƭ IFieldResolver<TSource, TContext, TArgs, TReturn>: (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn

Type parameters

NameType
TSourceTSource
TContextTContext
TArgsRecord<string, any>
TReturnany

Type declaration

▸ (source, args, context, info): TReturn

Parameters
NameType
sourceTSource
argsTArgs
contextTContext
infoGraphQLResolveInfo
Returns

TReturn

Defined in

packages/utils/src/Interfaces.ts:250 (opens in a new tab)


IInputObjectTypeResolver

Ƭ IInputObjectTypeResolver: Object

Type declaration

NameType
__astNode?InputObjectTypeDefinitionNode
__description?string
__extensionASTNodes?InputObjectTypeExtensionNode[]
__extensions?Record<string, any>
__name?string

Defined in

packages/utils/src/Interfaces.ts:297 (opens in a new tab)


IInterfaceTypeResolver

Ƭ IInterfaceTypeResolver<TSource, TContext, TArgs>: { [key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>; } & { __astNode?: InterfaceTypeDefinitionNode ; __description?: string ; __extensionASTNodes?: InterfaceTypeExtensionNode[] ; __extensions?: Record<string, any> ; __name?: string ; __resolveType?: GraphQLTypeResolver<any, any> }

Type parameters

NameType
TSourceany
TContextany
TArgsany

Defined in

packages/utils/src/Interfaces.ts:277 (opens in a new tab)


IObjectTypeResolver

Ƭ IObjectTypeResolver<TSource, TContext, TArgs>: { [key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>; } & { __astNode?: ObjectTypeDefinitionNode ; __description?: string ; __extensionASTNodes?: ObjectTypeExtensionNode ; __extensions?: Record<string, any> ; __isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext> ; __name?: string }

Type parameters

NameType
TSourceany
TContextany
TArgsany

Defined in

packages/utils/src/Interfaces.ts:266 (opens in a new tab)


IResolvers

Ƭ IResolvers<TSource, TContext, TArgs, TReturn>: Record<string, ISchemaLevelResolver<TSource, TContext, TArgs, TReturn> | IObjectTypeResolver<TSource, TContext> | IInterfaceTypeResolver<TSource, TContext> | IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver>

Type parameters

NameType
TSourceany
TContextany
TArgsRecord<string, any>
TReturnany

Defined in

packages/utils/src/Interfaces.ts:312 (opens in a new tab)


IScalarTypeResolver

Ƭ IScalarTypeResolver: GraphQLScalarType & { __astNode?: ScalarTypeDefinitionNode ; __description?: string ; __extensionASTNodes?: ScalarTypeExtensionNode[] ; __extensions?: Record<string, any> ; __name?: string ; __parseLiteral?: GraphQLScalarLiteralParser<any> ; __parseValue?: GraphQLScalarValueParser<any> ; __serialize?: GraphQLScalarSerializer<any> }

Defined in

packages/utils/src/Interfaces.ts:172 (opens in a new tab)


ISchemaLevelResolver

Ƭ ISchemaLevelResolver<TSource, TContext, TArgs, TReturn>: IFieldResolver<TSource, TContext, TArgs, TReturn>

Type parameters

NameType
TSourceTSource
TContextTContext
TArgsRecord<string, any>
TReturnany

Defined in

packages/utils/src/Interfaces.ts:305 (opens in a new tab)


IUnionTypeResolver

Ƭ IUnionTypeResolver: Object

Type declaration

NameType
__astNode?UnionTypeDefinitionNode
__description?string
__extensionASTNodes?UnionTypeExtensionNode[]
__extensions?Record<string, any>
__name?string
__resolveType?GraphQLTypeResolver<any, any>

Defined in

packages/utils/src/Interfaces.ts:288 (opens in a new tab)


Ignore

Ƭ Ignore: string[]

Defined in

packages/utils/src/build-operation-for-field.ts:50 (opens in a new tab)


InputFieldFilter

Ƭ InputFieldFilter: (typeName?: string, fieldName?: string, inputFieldConfig?: GraphQLInputFieldConfig) => boolean

Type declaration

▸ (typeName?, fieldName?, inputFieldConfig?): boolean

Parameters
NameType
typeName?string
fieldName?string
inputFieldConfig?GraphQLInputFieldConfig
Returns

boolean

Defined in

packages/utils/src/Interfaces.ts:212 (opens in a new tab)


InputFieldMapper

Ƭ InputFieldMapper: GenericFieldMapper<GraphQLInputFieldConfig>

Defined in

packages/utils/src/Interfaces.ts:469 (opens in a new tab)


InputLeafValueTransformer

Ƭ InputLeafValueTransformer: (type: GraphQLEnumType | GraphQLScalarType, originalValue: any) => any

Type declaration

▸ (type, originalValue): any

Parameters
NameType
typeGraphQLEnumType | GraphQLScalarType
originalValueany
Returns

any

Defined in

packages/utils/src/types.ts:57 (opens in a new tab)


InputObjectTypeMapper

Ƭ InputObjectTypeMapper: (type: GraphQLInputObjectType, schema: GraphQLSchema) => GraphQLInputObjectType | null | undefined

Type declaration

▸ (type, schema): GraphQLInputObjectType | null | undefined

Parameters
NameType
typeGraphQLInputObjectType
schemaGraphQLSchema
Returns

GraphQLInputObjectType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:431 (opens in a new tab)


InputObjectValueTransformer

Ƭ InputObjectValueTransformer: (type: GraphQLInputObjectType, originalValue: Record<string, any>) => Record<string, any>

Type declaration

▸ (type, originalValue): Record<string, any>

Parameters
NameType
typeGraphQLInputObjectType
originalValueRecord<string, any>
Returns

Record<string, any>

Defined in

packages/utils/src/types.ts:58 (opens in a new tab)


InputTypeExtensions

Ƭ InputTypeExtensions: Object

Type declaration

NameType
fieldsRecord<string, { extensions: ExtensionsObject }>
type"input"

Defined in

packages/utils/src/types.ts:99 (opens in a new tab)


InterfaceTypeExtensions

Ƭ InterfaceTypeExtensions: Object

Type declaration

NameType
fieldsRecord<string, { arguments: Record<string, ExtensionsObject> ; extensions: ExtensionsObject }>
type"interface"

Defined in

packages/utils/src/types.ts:104 (opens in a new tab)


InterfaceTypeMapper

Ƭ InterfaceTypeMapper: (type: GraphQLInterfaceType, schema: GraphQLSchema) => GraphQLInterfaceType | null | undefined

Type declaration

▸ (type, schema): GraphQLInterfaceType | null | undefined

Parameters
NameType
typeGraphQLInterfaceType
schemaGraphQLSchema
Returns

GraphQLInterfaceType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:443 (opens in a new tab)


Maybe

Ƭ Maybe<T>: null | undefined | T

Type parameters

Name
T

Defined in

packages/utils/src/types.ts:22 (opens in a new tab)


MaybeAsyncIterable

Ƭ MaybeAsyncIterable<T>: AsyncIterable<T> | T

Type parameters

Name
T

Defined in

packages/utils/src/executor.ts:4 (opens in a new tab)


MaybePromise

Ƭ MaybePromise<T>: PromiseLike<T> | T

Type parameters

Name
T

Defined in

packages/utils/src/executor.ts:3 (opens in a new tab)


NamedDefinitionNode

Ƭ NamedDefinitionNode: DefinitionNode & { name?: NameNode }

Defined in

packages/utils/src/comments.ts:16 (opens in a new tab)


NamedTypeMapper

Ƭ NamedTypeMapper: (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined

Type declaration

▸ (type, schema): GraphQLNamedType | null | undefined

Parameters
NameType
typeGraphQLNamedType
schemaGraphQLSchema
Returns

GraphQLNamedType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:411 (opens in a new tab)


NextResolverFn

Ƭ NextResolverFn: () => Promise<any>

Type declaration

▸ (): Promise<any>

Returns

Promise<any>

Defined in

packages/utils/src/Interfaces.ts:327 (opens in a new tab)


ObjectFieldFilter

Ƭ ObjectFieldFilter: (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean

Type declaration

▸ (typeName, fieldName, fieldConfig): boolean

Parameters
NameType
typeNamestring
fieldNamestring
fieldConfigGraphQLFieldConfig<any, any>
Returns

boolean

Defined in

packages/utils/src/Interfaces.ts:224 (opens in a new tab)


ObjectTypeExtensions

Ƭ ObjectTypeExtensions: Object

Type declaration

NameType
fieldsRecord<string, { arguments: Record<string, ExtensionsObject> ; extensions: ExtensionsObject }>
type"object"

Defined in

packages/utils/src/types.ts:94 (opens in a new tab)


ObjectTypeMapper

Ƭ ObjectTypeMapper: (type: GraphQLObjectType, schema: GraphQLSchema) => GraphQLObjectType | null | undefined

Type declaration

▸ (type, schema): GraphQLObjectType | null | undefined

Parameters
NameType
typeGraphQLObjectType
schemaGraphQLSchema
Returns

GraphQLObjectType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:429 (opens in a new tab)


ObjectValueVisitor

Ƭ ObjectValueVisitor: { __enter?: ValueVisitor ; __leave?: ValueVisitor } & Record<string, ValueVisitor>

Defined in

packages/utils/src/visitResult.ts:26 (opens in a new tab)


PossibleTypeExtensions

Ƭ PossibleTypeExtensions: InputTypeExtensions | InterfaceTypeExtensions | ObjectTypeExtensions | UnionTypeExtensions | ScalarTypeExtensions | EnumTypeExtensions

Defined in

packages/utils/src/types.ts:122 (opens in a new tab)


PrintSchemaWithDirectivesOptions

Ƭ PrintSchemaWithDirectivesOptions: SchemaPrintOptions & GetDocumentNodeFromSchemaOptions

Defined in

packages/utils/src/types.ts:20 (opens in a new tab)


PruneSchemaFilter

Ƭ PruneSchemaFilter: (type: GraphQLNamedType) => boolean

Type declaration

▸ (type): boolean

Parameters
NameType
typeGraphQLNamedType
Returns

boolean

Defined in

packages/utils/src/types.ts:26 (opens in a new tab)


RenameTypesOptions

Ƭ RenameTypesOptions: Object

Type declaration

NameType
renameBuiltinsboolean
renameScalarsboolean

Defined in

packages/utils/src/Interfaces.ts:245 (opens in a new tab)


ResultVisitorMap

Ƭ ResultVisitorMap: Record<string, ValueVisitor | ObjectValueVisitor>

Defined in

packages/utils/src/visitResult.ts:31 (opens in a new tab)


RootFieldFilter

Ƭ RootFieldFilter: (operation: "Query" | "Mutation" | "Subscription", rootFieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean

Type declaration

▸ (operation, rootFieldName, fieldConfig): boolean

Parameters
NameType
operation"Query" | "Mutation" | "Subscription"
rootFieldNamestring
fieldConfigGraphQLFieldConfig<any, any>
Returns

boolean

Defined in

packages/utils/src/Interfaces.ts:230 (opens in a new tab)


ScalarTypeExtensions

Ƭ ScalarTypeExtensions: Object

Type declaration

NameType
type"scalar"

Defined in

packages/utils/src/types.ts:113 (opens in a new tab)


ScalarTypeMapper

Ƭ ScalarTypeMapper: (type: GraphQLScalarType, schema: GraphQLSchema) => GraphQLScalarType | null | undefined

Type declaration

▸ (type, schema): GraphQLScalarType | null | undefined

Parameters
NameType
typeGraphQLScalarType
schemaGraphQLSchema
Returns

GraphQLScalarType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:413 (opens in a new tab)


SchemaExtensions

Ƭ SchemaExtensions: Object

Type declaration

NameType
schemaExtensionsExtensionsObject
typesRecord<string, { extensions: ExtensionsObject } & PossibleTypeExtensions>

Defined in

packages/utils/src/types.ts:130 (opens in a new tab)


SchemaFieldMapperTypes

Ƭ SchemaFieldMapperTypes: (FIELD | COMPOSITE_FIELD | OBJECT_FIELD | ROOT_FIELD | QUERY_ROOT_FIELD | MUTATION_ROOT_FIELD | SUBSCRIPTION_ROOT_FIELD | INTERFACE_FIELD | INPUT_OBJECT_FIELD)[]

Defined in

packages/utils/src/Interfaces.ts:399 (opens in a new tab)


SelectedFields

Ƭ SelectedFields: { [key: string]: SelectedFields; } | boolean

Defined in

packages/utils/src/build-operation-for-field.ts:52 (opens in a new tab)


Skip

Ƭ Skip: string[]

Defined in

packages/utils/src/build-operation-for-field.ts:48 (opens in a new tab)


SyncExecutor

Ƭ SyncExecutor<TBaseContext, TBaseExtensions>: <TReturn, TArgs, TContext, TRoot, TExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => ExecutionResult<TReturn>

Type parameters

NameType
TBaseContextRecord<string, any>
TBaseExtensionsRecord<string, any>

Type declaration

▸ <TReturn, TArgs, TContext, TRoot, TExtensions>(request): ExecutionResult<TReturn>

Type parameters
NameType
TReturnany
TArgsextends Record<string, any> = Record<string, any>
TContextextends TBaseContext = TBaseContext
TRootany
TExtensionsextends TBaseExtensions = TBaseExtensions
Parameters
NameType
requestExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>
Returns

ExecutionResult<TReturn>

Defined in

packages/utils/src/executor.ts:16 (opens in a new tab)


TypeAndFieldToArgumentDirectives

Ƭ TypeAndFieldToArgumentDirectives: Object

Index signature

▪ [typeAndField: string]: ArgumentToDirectives

Defined in

packages/utils/src/get-arguments-with-directives.ts:12 (opens in a new tab)


TypeAndFieldToDirectives

Ƭ TypeAndFieldToDirectives: Object

Index signature

▪ [typeAndField: string]: DirectiveUsage[]

Defined in

packages/utils/src/get-fields-with-directives.ts:11 (opens in a new tab)


TypeFilter

Ƭ TypeFilter: (typeName: string, type: GraphQLType) => boolean

Type declaration

▸ (typeName, type): boolean

Parameters
NameType
typeNamestring
typeGraphQLType
Returns

boolean

Defined in

packages/utils/src/Interfaces.ts:236 (opens in a new tab)


TypeSource

Ƭ TypeSource: string | Source | DocumentNode | GraphQLSchema | DefinitionNode | TypeSource[] | () => TypeSource

Defined in

packages/utils/src/Interfaces.ts:257 (opens in a new tab)


UnionTypeExtensions

Ƭ UnionTypeExtensions: Object

Type declaration

NameType
type"union"

Defined in

packages/utils/src/types.ts:109 (opens in a new tab)


UnionTypeMapper

Ƭ UnionTypeMapper: (type: GraphQLUnionType, schema: GraphQLSchema) => GraphQLUnionType | null | undefined

Type declaration

▸ (type, schema): GraphQLUnionType | null | undefined

Parameters
NameType
typeGraphQLUnionType
schemaGraphQLSchema
Returns

GraphQLUnionType | null | undefined

Defined in

packages/utils/src/Interfaces.ts:441 (opens in a new tab)


ValidationRule

Ƭ ValidationRule: (context: ValidationContext) => ASTVisitor

Type declaration

▸ (context): ASTVisitor

Parameters
NameType
contextValidationContext
Returns

ASTVisitor

Defined in

packages/utils/src/validate-documents.ts:13 (opens in a new tab)


ValidatorBehavior

Ƭ ValidatorBehavior: "error" | "warn" | "ignore"

Defined in

packages/utils/src/Interfaces.ts:108 (opens in a new tab)


ValueVisitor

Ƭ ValueVisitor: (value: any) => any

Type declaration

▸ (value): any

Parameters
NameType
valueany
Returns

any

Defined in

packages/utils/src/visitResult.ts:24 (opens in a new tab)


VisitableSchemaType

Ƭ VisitableSchemaType: GraphQLSchema | GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType | GraphQLNamedType | GraphQLScalarType | GraphQLField<any, any> | GraphQLInputField | GraphQLArgument | GraphQLUnionType | GraphQLEnumType | GraphQLEnumValue

Defined in

packages/utils/src/Interfaces.ts:329 (opens in a new tab)


WithList

Ƭ WithList<T>: T | T[]

Type parameters

Name
T

Defined in

packages/utils/src/loaders.ts:17 (opens in a new tab)

Variables

GraphQLDeferDirective

• Const GraphQLDeferDirective: GraphQLDirective

Used to conditionally defer fragments.

Defined in

packages/utils/src/directives.ts:13 (opens in a new tab)


GraphQLStreamDirective

• Const GraphQLStreamDirective: GraphQLDirective

Used to conditionally stream list fields.

Defined in

packages/utils/src/directives.ts:33 (opens in a new tab)

Functions

AggregateError

▸ AggregateError(errors, message?): AggregateError

Parameters

NameType
errorsIterable<any>
message?string

Returns

AggregateError

Defined in

packages/utils/src/AggregateError.ts:8 (opens in a new tab)


addPath

▸ addPath(prev, key, typename): Path

Given a Path and a key, return a new Path containing the new key.

Parameters

NameType
prevundefined | Readonly<Path>
keystring | number
typenameundefined | string

Returns

Path

Defined in

packages/utils/src/Path.ts:12 (opens in a new tab)


addTypes

▸ addTypes(schema, newTypesOrDirectives): GraphQLSchema

Parameters

NameType
schemaGraphQLSchema
newTypesOrDirectives(GraphQLNamedType | GraphQLDirective)[]

Returns

GraphQLSchema

Defined in

packages/utils/src/addTypes.ts:34 (opens in a new tab)


appendObjectFields

▸ appendObjectFields(schema, typeName, additionalFields): GraphQLSchema

Parameters

NameType
schemaGraphQLSchema
typeNamestring
additionalFieldsGraphQLFieldConfigMap<any, any>

Returns

GraphQLSchema

Defined in

packages/utils/src/fields.ts:6 (opens in a new tab)


asArray

▸ asArray<T>(fns): T[]

Type parameters

Name
T

Parameters

NameType
fnsT | T[]

Returns

T[]

Defined in

packages/utils/src/helpers.ts:3 (opens in a new tab)


assertSome

▸ assertSome<T>(input, message?): asserts input is Exclude<T, undefined | null>

Type parameters

Name
T

Parameters

NameTypeDefault value
inputTundefined
messagestring'Value should be something'

Returns

asserts input is Exclude<T, undefined | null>

Defined in

packages/utils/src/helpers.ts:75 (opens in a new tab)


astFromArg

▸ astFromArg(arg, schema?, pathToDirectivesInExtensions?): InputValueDefinitionNode

Parameters

NameType
argGraphQLArgument
schema?GraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

InputValueDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:296 (opens in a new tab)


astFromDirective

▸ astFromDirective(directive, schema?, pathToDirectivesInExtensions?): DirectiveDefinitionNode

Parameters

NameType
directiveGraphQLDirective
schema?GraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

DirectiveDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:197 (opens in a new tab)


astFromEnumType

▸ astFromEnumType(type, schema, pathToDirectivesInExtensions?): EnumTypeDefinitionNode

Parameters

NameType
typeGraphQLEnumType
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

EnumTypeDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:437 (opens in a new tab)


astFromEnumValue

▸ astFromEnumValue(value, schema, pathToDirectivesInExtensions?): EnumValueDefinitionNode

Parameters

NameType
valueGraphQLEnumValue
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

EnumValueDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:556 (opens in a new tab)


astFromField

▸ astFromField(field, schema, pathToDirectivesInExtensions?): FieldDefinitionNode

Parameters

NameType
fieldGraphQLField<any, any, any>
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

FieldDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:502 (opens in a new tab)


astFromInputField

▸ astFromInputField(field, schema, pathToDirectivesInExtensions?): InputValueDefinitionNode

Parameters

NameType
fieldGraphQLInputField
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

InputValueDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:529 (opens in a new tab)


astFromInputObjectType

▸ astFromInputObjectType(type, schema, pathToDirectivesInExtensions?): InputObjectTypeDefinitionNode

Parameters

NameType
typeGraphQLInputObjectType
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

InputObjectTypeDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:409 (opens in a new tab)


astFromInterfaceType

▸ astFromInterfaceType(type, schema, pathToDirectivesInExtensions?): InterfaceTypeDefinitionNode

Parameters

NameType
typeGraphQLInterfaceType
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

InterfaceTypeDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:350 (opens in a new tab)


astFromObjectType

▸ astFromObjectType(type, schema, pathToDirectivesInExtensions?): ObjectTypeDefinitionNode

Parameters

NameType
typeGraphQLObjectType<any, any>
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

ObjectTypeDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:324 (opens in a new tab)


astFromScalarType

▸ astFromScalarType(type, schema, pathToDirectivesInExtensions?): ScalarTypeDefinitionNode

Parameters

NameType
typeGraphQLScalarType<unknown, unknown>
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

ScalarTypeDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:463 (opens in a new tab)


astFromSchema

▸ astFromSchema(schema, pathToDirectivesInExtensions?): SchemaDefinitionNode | SchemaExtensionNode | null

Parameters

NameType
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

SchemaDefinitionNode | SchemaExtensionNode | null

Defined in

packages/utils/src/print-schema-with-directives.ts:121 (opens in a new tab)


astFromUnionType

▸ astFromUnionType(type, schema, pathToDirectivesInExtensions?): UnionTypeDefinitionNode

Parameters

NameType
typeGraphQLUnionType
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

UnionTypeDefinitionNode

Defined in

packages/utils/src/print-schema-with-directives.ts:383 (opens in a new tab)


astFromValueUntyped

▸ astFromValueUntyped(value): ValueNode | null

Produces a GraphQL Value AST given a JavaScript object. Function will match JavaScript/JSON values to GraphQL AST schema format by using the following mapping.

JSON ValueGraphQL Value
ObjectInput Object
ArrayList
BooleanBoolean
StringString
NumberInt / Float
nullNullValue

Parameters

NameType
valueany

Returns

ValueNode | null

Defined in

packages/utils/src/astFromValueUntyped.ts:18 (opens in a new tab)


buildOperationNodeForField

▸ buildOperationNodeForField(«destructured»): OperationDefinitionNode

Parameters

NameType
«destructured»Object
› argNames?string[]
› circularReferenceDepth?number
› depthLimit?number
› fieldstring
› ignore?Ignore
› kindOperationTypeNode
› models?string[]
› schemaGraphQLSchema
› selectedFields?SelectedFields

Returns

OperationDefinitionNode

Defined in

packages/utils/src/build-operation-for-field.ts:58 (opens in a new tab)


collectComment

▸ collectComment(node): void

Parameters

NameType
nodeNamedDefinitionNode

Returns

void

Defined in

packages/utils/src/comments.ts:28 (opens in a new tab)


collectFields

▸ collectFields<TVariables>(schema, fragments, variableValues, runtimeType, selectionSet): FieldsAndPatches

Given a selectionSet, collects all of the fields and returns them.

CollectFields requires the "runtime type" of an object. For a field that returns an Interface or Union type, the "runtime type" will be the actual object type returned by that field.

Type parameters

NameType
TVariablesany

Parameters

NameType
schemaGraphQLSchema
fragmentsRecord<string, FragmentDefinitionNode>
variableValuesTVariables
runtimeTypeGraphQLObjectType<any, any>
selectionSetSelectionSetNode

Returns

FieldsAndPatches

Defined in

packages/utils/src/collectFields.ts:152 (opens in a new tab)


collectSubFields

▸ collectSubFields(schema, fragments, variableValues, returnType, fieldNodes): FieldsAndPatches

Given an array of field nodes, collects all of the subfields of the passed in fields, and returns them at the end.

CollectSubFields requires the "return type" of an object. For a field that returns an Interface or Union type, the "return type" will be the actual object type returned by that field.

Parameters

NameType
schemaGraphQLSchema
fragmentsRecord<string, FragmentDefinitionNode>
variableValuesObject
returnTypeGraphQLObjectType<any, any>
fieldNodesFieldNode[]

Returns

FieldsAndPatches

Defined in

packages/utils/src/collectFields.ts:248 (opens in a new tab)


compareNodes

▸ compareNodes(a, b, customFn?): number

Parameters

NameType
aASTNode
bASTNode
customFn?(a: any, b: any) => number

Returns

number

Defined in

packages/utils/src/helpers.ts:60 (opens in a new tab)


compareStrings

▸ compareStrings<A, B>(a, b): 1 | -1 | 0

Type parameters

Name
A
B

Parameters

NameType
aA
bB

Returns

1 | -1 | 0

Defined in

packages/utils/src/helpers.ts:33 (opens in a new tab)


correctASTNodes

▸ correctASTNodes(type): GraphQLObjectType

Parameters

NameType
typeGraphQLObjectType<any, any>

Returns

GraphQLObjectType

Defined in

packages/utils/src/mapSchema.ts:508 (opens in a new tab)

▸ correctASTNodes(type): GraphQLInterfaceType

Parameters

NameType
typeGraphQLInterfaceType

Returns

GraphQLInterfaceType

Defined in

packages/utils/src/mapSchema.ts:509 (opens in a new tab)

▸ correctASTNodes(type): GraphQLInputObjectType

Parameters

NameType
typeGraphQLInputObjectType

Returns

GraphQLInputObjectType

Defined in

packages/utils/src/mapSchema.ts:510 (opens in a new tab)

▸ correctASTNodes(type): GraphQLEnumType

Parameters

NameType
typeGraphQLEnumType

Returns

GraphQLEnumType

Defined in

packages/utils/src/mapSchema.ts:511 (opens in a new tab)


createDefaultRules

▸ createDefaultRules(): ValidationRule[]

Returns

ValidationRule[]

Defined in

packages/utils/src/validate-documents.ts:46 (opens in a new tab)


createGraphQLError

▸ createGraphQLError(message, options?): GraphQLError

Parameters

NameType
messagestring
options?GraphQLErrorOptions

Returns

GraphQLError

Defined in

packages/utils/src/errors.ts:17 (opens in a new tab)


createNamedStub

▸ createNamedStub(name, type): GraphQLObjectType

Parameters

NameType
namestring
type"object"

Returns

GraphQLObjectType

Defined in

packages/utils/src/stub.ts:20 (opens in a new tab)

▸ createNamedStub(name, type): GraphQLInterfaceType

Parameters

NameType
namestring
type"interface"

Returns

GraphQLInterfaceType

Defined in

packages/utils/src/stub.ts:21 (opens in a new tab)

▸ createNamedStub(name, type): GraphQLInputObjectType

Parameters

NameType
namestring
type"input"

Returns

GraphQLInputObjectType

Defined in

packages/utils/src/stub.ts:22 (opens in a new tab)


createStub

▸ createStub(node, type): GraphQLOutputType

Parameters

NameType
nodeTypeNode
type"output"

Returns

GraphQLOutputType

Defined in

packages/utils/src/stub.ts:46 (opens in a new tab)

▸ createStub(node, type): GraphQLInputType

Parameters

NameType
nodeTypeNode
type"input"

Returns

GraphQLInputType

Defined in

packages/utils/src/stub.ts:47 (opens in a new tab)

▸ createStub(node, type): GraphQLType

Parameters

NameType
nodeTypeNode
type"input" | "output"

Returns

GraphQLType

Defined in

packages/utils/src/stub.ts:48 (opens in a new tab)


createVariableNameGenerator

▸ createVariableNameGenerator(variableDefinitionMap): (argName: string) => string

Parameters

NameType
variableDefinitionMapRecord<string, VariableDefinitionNode>

Returns

fn

▸ (argName): string

Parameters
NameType
argNamestring
Returns

string

Defined in

packages/utils/src/updateArgument.ts:54 (opens in a new tab)


dedentBlockStringValue

▸ dedentBlockStringValue(rawString): string

Parameters

NameType
rawStringstring

Returns

string

Defined in

packages/utils/src/comments.ts:454 (opens in a new tab)


doesFragmentConditionMatch

▸ doesFragmentConditionMatch(schema, fragment, type): boolean

Determines if a fragment is applicable to the given type.

Parameters

NameType
schemaGraphQLSchema
fragmentFragmentDefinitionNode | InlineFragmentNode
typeGraphQLObjectType<any, any>

Returns

boolean

Defined in

packages/utils/src/collectFields.ts:188 (opens in a new tab)


filterSchema

▸ filterSchema(«destructured»): GraphQLSchema

Parameters

NameType
«destructured»Object
› argumentFilter?ArgumentFilter
› fieldFilter?FieldFilter
› inputObjectFieldFilter?FieldFilter
› interfaceFieldFilter?FieldFilter
› objectFieldFilter?FieldFilter
› rootFieldFilter?RootFieldFilter
› schemaGraphQLSchema
› typeFilter?TypeFilter

Returns

GraphQLSchema

Defined in

packages/utils/src/filterSchema.ts:17 (opens in a new tab)


fixSchemaAst

▸ fixSchemaAst(schema, options): GraphQLSchema

Parameters

NameType
schemaGraphQLSchema
optionsBuildSchemaOptions & SchemaPrintOptions

Returns

GraphQLSchema

Defined in

packages/utils/src/fixSchemaAst.ts:12 (opens in a new tab)


forEachDefaultValue

▸ forEachDefaultValue(schema, fn): void

Parameters

NameType
schemaGraphQLSchema
fnIDefaultValueIteratorFn

Returns

void

Defined in

packages/utils/src/forEachDefaultValue.ts:5 (opens in a new tab)


forEachField

▸ forEachField(schema, fn): void

Parameters

NameType
schemaGraphQLSchema
fnIFieldIteratorFn

Returns

void

Defined in

packages/utils/src/forEachField.ts:5 (opens in a new tab)


getArgumentValues

▸ getArgumentValues(def, node, variableValues?): Record<string, any>

Prepares an object map of argument values given a list of argument definitions and list of argument AST nodes.

Note: The returned value is a plain Object with a prototype, since it is exposed to user code. Care should be taken to not pull values from the Object prototype.

Parameters

NameType
defGraphQLField<any, any, any> | GraphQLDirective
nodeFieldNode | DirectiveNode
variableValuesRecord<string, any>

Returns

Record<string, any>

Defined in

packages/utils/src/getArgumentValues.ts:25 (opens in a new tab)


getArgumentsWithDirectives

▸ getArgumentsWithDirectives(documentNode): TypeAndFieldToArgumentDirectives

Parameters

NameType
documentNodeDocumentNode

Returns

TypeAndFieldToArgumentDirectives

Defined in

packages/utils/src/get-arguments-with-directives.ts:16 (opens in a new tab)


getAsyncIterableWithCancel

▸ getAsyncIterableWithCancel<T, TAsyncIterable, TReturn>(asyncIterable, onCancel): TAsyncIterable

Type parameters

NameType
TT
TAsyncIterableextends AsyncIterable<T, TAsyncIterable>
TReturnany

Parameters

NameType
asyncIterableTAsyncIterable
onCancel(value?: TReturn) => void | Promise<void>

Returns

TAsyncIterable

Defined in

packages/utils/src/withCancel.ts:43 (opens in a new tab)


getAsyncIteratorWithCancel

▸ getAsyncIteratorWithCancel<T, TReturn>(asyncIterator, onCancel): AsyncIterator<T>

Type parameters

NameType
TT
TReturnany

Parameters

NameType
asyncIteratorAsyncIterator<T, any, undefined>
onCancel(value?: TReturn) => void | Promise<void>

Returns

AsyncIterator<T>

Defined in

packages/utils/src/withCancel.ts:16 (opens in a new tab)


getBlockStringIndentation

▸ getBlockStringIndentation(lines): number

Parameters

NameType
linesreadonly string[]

Returns

number

Defined in

packages/utils/src/comments.ts:481 (opens in a new tab)


getBuiltInForStub

▸ getBuiltInForStub(type): GraphQLNamedType

Parameters

NameType
typeGraphQLNamedType

Returns

GraphQLNamedType

Defined in

packages/utils/src/stub.ts:76 (opens in a new tab)


getComment

▸ getComment(node): undefined | string

Parameters

NameType
nodeObject
node.loc?Location

Returns

undefined | string

Defined in

packages/utils/src/comments.ts:425 (opens in a new tab)


getDeferValues

▸ getDeferValues(variableValues, node): undefined | { label: string | undefined }

Returns an object containing the @defer arguments if a field should be deferred based on the experimental flag, defer directive present and not disabled by the "if" argument.

Parameters

NameType
variableValuesany
nodeFragmentSpreadNode | InlineFragmentNode

Returns

undefined | { label: string | undefined }

Defined in

packages/utils/src/collectFields.ts:220 (opens in a new tab)


getDefinedRootType

▸ getDefinedRootType(schema, operation, nodes?): GraphQLObjectType

Parameters

NameType
schemaGraphQLSchema
operationOperationTypeNode
nodes?ASTNode[]

Returns

GraphQLObjectType

Defined in

packages/utils/src/rootTypes.ts:5 (opens in a new tab)


getDeprecatableDirectiveNodes

▸ getDeprecatableDirectiveNodes(entity, schema?, pathToDirectivesInExtensions?): DirectiveNode[]

Parameters

NameType
entityGraphQLArgument | GraphQLField<any, any, any> | GraphQLInputField | GraphQLEnumValue
schema?GraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

DirectiveNode[]

Defined in

packages/utils/src/print-schema-with-directives.ts:258 (opens in a new tab)


getDescription

▸ getDescription(node, options?): string | undefined

Parameters

NameType
nodeObject
node.description?StringValueNode
node.loc?Location
options?Object
options.commentDescriptions?boolean

Returns

string | undefined

Defined in

packages/utils/src/comments.ts:413 (opens in a new tab)


getDirective

▸ getDirective(schema, node, directiveName, pathToDirectivesInExtensions?): Record<string, any>[] | undefined

Parameters

NameType
schemaGraphQLSchema
nodeDirectableGraphQLObject
directiveNamestring
pathToDirectivesInExtensionsstring[]

Returns

Record<string, any>[] | undefined

Defined in

packages/utils/src/get-directives.ts:165 (opens in a new tab)


getDirectiveInExtensions

▸ getDirectiveInExtensions(node, directiveName, pathToDirectivesInExtensions?): Record<string, any>[] | undefined

Parameters

NameType
nodeDirectableGraphQLObject
directiveNamestring
pathToDirectivesInExtensionsstring[]

Returns

Record<string, any>[] | undefined

Defined in

packages/utils/src/get-directives.ts:84 (opens in a new tab)


getDirectiveNodes

▸ getDirectiveNodes(entity, schema, pathToDirectivesInExtensions?): DirectiveNode[]

Parameters

NameType
entityGraphQLSchema | GraphQLNamedType | GraphQLEnumValue
schemaGraphQLSchema
pathToDirectivesInExtensions?string[]

Returns

DirectiveNode[]

Defined in

packages/utils/src/print-schema-with-directives.ts:226 (opens in a new tab)


getDirectives

▸ getDirectives(schema, node, pathToDirectivesInExtensions?): DirectiveAnnotation[]

Parameters

NameType
schemaGraphQLSchema
nodeDirectableGraphQLObject
pathToDirectivesInExtensionsstring[]

Returns

DirectiveAnnotation[]

Defined in

packages/utils/src/get-directives.ts:122 (opens in a new tab)


getDirectivesInExtensions

▸ getDirectivesInExtensions(node, pathToDirectivesInExtensions?): DirectiveAnnotation[]

Parameters

NameType
nodeDirectableGraphQLObject
pathToDirectivesInExtensionsstring[]

Returns

DirectiveAnnotation[]

Defined in

packages/utils/src/get-directives.ts:60 (opens in a new tab)


getDocumentNodeFromSchema

▸ getDocumentNodeFromSchema(schema, options?): DocumentNode

Parameters

NameType
schemaGraphQLSchema
optionsGetDocumentNodeFromSchemaOptions

Returns

DocumentNode

Defined in

packages/utils/src/print-schema-with-directives.ts:59 (opens in a new tab)


getFieldEntryKey

▸ getFieldEntryKey(node): string

Implements the logic to compute the key of a given field's entry

Parameters

NameType
nodeFieldNode

Returns

string

Defined in

packages/utils/src/collectFields.ts:211 (opens in a new tab)


getFieldsWithDirectives

▸ getFieldsWithDirectives(documentNode, options?): TypeAndFieldToDirectives

Parameters

NameType
documentNodeDocumentNode
optionsOptions

Returns

TypeAndFieldToDirectives

Defined in

packages/utils/src/get-fields-with-directives.ts:25 (opens in a new tab)


getImplementingTypes

▸ getImplementingTypes(interfaceName, schema): string[]

Parameters

NameType
interfaceNamestring
schemaGraphQLSchema

Returns

string[]

Defined in

packages/utils/src/get-implementing-types.ts:3 (opens in a new tab)


getLeadingCommentBlock

▸ getLeadingCommentBlock(node): void | string

Parameters

NameType
nodeObject
node.loc?Location

Returns

void | string

Defined in

packages/utils/src/comments.ts:432 (opens in a new tab)


getOperationASTFromDocument

▸ getOperationASTFromDocument(documentNode, operationName?): OperationDefinitionNode

Parameters

NameType
documentNodeDocumentNode
operationName?string

Returns

OperationDefinitionNode

Defined in

packages/utils/src/getOperationASTFromRequest.ts:5 (opens in a new tab)


getOperationASTFromRequest

▸ getOperationASTFromRequest(request): OperationDefinitionNode

Parameters

NameType
requestExecutionRequest<any, any, any, Record<string, any>, any>

Returns

OperationDefinitionNode

Defined in

packages/utils/src/getOperationASTFromRequest.ts:16 (opens in a new tab)


getResolversFromSchema

▸ getResolversFromSchema(schema, includeDefaultMergedResolver?): IResolvers

Parameters

NameType
schemaGraphQLSchema
includeDefaultMergedResolver?boolean

Returns

IResolvers

Defined in

packages/utils/src/getResolversFromSchema.ts:14 (opens in a new tab)


getResponseKeyFromInfo

▸ getResponseKeyFromInfo(info): string

Get the key under which the result of this resolver will be placed in the response JSON. Basically, just resolves aliases.

Parameters

NameTypeDescription
infoGraphQLResolveInfoThe info argument to the resolver.

Returns

string

Defined in

packages/utils/src/getResponseKeyFromInfo.ts:8 (opens in a new tab)


getRootTypeMap

▸ getRootTypeMap(schema): Map<OperationTypeNode, GraphQLObjectType<any, any>>

Parameters

NameType
schemaGraphQLSchema

Returns

Map<OperationTypeNode, GraphQLObjectType<any, any>>

Defined in

packages/utils/src/rootTypes.ts:31 (opens in a new tab)


getRootTypeNames

▸ getRootTypeNames(schema): Set<string>

Parameters

NameType
schemaGraphQLSchema

Returns

Set<string>

Defined in

packages/utils/src/rootTypes.ts:21 (opens in a new tab)


getRootTypes

▸ getRootTypes(schema): Set<GraphQLObjectType<any, any>>

Parameters

NameType
schemaGraphQLSchema

Returns

Set<GraphQLObjectType<any, any>>

Defined in

packages/utils/src/rootTypes.ts:26 (opens in a new tab)


hasOwnProperty

▸ hasOwnProperty(obj, prop): boolean

Parameters

NameType
objunknown
propstring

Returns

boolean

Defined in

packages/utils/src/jsutils.ts:31 (opens in a new tab)


healSchema

▸ healSchema(schema): GraphQLSchema

Parameters

NameType
schemaGraphQLSchema

Returns

GraphQLSchema

Defined in

packages/utils/src/heal.ts:52 (opens in a new tab)


healTypes

▸ healTypes(originalTypeMap, directives): void

Parameters

NameType
originalTypeMapRecord<string, null | GraphQLNamedType>
directivesreadonly GraphQLDirective[]

Returns

void

Defined in

packages/utils/src/heal.ts:57 (opens in a new tab)


implementsAbstractType

▸ implementsAbstractType(schema, typeA, typeB): boolean

Parameters

NameType
schemaGraphQLSchema
typeAMaybe<GraphQLType>
typeBMaybe<GraphQLType>

Returns

boolean

Defined in

packages/utils/src/implementsAbstractType.ts:4 (opens in a new tab)


inspect

▸ inspect(value): string

Used to print values in error messages.

Parameters

NameType
valueunknown

Returns

string

Defined in

packages/utils/src/inspect.ts:12 (opens in a new tab)


isAggregateError

▸ isAggregateError(error): error is AggregateError

Parameters

NameType
errorError

Returns

error is AggregateError

Defined in

packages/utils/src/AggregateError.ts:31 (opens in a new tab)


isAsyncIterable

▸ isAsyncIterable<T>(value): value is AsyncIterable<T>

Type parameters

Name
T

Parameters

NameType
valueany

Returns

value is AsyncIterable<T>

Defined in

packages/utils/src/isAsyncIterable.ts:1 (opens in a new tab)


isDescribable

▸ isDescribable(node): node is DescribableASTNodes

Parameters

NameType
nodeASTNode

Returns

node is DescribableASTNodes

Defined in

packages/utils/src/parse-graphql-sdl.ts:97 (opens in a new tab)


isDocumentNode

▸ isDocumentNode(object): object is DocumentNode

Parameters

NameType
objectany

Returns

object is DocumentNode

Defined in

packages/utils/src/isDocumentNode.ts:3 (opens in a new tab)


isDocumentString

▸ isDocumentString(str): boolean

Parameters

NameType
strany

Returns

boolean

Defined in

packages/utils/src/helpers.ts:6 (opens in a new tab)


isIterableObject

▸ isIterableObject(value): value is Iterable<unknown>

Parameters

NameType
valueunknown

Returns

value is Iterable<unknown>

Defined in

packages/utils/src/jsutils.ts:3 (opens in a new tab)


isNamedStub

▸ isNamedStub(type): boolean

Parameters

NameType
typeGraphQLNamedType

Returns

boolean

Defined in

packages/utils/src/stub.ts:63 (opens in a new tab)


isObjectLike

▸ isObjectLike(value): value is Object

Parameters

NameType
valueunknown

Returns

value is Object

Defined in

packages/utils/src/jsutils.ts:7 (opens in a new tab)


isPromise

▸ isPromise<T>(value): value is PromiseLike<T>

Type parameters

Name
T

Parameters

NameType
valueunknown

Returns

value is PromiseLike<T>

Defined in

packages/utils/src/jsutils.ts:11 (opens in a new tab)


isSome

▸ isSome<T>(input): input is Exclude<T, undefined | null>

Type parameters

Name
T

Parameters

NameType
inputT

Returns

input is Exclude<T, undefined | null>

Defined in

packages/utils/src/helpers.ts:71 (opens in a new tab)


isValidPath

▸ isValidPath(str): boolean

Parameters

NameType
strany

Returns

boolean

Defined in

packages/utils/src/helpers.ts:29 (opens in a new tab)


makeDeprecatedDirective

▸ makeDeprecatedDirective(deprecationReason): DirectiveNode

Parameters

NameType
deprecationReasonstring

Returns

DirectiveNode

Defined in

packages/utils/src/print-schema-with-directives.ts:581 (opens in a new tab)


makeDirectiveNode

▸ makeDirectiveNode(name, args, directive?): DirectiveNode

Parameters

NameType
namestring
argsRecord<string, any>
directive?Maybe<GraphQLDirective>

Returns

DirectiveNode

Defined in

packages/utils/src/print-schema-with-directives.ts:585 (opens in a new tab)


makeDirectiveNodes

▸ makeDirectiveNodes(schema, directiveValues): DirectiveNode[]

Parameters

NameType
schemaMaybe<GraphQLSchema>
directiveValuesRecord<string, any>

Returns

DirectiveNode[]

Defined in

packages/utils/src/print-schema-with-directives.ts:637 (opens in a new tab)


mapAsyncIterator

▸ mapAsyncIterator<T, U>(iterator, callback, rejectCallback?): AsyncIterableIterator<U>

Given an AsyncIterable and a callback function, return an AsyncIterator which produces values mapped via calling the callback function.

Type parameters

Name
T
U

Parameters

NameType
iteratorAsyncIterator<T, any, undefined>
callback(value: T) => U | Promise<U>
rejectCallback?any

Returns

AsyncIterableIterator<U>

Defined in

packages/utils/src/mapAsyncIterator.ts:5 (opens in a new tab)


mapSchema

▸ mapSchema(schema, schemaMapper?): GraphQLSchema

Parameters

NameType
schemaGraphQLSchema
schemaMapperSchemaMapper

Returns

GraphQLSchema

Defined in

packages/utils/src/mapSchema.ts:50 (opens in a new tab)


memoize1

▸ memoize1<F>(fn): F

Type parameters

NameType
Fextends (a1: any) => any

Parameters

NameType
fnF

Returns

F

Defined in

packages/utils/src/memoize.ts:1 (opens in a new tab)


memoize2

▸ memoize2<F>(fn): F

Type parameters

NameType
Fextends (a1: any, a2: any) => any

Parameters

NameType
fnF

Returns

F

Defined in

packages/utils/src/memoize.ts:15 (opens in a new tab)


memoize2of4

▸ memoize2of4<F>(fn): F

Type parameters

NameType
Fextends (a1: any, a2: any, a3: any, a4: any) => any

Parameters

NameType
fnF

Returns

F

Defined in

packages/utils/src/memoize.ts:181 (opens in a new tab)


memoize2of5

▸ memoize2of5<F>(fn): F

Type parameters

NameType
Fextends (a1: any, a2: any, a3: any, a4: any, a5: any) => any

Parameters

NameType
fnF

Returns

F

Defined in

packages/utils/src/memoize.ts:204 (opens in a new tab)


memoize3

▸ memoize3<F>(fn): F

Type parameters

NameType
Fextends (a1: any, a2: any, a3: any) => any

Parameters

NameType
fnF

Returns

F

Defined in

packages/utils/src/memoize.ts:38 (opens in a new tab)


memoize4

▸ memoize4<F>(fn): F

Type parameters

NameType
Fextends (a1: any, a2: any, a3: any, a4: any) => any

Parameters

NameType
fnF

Returns

F

Defined in

packages/utils/src/memoize.ts:72 (opens in a new tab)


memoize5

▸ memoize5<F>(fn): F

Type parameters

NameType
Fextends (a1: any, a2: any, a3: any, a4: any, a5: any) => any

Parameters

NameType
fnF

Returns

F

Defined in

packages/utils/src/memoize.ts:119 (opens in a new tab)


mergeDeep

▸ mergeDeep<S>(sources, respectPrototype?): UnboxIntersection<UnionToIntersection<BoxedTupleTypes<S>>> & any

Type parameters

NameType
Sextends any[]

Parameters

NameTypeDefault value
sourcesSundefined
respectPrototypebooleanfalse

Returns

UnboxIntersection<UnionToIntersection<BoxedTupleTypes<S>>> & any

Defined in

packages/utils/src/mergeDeep.ts:7 (opens in a new tab)


modifyObjectFields

▸ modifyObjectFields(schema, typeName, testFn, newFields): [GraphQLSchema, GraphQLFieldConfigMap<any, any>]

Parameters

NameType
schemaGraphQLSchema
typeNamestring
testFn(fieldName: string, field: GraphQLFieldConfig<any, any, any>) => boolean
newFieldsGraphQLFieldConfigMap<any, any>

Returns

[GraphQLSchema, GraphQLFieldConfigMap<any, any>]

Defined in

packages/utils/src/fields.ts:108 (opens in a new tab)


nodeToString

▸ nodeToString(a): string

Parameters

NameType
aASTNode

Returns

string

Defined in

packages/utils/src/helpers.ts:45 (opens in a new tab)


observableToAsyncIterable

▸ observableToAsyncIterable<T>(observable): AsyncIterableIterator<T>

Type parameters

Name
T

Parameters

NameType
observableObservable<T>

Returns

AsyncIterableIterator<T>

Defined in

packages/utils/src/observableToAsyncIterable.ts:15 (opens in a new tab)


parseGraphQLJSON

▸ parseGraphQLJSON(location, jsonContent, options): Source

Parameters

NameType
locationstring
jsonContentstring
optionsSchemaPrintOptions & ParseOptions

Returns

Source

Defined in

packages/utils/src/parse-graphql-json.ts:21 (opens in a new tab)


parseGraphQLSDL

▸ parseGraphQLSDL(location, rawSDL, options?): Object

Parameters

NameType
locationundefined | string
rawSDLstring
optionsGraphQLParseOptions

Returns

Object

NameType
documentDocumentNode
locationundefined | string

Defined in

packages/utils/src/parse-graphql-sdl.ts:15 (opens in a new tab)


parseInputValue

▸ parseInputValue(type, value): any

Parameters

NameType
typeGraphQLInputType
valueany

Returns

any

Defined in

packages/utils/src/transformInputValue.ts:54 (opens in a new tab)


parseInputValueLiteral

▸ parseInputValueLiteral(type, value): any

Parameters

NameType
typeGraphQLInputType
valueany

Returns

any

Defined in

packages/utils/src/transformInputValue.ts:64 (opens in a new tab)


parseSelectionSet

▸ parseSelectionSet(selectionSet, options?): SelectionSetNode

Parameters

NameType
selectionSetstring
options?GraphQLParseOptions

Returns

SelectionSetNode

Defined in

packages/utils/src/selectionSets.ts:4 (opens in a new tab)


pathToArray

▸ pathToArray(path): (string | number)[]

Given a Path, return an Array of the path keys.

Parameters

NameType
pathMaybe<Readonly<Path>>

Returns

(string | number)[]

Defined in

packages/utils/src/Path.ts:19 (opens in a new tab)


printComment

▸ printComment(comment): string

Parameters

NameType
commentstring

Returns

string

Defined in

packages/utils/src/comments.ts:89 (opens in a new tab)


printPathArray

▸ printPathArray(path): string

Build a string describing the path.

Parameters

NameType
pathreadonly (string | number)[]

Returns

string

Defined in

packages/utils/src/Path.ts:32 (opens in a new tab)


printSchemaWithDirectives

▸ printSchemaWithDirectives(schema, options?): string

Parameters

NameType
schemaGraphQLSchema
optionsPrintSchemaWithDirectivesOptions

Returns

string

Defined in

packages/utils/src/print-schema-with-directives.ts:113 (opens in a new tab)


printWithComments

▸ printWithComments(ast): string

Converts an AST into a string, using one set of reasonable formatting rules.

Parameters

NameType
astASTNode

Returns

string

Defined in

packages/utils/src/comments.ts:404 (opens in a new tab)


promiseReduce

▸ promiseReduce<T, U>(values, callbackFn, initialValue): MaybePromise<U>

Type parameters

Name
T
U

Parameters

NameType
valuesIterable<T>
callbackFn(accumulator: U, currentValue: T) => MaybePromise<U>
initialValueMaybePromise<U>

Returns

MaybePromise<U>

Defined in

packages/utils/src/jsutils.ts:15 (opens in a new tab)


pruneSchema

▸ pruneSchema(schema, options?): GraphQLSchema

Prunes the provided schema, removing unused and empty types

Parameters

NameTypeDescription
schemaGraphQLSchemaThe schema to prune
optionsPruneSchemaOptionsAdditional options for removing unused types from the schema

Returns

GraphQLSchema

Defined in

packages/utils/src/prune.ts:27 (opens in a new tab)


pushComment

▸ pushComment(node, entity, field?, argument?): void

Parameters

NameType
nodeany
entitystring
field?string
argument?string

Returns

void

Defined in

packages/utils/src/comments.ts:63 (opens in a new tab)


relocatedError

▸ relocatedError(originalError, path?): GraphQLError

Parameters

NameType
originalErrorGraphQLError
path?readonly (string | number)[]

Returns

GraphQLError

Defined in

packages/utils/src/errors.ts:32 (opens in a new tab)


removeObjectFields

▸ removeObjectFields(schema, typeName, testFn): [GraphQLSchema, GraphQLFieldConfigMap<any, any>]

Parameters

NameType
schemaGraphQLSchema
typeNamestring
testFn(fieldName: string, field: GraphQLFieldConfig<any, any, any>) => boolean

Returns

[GraphQLSchema, GraphQLFieldConfigMap<any, any>]

Defined in

packages/utils/src/fields.ts:46 (opens in a new tab)


renameType

▸ renameType(type, newTypeName): GraphQLObjectType

Parameters

NameType
typeGraphQLObjectType<any, any>
newTypeNamestring

Returns

GraphQLObjectType

Defined in

packages/utils/src/renameType.ts:17 (opens in a new tab)

▸ renameType(type, newTypeName): GraphQLInterfaceType

Parameters

NameType
typeGraphQLInterfaceType
newTypeNamestring

Returns

GraphQLInterfaceType

Defined in

packages/utils/src/renameType.ts:18 (opens in a new tab)

▸ renameType(type, newTypeName): GraphQLUnionType

Parameters

NameType
typeGraphQLUnionType
newTypeNamestring

Returns

GraphQLUnionType

Defined in

packages/utils/src/renameType.ts:19 (opens in a new tab)

▸ renameType(type, newTypeName): GraphQLEnumType

Parameters

NameType
typeGraphQLEnumType
newTypeNamestring

Returns

GraphQLEnumType

Defined in

packages/utils/src/renameType.ts:20 (opens in a new tab)

▸ renameType(type, newTypeName): GraphQLScalarType

Parameters

NameType
typeGraphQLScalarType<unknown, unknown>
newTypeNamestring

Returns

GraphQLScalarType

Defined in

packages/utils/src/renameType.ts:21 (opens in a new tab)

▸ renameType(type, newTypeName): GraphQLInputObjectType

Parameters

NameType
typeGraphQLInputObjectType
newTypeNamestring

Returns

GraphQLInputObjectType

Defined in

packages/utils/src/renameType.ts:22 (opens in a new tab)

▸ renameType(type, newTypeName): GraphQLNamedType

Parameters

NameType
typeGraphQLNamedType
newTypeNamestring

Returns

GraphQLNamedType

Defined in

packages/utils/src/renameType.ts:23 (opens in a new tab)


resetComments

▸ resetComments(): void

Returns

void

Defined in

packages/utils/src/comments.ts:24 (opens in a new tab)


rewireTypes

▸ rewireTypes(originalTypeMap, directives): Object

Parameters

NameType
originalTypeMapRecord<string, null | GraphQLNamedType>
directivesreadonly GraphQLDirective[]

Returns

Object

NameType
directivesGraphQLDirective[]
typeMapRecord<string, GraphQLNamedType>

Defined in

packages/utils/src/rewire.ts:31 (opens in a new tab)


selectObjectFields

▸ selectObjectFields(schema, typeName, testFn): GraphQLFieldConfigMap<any, any>

Parameters

NameType
schemaGraphQLSchema
typeNamestring
testFn(fieldName: string, field: GraphQLFieldConfig<any, any, any>) => boolean

Returns

GraphQLFieldConfigMap<any, any>

Defined in

packages/utils/src/fields.ts:81 (opens in a new tab)


serializeInputValue

▸ serializeInputValue(type, value): any

Parameters

NameType
typeGraphQLInputType
valueany

Returns

any

Defined in

packages/utils/src/transformInputValue.ts:44 (opens in a new tab)


shouldIncludeNode

▸ shouldIncludeNode(variableValues, node): boolean

Determines if a field should be included based on the @include and @skip directives, where @skip has higher precedence than @include.

Parameters

NameType
variableValuesany
nodeFieldNode | FragmentSpreadNode | InlineFragmentNode

Returns

boolean

Defined in

packages/utils/src/collectFields.ts:169 (opens in a new tab)


transformCommentsToDescriptions

▸ transformCommentsToDescriptions(sourceSdl, options?): DocumentNode

Parameters

NameType
sourceSdlstring
optionsGraphQLParseOptions

Returns

DocumentNode

Defined in

packages/utils/src/parse-graphql-sdl.ts:48 (opens in a new tab)


transformInputValue

▸ transformInputValue(type, value, inputLeafValueTransformer?, inputObjectValueTransformer?): any

Parameters

NameTypeDefault value
typeGraphQLInputTypeundefined
valueanyundefined
inputLeafValueTransformerMaybe<InputLeafValueTransformer>null
inputObjectValueTransformerMaybe<InputObjectValueTransformer>null

Returns

any

Defined in

packages/utils/src/transformInputValue.ts:6 (opens in a new tab)


updateArgument

▸ updateArgument(argumentNodes, variableDefinitionsMap, variableValues, argName, varName, type, value): void

Parameters

NameType
argumentNodesRecord<string, ArgumentNode>
variableDefinitionsMapRecord<string, VariableDefinitionNode>
variableValuesRecord<string, any>
argNamestring
varNamestring
typeGraphQLInputType
valueany

Returns

void

Defined in

packages/utils/src/updateArgument.ts:5 (opens in a new tab)


validateGraphQlDocuments

▸ validateGraphQlDocuments(schema, documents, rules?): readonly GraphQLError[]

Parameters

NameType
schemaGraphQLSchema
documentsDocumentNode[]
rulesValidationRule[]

Returns

readonly GraphQLError[]

Defined in

packages/utils/src/validate-documents.ts:15 (opens in a new tab)


valueMatchesCriteria

▸ valueMatchesCriteria(value, criteria): boolean

Parameters

NameType
valueany
criteriaany

Returns

boolean

Defined in

packages/utils/src/valueMatchesCriteria.ts:1 (opens in a new tab)


visitData

▸ visitData(data, enter?, leave?): any

Parameters

NameType
dataany
enter?ValueVisitor
leave?ValueVisitor

Returns

any

Defined in

packages/utils/src/visitResult.ts:55 (opens in a new tab)


visitErrors

▸ visitErrors(errors, visitor): GraphQLError[]

Parameters

NameType
errorsreadonly GraphQLError[]
visitor(error: GraphQLError) => GraphQLError

Returns

GraphQLError[]

Defined in

packages/utils/src/visitResult.ts:76 (opens in a new tab)


visitResult

▸ visitResult(result, request, schema, resultVisitorMap?, errorVisitorMap?): any

Parameters

NameType
resultExecutionResult<any, any>
requestExecutionRequest<any, any, any, Record<string, any>, any>
schemaGraphQLSchema
resultVisitorMap?ResultVisitorMap
errorVisitorMap?ErrorVisitorMap

Returns

any

Defined in

packages/utils/src/visitResult.ts:82 (opens in a new tab)