@graphql-tools/utils

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AbstractTypeMapper

Ƭ AbstractTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:492

Type declaration:

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

Parameters:

NameType
typeGraphQLInterfaceType | GraphQLUnionType
schemaGraphQLSchema

AbstractTypeVisitor

Ƭ AbstractTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:399

Type declaration:

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

Parameters:

NameType
typeGraphQLInterfaceType | GraphQLUnionType
schemaGraphQLSchema

ArgumentMapper

Ƭ ArgumentMapper: function

Defined in packages/utils/src/Interfaces.ts:518

Type declaration:

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

Parameters:

NameType
argumentConfigGraphQLArgumentConfig
fieldNamestring
typeNamestring
schemaGraphQLSchema

Callback

Ƭ Callback: function

Defined in packages/utils/src/observableToAsyncIterable.ts:15

Type declaration:

▸ (value?: any): any

Parameters:

NameType
value?any

CompositeTypeMapper

Ƭ CompositeTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:480

Type declaration:

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

Parameters:

NameType
typeGraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType
schemaGraphQLSchema

CompositeTypeVisitor

Ƭ CompositeTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:384

Type declaration:

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

Parameters:

NameType
typeGraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType
schemaGraphQLSchema

DirectiveArgs

Ƭ DirectiveArgs: object

Defined in packages/utils/src/get-fields-with-directives.ts:3

Type declaration:

  • [ name: string]: any

DirectiveMapper

Ƭ DirectiveMapper: function

Defined in packages/utils/src/Interfaces.ts:504

Type declaration:

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

Parameters:

NameType
directiveGraphQLDirective
schemaGraphQLSchema

DirectiveResolverFn

Ƭ DirectiveResolverFn: function

Defined in packages/utils/src/Interfaces.ts:304

Type declaration:

▸ (next: NextResolverFn, source: TSource, args: object, context: TContext, info: GraphQLResolveInfo): any

Parameters:

NameType
nextNextResolverFn
sourceTSource
argsobject
contextTContext
infoGraphQLResolveInfo

DirectiveUsage

Ƭ DirectiveUsage: object

Defined in packages/utils/src/get-fields-with-directives.ts:4

Type declaration:


DirectiveUseMap

Ƭ DirectiveUseMap: object

Defined in packages/utils/src/get-directives.ts:29

Type declaration:

  • [ key: string]: any

DocumentGlobPathPointer

Ƭ DocumentGlobPathPointer: string

Defined in packages/utils/src/loaders.ts:21


DocumentLoader

Ƭ DocumentLoader: LoaderDocumentPointerSingle, TOptions›

Defined in packages/utils/src/loaders.ts:38


DocumentPointer

Ƭ DocumentPointer: WithListDocumentGlobPathPointer

Defined in packages/utils/src/loaders.ts:22


DocumentPointerSingle

Ƭ DocumentPointerSingle: ElementOfDocumentPointer

Defined in packages/utils/src/loaders.ts:23


ElementOf

Ƭ ElementOf: TList extends Array<infer TElement> ? TElement : never

Defined in packages/utils/src/loaders.ts:18


EnumTypeMapper

Ƭ EnumTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:471

Type declaration:

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

Parameters:

NameType
typeGraphQLEnumType
schemaGraphQLSchema

EnumTypeVisitor

Ƭ EnumTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:382

Type declaration:

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

Parameters:

NameType
typeGraphQLEnumType
schemaGraphQLSchema

EnumValueMapper

Ƭ EnumValueMapper: function

Defined in packages/utils/src/Interfaces.ts:473

Type declaration:

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

Parameters:

NameType
valueConfigGraphQLEnumValueConfig
typeNamestring
schemaGraphQLSchema
externalValuestring

ErrorVisitor

Ƭ ErrorVisitor: function

Defined in packages/utils/src/visitResult.ts:29

Type declaration:

▸ (error: GraphQLError, pathIndex: number): GraphQLError

Parameters:

NameType
errorGraphQLError
pathIndexnumber

ErrorVisitorMap

Ƭ ErrorVisitorMap: Record‹string, Record‹string, ErrorVisitor››

Defined in packages/utils/src/visitResult.ts:31


FieldFilter

Ƭ FieldFilter: function

Defined in packages/utils/src/Interfaces.ts:213

Type declaration:

▸ (typeName?: string, fieldName?: string, fieldConfig?: GraphQLFieldConfig‹any, any›): boolean

Parameters:

NameType
typeName?string
fieldName?string
fieldConfig?GraphQLFieldConfig‹any, any›

FieldMapper

Ƭ FieldMapper: GenericFieldMapper‹GraphQLFieldConfig‹any, any››

Defined in packages/utils/src/Interfaces.ts:516


FieldNodeMapper

Ƭ FieldNodeMapper: function

Defined in packages/utils/src/Interfaces.ts:199

Type declaration:

▸ (fieldNode: FieldNode, fragments: Record‹string, FragmentDefinitionNode›, transformationContext: Record‹string, any›): SelectionNode | Array‹SelectionNode›

Parameters:

NameType
fieldNodeFieldNode
fragmentsRecord‹string, FragmentDefinitionNode›
transformationContextRecord‹string, any›

FieldNodeMappers

Ƭ FieldNodeMappers: Record‹string, Record‹string, FieldNodeMapper››

Defined in packages/utils/src/Interfaces.ts:205


Force

Ƭ Force: string[]

Defined in packages/utils/src/build-operation-for-field.ts:52


GenericFieldMapper

Ƭ GenericFieldMapper: function

Defined in packages/utils/src/Interfaces.ts:509

Type declaration:

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

Parameters:

NameType
fieldConfigF
fieldNamestring
typeNamestring
schemaGraphQLSchema

IDefaultValueIteratorFn

Ƭ IDefaultValueIteratorFn: function

Defined in packages/utils/src/Interfaces.ts:300

Type declaration:

▸ (type: GraphQLInputType, value: any): void

Parameters:

NameType
typeGraphQLInputType
valueany

IEnumTypeResolver

Ƭ IEnumTypeResolver: Record‹string, any› & object

Defined in packages/utils/src/Interfaces.ts:160


IFieldIteratorFn

Ƭ IFieldIteratorFn: function

Defined in packages/utils/src/Interfaces.ts:298

Type declaration:

▸ (fieldDef: GraphQLField‹any, any›, typeName: string, fieldName: string): void

Parameters:

NameType
fieldDefGraphQLField‹any, any›
typeNamestring
fieldNamestring

IFieldResolver

Ƭ IFieldResolver: function

Defined in packages/utils/src/Interfaces.ts:230

Type declaration:

▸ (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo): TReturn

Parameters:

NameType
sourceTSource
argsTArgs
contextTContext
infoGraphQLResolveInfo

IInputObjectTypeResolver

Ƭ IInputObjectTypeResolver: object

Defined in packages/utils/src/Interfaces.ts:272

Type declaration:

  • __astNode? : InputObjectTypeDefinitionNode

  • __description? : string

  • __extensionASTNodes? : Array‹InputObjectTypeExtensionNode›

  • __extensions? : Record‹string, any›

  • __name? : string


IInterfaceTypeResolver

Ƭ IInterfaceTypeResolver: object & object

Defined in packages/utils/src/Interfaces.ts:252


IObjectTypeResolver

Ƭ IObjectTypeResolver: object & object

Defined in packages/utils/src/Interfaces.ts:241


IResolvers

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

Defined in packages/utils/src/Interfaces.ts:287


IScalarTypeResolver

Ƭ IScalarTypeResolver: GraphQLScalarType & object

Defined in packages/utils/src/Interfaces.ts:149


ISchemaLevelResolver

Ƭ ISchemaLevelResolver: IFieldResolver‹TSource, TContext, TArgs, TReturn›

Defined in packages/utils/src/Interfaces.ts:280


ITypeDefinitions

Ƭ ITypeDefinitions: ITypedef | Array‹ITypedef

Defined in packages/utils/src/Interfaces.ts:239


ITypedef

Ƭ ITypedef: function | string | DocumentNode

Defined in packages/utils/src/Interfaces.ts:237


IUnionTypeResolver

Ƭ IUnionTypeResolver: object

Defined in packages/utils/src/Interfaces.ts:263

Type declaration:

  • __astNode? : UnionTypeDefinitionNode

  • __description? : string

  • __extensionASTNodes? : Array‹UnionTypeExtensionNode›

  • __extensions? : Record‹string, any›

  • __name? : string

  • __resolveType? : GraphQLTypeResolver‹any, any›


Ignore

Ƭ Ignore: string[]

Defined in packages/utils/src/build-operation-for-field.ts:53


InputFieldFilter

Ƭ InputFieldFilter: function

Defined in packages/utils/src/Interfaces.ts:207

Type declaration:

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

Parameters:

NameType
typeName?string
fieldName?string
inputFieldConfig?GraphQLInputFieldConfig

InputFieldMapper

Ƭ InputFieldMapper: GenericFieldMapper‹GraphQLInputFieldConfig›

Defined in packages/utils/src/Interfaces.ts:525


InputObjectTypeMapper

Ƭ InputObjectTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:487

Type declaration:

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

Parameters:

NameType
typeGraphQLInputObjectType
schemaGraphQLSchema

InputObjectTypeVisitor

Ƭ InputObjectTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:394

Type declaration:

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

Parameters:

NameType
typeGraphQLInputObjectType
schemaGraphQLSchema

InterfaceTypeMapper

Ƭ InterfaceTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:499

Type declaration:

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

Parameters:

NameType
typeGraphQLInterfaceType
schemaGraphQLSchema

InterfaceTypeVisitor

Ƭ InterfaceTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:406

Type declaration:

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

Parameters:

NameType
typeGraphQLInterfaceType
schemaGraphQLSchema

Maybe

Ƭ Maybe: null | undefined | T

Defined in packages/utils/src/types.ts:13


NamedTypeMapper

Ƭ NamedTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:467

Type declaration:

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

Parameters:

NameType
typeGraphQLNamedType
schemaGraphQLSchema

NamedTypeVisitor

Ƭ NamedTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:375

Type declaration:

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

Parameters:

NameType
typeGraphQLNamedType
schemaGraphQLSchema

NextResolverFn

Ƭ NextResolverFn: function

Defined in packages/utils/src/Interfaces.ts:302

Type declaration:

▸ (): Promise‹any›


ObjectTypeMapper

Ƭ ObjectTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:485

Type declaration:

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

Parameters:

NameType
typeGraphQLObjectType
schemaGraphQLSchema

ObjectTypeVisitor

Ƭ ObjectTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:389

Type declaration:

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

Parameters:

NameType
typeGraphQLObjectType
schemaGraphQLSchema

ObjectValueVisitor

Ƭ ObjectValueVisitor: object & Record‹string, ValueVisitor

Defined in packages/utils/src/visitResult.ts:22


Operation

Ƭ Operation: "query" | "mutation" | "subscription"

Defined in packages/utils/src/Interfaces.ts:316


RenameTypesOptions

Ƭ RenameTypesOptions: object

Defined in packages/utils/src/Interfaces.ts:225

Type declaration:

  • renameBuiltins: boolean

  • renameScalars: boolean


RequestTransform

Ƭ RequestTransform: function

Defined in packages/utils/src/Interfaces.ts:182

Type declaration:

▸ (originalRequest: Request, delegationContext?: Record‹string, any›, transformationContext?: T): Request

Parameters:

NameType
originalRequestRequest
delegationContext?Record‹string, any›
transformationContext?T

Result

Ƭ Result: ExecutionResult

Defined in packages/utils/src/Interfaces.ts:61


ResultTransform

Ƭ ResultTransform: function

Defined in packages/utils/src/Interfaces.ts:187

Type declaration:

▸ (originalResult: ExecutionResult, delegationContext?: Record‹string, any›, transformationContext?: T): ExecutionResult

Parameters:

NameType
originalResultExecutionResult
delegationContext?Record‹string, any›
transformationContext?T

ResultVisitorMap

Ƭ ResultVisitorMap: Record‹string, ValueVisitor | ObjectValueVisitor

Defined in packages/utils/src/visitResult.ts:27


RootFieldFilter

Ƭ RootFieldFilter: function

Defined in packages/utils/src/Interfaces.ts:219

Type declaration:

▸ (operation?: "Query" | "Mutation" | "Subscription", rootFieldName?: string, fieldConfig?: GraphQLFieldConfig‹any, any›): boolean

Parameters:

NameType
operation?"Query" | "Mutation" | "Subscription"
rootFieldName?string
fieldConfig?GraphQLFieldConfig‹any, any›

ScalarTypeMapper

Ƭ ScalarTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:469

Type declaration:

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

Parameters:

NameType
typeGraphQLScalarType
schemaGraphQLSchema

ScalarTypeVisitor

Ƭ ScalarTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:377

Type declaration:

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

Parameters:

NameType
typeGraphQLScalarType
schemaGraphQLSchema

SchemaDirectiveVisitorClass

Ƭ SchemaDirectiveVisitorClass: typeof SchemaDirectiveVisitor

Defined in packages/utils/src/SchemaDirectiveVisitor.ts:291


SchemaLoader

Ƭ SchemaLoader: LoaderSchemaPointerSingle, TOptions›

Defined in packages/utils/src/loaders.ts:33


SchemaPointer

Ƭ SchemaPointer: WithList‹string›

Defined in packages/utils/src/loaders.ts:19


SchemaPointerSingle

Ƭ SchemaPointerSingle: ElementOfSchemaPointer

Defined in packages/utils/src/loaders.ts:20


SchemaTransform

Ƭ SchemaTransform: function

Defined in packages/utils/src/Interfaces.ts:181

Type declaration:

▸ (originalSchema: GraphQLSchema): GraphQLSchema

Parameters:

NameType
originalSchemaGraphQLSchema

SelectedFields

Ƭ SelectedFields: object | boolean

Defined in packages/utils/src/build-operation-for-field.ts:55


SingleFileOptions

Ƭ SingleFileOptions: ParseOptions & GraphQLSchemaValidationOptions & BuildSchemaOptions & object

Defined in packages/utils/src/loaders.ts:11


Skip

Ƭ Skip: string[]

Defined in packages/utils/src/build-operation-for-field.ts:51


TypeAndFieldToDirectives

Ƭ TypeAndFieldToDirectives: object

Defined in packages/utils/src/get-fields-with-directives.ts:5

Type declaration:


TypeMap

Ƭ TypeMap: Record‹string, GraphQLNamedType›

Defined in packages/utils/src/Interfaces.ts:65


UnionTypeMapper

Ƭ UnionTypeMapper: function

Defined in packages/utils/src/Interfaces.ts:497

Type declaration:

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

Parameters:

NameType
typeGraphQLUnionType
schemaGraphQLSchema

UnionTypeVisitor

Ƭ UnionTypeVisitor: function

Defined in packages/utils/src/Interfaces.ts:404

Type declaration:

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

Parameters:

NameType
typeGraphQLUnionType
schemaGraphQLSchema

UniversalLoader

Ƭ UniversalLoader: LoaderSchemaPointerSingle | DocumentPointerSingle, TOptions›

Defined in packages/utils/src/loaders.ts:43


ValidationRule

Ƭ ValidationRule: function

Defined in packages/utils/src/validate-documents.ts:14

Type declaration:

▸ (context: ValidationContext): ASTVisitor

Parameters:

NameType
contextValidationContext

ValueVisitor

Ƭ ValueVisitor: function

Defined in packages/utils/src/visitResult.ts:20

Type declaration:

▸ (value: any): any

Parameters:

NameType
valueany

VisitableSchemaType

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

Defined in packages/utils/src/Interfaces.ts:324


VisitorSelector

Ƭ VisitorSelector: function

Defined in packages/utils/src/Interfaces.ts:338

Type declaration:

▸ (type: VisitableSchemaType, methodName: string): Array‹SchemaVisitor | SchemaVisitorMap

Parameters:

NameType
typeVisitableSchemaType
methodNamestring

WithList

Ƭ WithList: T | T[]

Defined in packages/utils/src/loaders.ts:17

Variables

Const ERROR_SYMBOL

ERROR_SYMBOL: unique symbol = Symbol('subschemaErrors')

Defined in packages/utils/src/errors.ts:3

Functions

addTypes

addTypes(schema: GraphQLSchema, newTypesOrDirectives: Array‹GraphQLNamedType | GraphQLDirective›): GraphQLSchema

Defined in packages/utils/src/addTypes.ts:39

Parameters:

NameType
schemaGraphQLSchema
newTypesOrDirectivesArray‹GraphQLNamedType | GraphQLDirective›

Returns: GraphQLSchema


appendObjectFields

appendObjectFields(schema: GraphQLSchema, typeName: string, additionalFields: GraphQLFieldConfigMap‹any, any›): GraphQLSchema

Defined in packages/utils/src/fields.ts:6

Parameters:

NameType
schemaGraphQLSchema
typeNamestring
additionalFieldsGraphQLFieldConfigMap‹any, any›

Returns: GraphQLSchema


applyRequestTransforms

applyRequestTransforms(originalRequest: Request, transforms: Array‹Transform›): Request

Defined in packages/utils/src/transforms.ts:15

Parameters:

NameType
originalRequestRequest
transformsArray‹Transform

Returns: Request


applyResultTransforms

applyResultTransforms(originalResult: any, transforms: Array‹Transform›): any

Defined in packages/utils/src/transforms.ts:24

Parameters:

NameType
originalResultany
transformsArray‹Transform

Returns: any


applySchemaTransforms

applySchemaTransforms(originalSchema: GraphQLSchema, transforms: Array‹Transform›): GraphQLSchema

Defined in packages/utils/src/transforms.ts:7

Parameters:

NameType
originalSchemaGraphQLSchema
transformsArray‹Transform

Returns: GraphQLSchema


argsToFieldConfigArgumentMap

argsToFieldConfigArgumentMap(args: ReadonlyArray‹GraphQLArgument›): GraphQLFieldConfigArgumentMap

Defined in packages/utils/src/toConfig.ts:34

Parameters:

NameType
argsReadonlyArray‹GraphQLArgument›

Returns: GraphQLFieldConfigArgumentMap


argumentToArgumentConfig

argumentToArgumentConfig(arg: GraphQLArgument): GraphQLArgumentConfig

Defined in packages/utils/src/toConfig.ts:43

Parameters:

NameType
argGraphQLArgument

Returns: GraphQLArgumentConfig


Const asArray

asArrayT›(fns: T | T[]): T[]

Defined in packages/utils/src/helpers.ts:3

Type parameters:

T

Parameters:

NameType
fnsT | T[]

Returns: T[]


buildOperationNodeForField

buildOperationNodeForField(__namedParameters: object): OperationDefinitionNode

Defined in packages/utils/src/build-operation-for-field.ts:61

Parameters:

__namedParameters: object

NameTypeDefault
argNamesstring[]-
circularReferenceDepthnumber-
depthLimitnumber-
fieldstring-
ignorestring[]-
kind"query" | "mutation" | "subscription"-
modelsstring[]-
schemaGraphQLSchema‹›-
selectedFieldsfalse | true | objecttrue

Returns: OperationDefinitionNode


checkValidationErrors

checkValidationErrors(loadDocumentErrors: ReadonlyArray‹LoadDocumentError›): void | never

Defined in packages/utils/src/validate-documents.ts:75

Parameters:

NameType
loadDocumentErrorsReadonlyArray‹LoadDocumentError

Returns: void | never


cloneDirective

cloneDirective(directive: GraphQLDirective): GraphQLDirective

Defined in packages/utils/src/clone.ts:23

Parameters:

NameType
directiveGraphQLDirective

Returns: GraphQLDirective


cloneSchema

cloneSchema(schema: GraphQLSchema): GraphQLSchema

Defined in packages/utils/src/clone.ts:58

Parameters:

NameType
schemaGraphQLSchema

Returns: GraphQLSchema


cloneType

cloneType(type: GraphQLNamedType): GraphQLNamedType

Defined in packages/utils/src/clone.ts:27

Parameters:

NameType
typeGraphQLNamedType

Returns: GraphQLNamedType


compareNodes

compareNodes(a: ASTNode, b: ASTNode, customFn?: function): number

Defined in packages/utils/src/helpers.ts:74

Parameters:

a: ASTNode

b: ASTNode

Optional customFn: function

▸ (a: any, b: any): number

Parameters:

NameType
aany
bany

Returns: number


compareStrings

compareStringsA, B›(a: A, b: B): 0 | 1 | -1

Defined in packages/utils/src/helpers.ts:50

Type parameters:

A

B

Parameters:

NameType
aA
bB

Returns: 0 | 1 | -1


concatInlineFragments

concatInlineFragments(type: string, fragments: Array‹InlineFragmentNode›): InlineFragmentNode

Defined in packages/utils/src/fragments.ts:3

Parameters:

NameType
typestring
fragmentsArray‹InlineFragmentNode›

Returns: InlineFragmentNode


correctASTNodes

correctASTNodes(type: GraphQLObjectType): GraphQLObjectType

Defined in packages/utils/src/mapSchema.ts:497

Parameters:

NameType
typeGraphQLObjectType

Returns: GraphQLObjectType

correctASTNodes(type: GraphQLInterfaceType): GraphQLInterfaceType

Defined in packages/utils/src/mapSchema.ts:498

Parameters:

NameType
typeGraphQLInterfaceType

Returns: GraphQLInterfaceType

correctASTNodes(type: GraphQLInputObjectType): GraphQLInputObjectType

Defined in packages/utils/src/mapSchema.ts:499

Parameters:

NameType
typeGraphQLInputObjectType

Returns: GraphQLInputObjectType

correctASTNodes(type: GraphQLEnumType): GraphQLEnumType

Defined in packages/utils/src/mapSchema.ts:500

Parameters:

NameType
typeGraphQLEnumType

Returns: GraphQLEnumType


createNamedStub

createNamedStub(name: string, type: "object"): GraphQLObjectType

Defined in packages/utils/src/stub.ts:23

Parameters:

NameType
namestring
type"object"

Returns: GraphQLObjectType

createNamedStub(name: string, type: "interface"): GraphQLInterfaceType

Defined in packages/utils/src/stub.ts:24

Parameters:

NameType
namestring
type"interface"

Returns: GraphQLInterfaceType

createNamedStub(name: string, type: "input"): GraphQLInputObjectType

Defined in packages/utils/src/stub.ts:25

Parameters:

NameType
namestring
type"input"

Returns: GraphQLInputObjectType


createSchemaDefinition

createSchemaDefinition(def: object, config?: object): string

Defined in packages/utils/src/create-schema-definition.ts:3

Parameters:

def: object

NameType
mutationstring | GraphQLObjectType | null
querystring | GraphQLObjectType | null
subscriptionstring | GraphQLObjectType | null

Optional config: object

NameType
force?boolean

Returns: string


createStub

createStub(node: TypeNode, type: "output"): GraphQLOutputType

Defined in packages/utils/src/stub.ts:49

Parameters:

NameType
nodeTypeNode
type"output"

Returns: GraphQLOutputType

createStub(node: TypeNode, type: "input"): GraphQLInputType

Defined in packages/utils/src/stub.ts:50

Parameters:

NameType
nodeTypeNode
type"input"

Returns: GraphQLInputType

createStub(node: TypeNode, type: "output" | "input"): GraphQLType

Defined in packages/utils/src/stub.ts:51

Parameters:

NameType
nodeTypeNode
type"output" | "input"

Returns: GraphQLType


debugLog

debugLog(...args: any[]): void

Defined in packages/utils/src/debug-log.ts:1

Parameters:

NameType
...argsany[]

Returns: void


fieldToFieldConfig

fieldToFieldConfig(field: GraphQLField‹any, any›): GraphQLFieldConfig‹any, any›

Defined in packages/utils/src/toConfig.ts:21

Parameters:

NameType
fieldGraphQLField‹any, any›

Returns: GraphQLFieldConfig‹any, any›


filterSchema

filterSchema(__namedParameters: object): GraphQLSchema

Defined in packages/utils/src/filterSchema.ts:16

Parameters:

__namedParameters: object

NameType
schemaGraphQLSchema‹›
fieldFilter
rootFieldFilter
typeFilter

Returns: GraphQLSchema


fixSchemaAst

fixSchemaAst(schema: GraphQLSchema, options: BuildSchemaOptions & SchemaPrintOptions): GraphQLSchema‹›

Defined in packages/utils/src/fix-schema-ast.ts:12

Parameters:

NameType
schemaGraphQLSchema
optionsBuildSchemaOptions & SchemaPrintOptions

Returns: GraphQLSchema‹›


Const fixWindowsPath

fixWindowsPath(path: string): string

Defined in packages/utils/src/fix-windows-path.ts:1

Parameters:

NameType
pathstring

Returns: string


Const flattenArray

flattenArray(arr: any): any[]

Defined in packages/utils/src/flatten-array.ts:1

Parameters:

NameType
arrany

Returns: any[]


forEachDefaultValue

forEachDefaultValue(schema: GraphQLSchema, fn: IDefaultValueIteratorFn): void

Defined in packages/utils/src/forEachDefaultValue.ts:5

Parameters:

NameType
schemaGraphQLSchema
fnIDefaultValueIteratorFn

Returns: void


forEachField

forEachField(schema: GraphQLSchema, fn: IFieldIteratorFn): void

Defined in packages/utils/src/forEachField.ts:5

Parameters:

NameType
schemaGraphQLSchema
fnIFieldIteratorFn

Returns: void


getBuiltInForStub

getBuiltInForStub(type: GraphQLNamedType): GraphQLNamedType

Defined in packages/utils/src/stub.ts:76

Parameters:

NameType
typeGraphQLNamedType

Returns: GraphQLNamedType


getDirectives

getDirectives(schema: GraphQLSchema, node: DirectableGraphQLObject): DirectiveUseMap

Defined in packages/utils/src/get-directives.ts:57

Parameters:

NameType
schemaGraphQLSchema
nodeDirectableGraphQLObject

Returns: DirectiveUseMap


getErrors

getErrors(result: any, pathSegment: string): Array‹GraphQLError›

Defined in packages/utils/src/errors.ts:42

Parameters:

NameType
resultany
pathSegmentstring

Returns: Array‹GraphQLError›


getErrorsByPathSegment

getErrorsByPathSegment(errors: ReadonlyArray‹GraphQLError›): Record‹string, Array‹GraphQLError››

Defined in packages/utils/src/errors.ts:21

Parameters:

NameType
errorsReadonlyArray‹GraphQLError›

Returns: Record‹string, Array‹GraphQLError››


getFieldsWithDirectives

getFieldsWithDirectives(documentNode: DocumentNode): TypeAndFieldToDirectives

Defined in packages/utils/src/get-fields-with-directives.ts:35

Parameters:

NameType
documentNodeDocumentNode

Returns: TypeAndFieldToDirectives


getImplementingTypes

getImplementingTypes(interfaceName: string, schema: GraphQLSchema): string[]

Defined in packages/utils/src/get-implementing-types.ts:3

Parameters:

NameType
interfaceNamestring
schemaGraphQLSchema

Returns: string[]


getResolversFromSchema

getResolversFromSchema(schema: GraphQLSchema): IResolvers

Defined in packages/utils/src/getResolversFromSchema.ts:15

Parameters:

NameType
schemaGraphQLSchema

Returns: IResolvers


getResponseKeyFromInfo

getResponseKeyFromInfo(info: GraphQLResolveInfo): string

Defined in packages/utils/src/getResponseKeyFromInfo.ts:8

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


getUserTypesFromSchema

getUserTypesFromSchema(schema: GraphQLSchema): GraphQLObjectType[]

Defined in packages/utils/src/get-user-types-from-schema.ts:11

Get all GraphQL types from schema without:

  • Query, Mutation, Subscription objects
  • Internal scalars added by parser

Parameters:

NameTypeDescription
schemaGraphQLSchema

Returns: GraphQLObjectType[]


healSchema

healSchema(schema: GraphQLSchema): GraphQLSchema

Defined in packages/utils/src/heal.ts:54

Parameters:

NameType
schemaGraphQLSchema

Returns: GraphQLSchema


healTypes

healTypes(originalTypeMap: Record‹string, GraphQLNamedType | null›, directives: ReadonlyArray‹GraphQLDirective›, config: object): void

Defined in packages/utils/src/heal.ts:59

Parameters:

originalTypeMap: Record‹string, GraphQLNamedType | null›

directives: ReadonlyArray‹GraphQLDirective›

Default value config: object= { skipPruning: false, }

NameType
skipPruningboolean

Returns: void


hoistFieldNodes

hoistFieldNodes(__namedParameters: object): Array‹FieldNode›

Defined in packages/utils/src/fieldNodes.ts:79

Parameters:

__namedParameters: object

NameTypeDefault
delimeterstring"gqltf"
fieldNamesstring[]-
fieldNodeFieldNode-
fragmentsobject-
pathstring[][]

Returns: Array‹FieldNode›


implementsAbstractType

implementsAbstractType(schema: GraphQLSchema, typeA: GraphQLType, typeB: GraphQLType): boolean

Defined in packages/utils/src/implementsAbstractType.ts:3

Parameters:

NameType
schemaGraphQLSchema
typeAGraphQLType
typeBGraphQLType

Returns: boolean


inputFieldToFieldConfig

inputFieldToFieldConfig(field: GraphQLInputField): GraphQLInputFieldConfig

Defined in packages/utils/src/toConfig.ts:11

Parameters:

NameType
fieldGraphQLInputField

Returns: GraphQLInputFieldConfig


isDocumentString

isDocumentString(str: string): boolean

Defined in packages/utils/src/helpers.ts:27

Parameters:

NameType
strstring

Returns: boolean


isEqual

isEqualT›(a: T, b: T): boolean

Defined in packages/utils/src/helpers.ts:5

Type parameters:

T

Parameters:

NameType
aT
bT

Returns: boolean


isNamedStub

isNamedStub(type: GraphQLNamedType): boolean

Defined in packages/utils/src/stub.ts:66

Parameters:

NameType
typeGraphQLNamedType

Returns: boolean


isNotEqual

isNotEqualT›(a: T, b: T): boolean

Defined in packages/utils/src/helpers.ts:23

Type parameters:

T

Parameters:

NameType
aT
bT

Returns: boolean


isValidPath

isValidPath(str: string): boolean

Defined in packages/utils/src/helpers.ts:46

Parameters:

NameType
strstring

Returns: boolean


mapAsyncIterator

mapAsyncIteratorT, U›(iterator: AsyncIterator‹T›, callback: function, rejectCallback?: any): AsyncIterator‹U›

Defined in packages/utils/src/mapAsyncIterator.ts:5

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

Type parameters:

T

U

Parameters:

iterator: AsyncIterator‹T›

callback: function

▸ (value: T): Promise‹U› | U

Parameters:

NameType
valueT

Optional rejectCallback: any

Returns: AsyncIterator‹U›


mapSchema

mapSchema(schema: GraphQLSchema, schemaMapper: SchemaMapper): GraphQLSchema

Defined in packages/utils/src/mapSchema.ts:48

Parameters:

NameTypeDefault
schemaGraphQLSchema-
schemaMapperSchemaMapper{}

Returns: GraphQLSchema


mergeDeep

mergeDeep(target: any, ...sources: any[]): any

Defined in packages/utils/src/mergeDeep.ts:4

Parameters:

NameType
targetany
...sourcesany[]

Returns: any


modifyObjectFields

modifyObjectFields(schema: GraphQLSchema, typeName: string, testFn: function, newFields: GraphQLFieldConfigMap‹any, any›): [GraphQLSchema, GraphQLFieldConfigMap‹any, any›]

Defined in packages/utils/src/fields.ts:107

Parameters:

schema: GraphQLSchema

typeName: string

testFn: function

▸ (fieldName: string, field: GraphQLFieldConfig‹any, any›): boolean

Parameters:

NameType
fieldNamestring
fieldGraphQLFieldConfig‹any, any›

newFields: GraphQLFieldConfigMap‹any, any›

Returns: [GraphQLSchema, GraphQLFieldConfigMap‹any, any›]


nodeToString

nodeToString(a: ASTNode): string

Defined in packages/utils/src/helpers.ts:62

Parameters:

NameType
aASTNode

Returns: string


observableToAsyncIterable

observableToAsyncIterableT›(observable: Observable‹T›): AsyncIterator‹T› & object

Defined in packages/utils/src/observableToAsyncIterable.ts:17

Type parameters:

T

Parameters:

NameType
observableObservable‹T›

Returns: AsyncIterator‹T› & object


parseFragmentToInlineFragment

parseFragmentToInlineFragment(definitions: string): InlineFragmentNode

Defined in packages/utils/src/fragments.ts:90

Parameters:

NameType
definitionsstring

Returns: InlineFragmentNode


parseGraphQLJSON

parseGraphQLJSON(location: string, jsonContent: string, options: SchemaPrintOptions & ParseOptions & GraphQLSchemaValidationOptions): Source

Defined in packages/utils/src/parse-graphql-json.ts:23

Parameters:

NameType
locationstring
jsonContentstring
optionsSchemaPrintOptions & ParseOptions & GraphQLSchemaValidationOptions

Returns: Source


parseGraphQLSDL

parseGraphQLSDL(location: string, rawSDL: string, options: ParseOptions): object

Defined in packages/utils/src/parse-graphql-sdl.ts:3

Parameters:

NameType
locationstring
rawSDLstring
optionsParseOptions

Returns: object

  • document: DocumentNode

  • location: string

  • rawSDL: string


parseInputValue

parseInputValue(type: GraphQLInputType, value: any): any

Defined in packages/utils/src/transformInputValue.ts:40

Parameters:

NameType
typeGraphQLInputType
valueany

Returns: any


parseInputValueLiteral

parseInputValueLiteral(type: GraphQLInputType, value: any): any

Defined in packages/utils/src/transformInputValue.ts:44

Parameters:

NameType
typeGraphQLInputType
valueany

Returns: any


parseSelectionSet

parseSelectionSet(selectionSet: string): SelectionSetNode

Defined in packages/utils/src/selectionSets.ts:3

Parameters:

NameType
selectionSetstring

Returns: SelectionSetNode


preAliasFieldNode

preAliasFieldNode(fieldNode: FieldNode, str: string): FieldNode

Defined in packages/utils/src/fieldNodes.ts:17

Parameters:

NameType
fieldNodeFieldNode
strstring

Returns: FieldNode


printSchemaWithDirectives

printSchemaWithDirectives(schema: GraphQLSchema, _options: SchemaPrintOptions): string

Defined in packages/utils/src/print-schema-with-directives.ts:21

Parameters:

NameTypeDefault
schemaGraphQLSchema-
_optionsSchemaPrintOptions{}

Returns: string


pruneSchema

pruneSchema(schema: GraphQLSchema, options: PruneSchemaOptions): GraphQLSchema

Defined in packages/utils/src/prune.ts:62

Prunes the provided schema, removing unused and empty types

Parameters:

NameTypeDefaultDescription
schemaGraphQLSchema-The schema to prune
optionsPruneSchemaOptions{}Additional options for removing unused types from the schema

Returns: GraphQLSchema


relocatedError

relocatedError(originalError: GraphQLError, path?: ReadonlyArray‹string | number›): GraphQLError

Defined in packages/utils/src/errors.ts:5

Parameters:

NameType
originalErrorGraphQLError
path?ReadonlyArray‹string | number›

Returns: GraphQLError


removeObjectFields

removeObjectFields(schema: GraphQLSchema, typeName: string, testFn: function): [GraphQLSchema, GraphQLFieldConfigMap‹any, any›]

Defined in packages/utils/src/fields.ts:45

Parameters:

schema: GraphQLSchema

typeName: string

testFn: function

▸ (fieldName: string, field: GraphQLFieldConfig‹any, any›): boolean

Parameters:

NameType
fieldNamestring
fieldGraphQLFieldConfig‹any, any›

Returns: [GraphQLSchema, GraphQLFieldConfigMap‹any, any›]


renameFieldNode

renameFieldNode(fieldNode: FieldNode, name: string): FieldNode

Defined in packages/utils/src/fieldNodes.ts:3

Parameters:

NameType
fieldNodeFieldNode
namestring

Returns: FieldNode


renameType

renameType(type: GraphQLObjectType, newTypeName: string): GraphQLObjectType

Defined in packages/utils/src/renameType.ts:17

Parameters:

NameType
typeGraphQLObjectType
newTypeNamestring

Returns: GraphQLObjectType

renameType(type: GraphQLInterfaceType, newTypeName: string): GraphQLInterfaceType

Defined in packages/utils/src/renameType.ts:18

Parameters:

NameType
typeGraphQLInterfaceType
newTypeNamestring

Returns: GraphQLInterfaceType

renameType(type: GraphQLUnionType, newTypeName: string): GraphQLUnionType

Defined in packages/utils/src/renameType.ts:19

Parameters:

NameType
typeGraphQLUnionType
newTypeNamestring

Returns: GraphQLUnionType

renameType(type: GraphQLEnumType, newTypeName: string): GraphQLEnumType

Defined in packages/utils/src/renameType.ts:20

Parameters:

NameType
typeGraphQLEnumType
newTypeNamestring

Returns: GraphQLEnumType

renameType(type: GraphQLScalarType, newTypeName: string): GraphQLScalarType

Defined in packages/utils/src/renameType.ts:21

Parameters:

NameType
typeGraphQLScalarType
newTypeNamestring

Returns: GraphQLScalarType

renameType(type: GraphQLInputObjectType, newTypeName: string): GraphQLInputObjectType

Defined in packages/utils/src/renameType.ts:22

Parameters:

NameType
typeGraphQLInputObjectType
newTypeNamestring

Returns: GraphQLInputObjectType

renameType(type: GraphQLNamedType, newTypeName: string): GraphQLNamedType

Defined in packages/utils/src/renameType.ts:23

Parameters:

NameType
typeGraphQLNamedType
newTypeNamestring

Returns: GraphQLNamedType


rewireTypes

rewireTypes(originalTypeMap: Record‹string, GraphQLNamedType | null›, directives: ReadonlyArray‹GraphQLDirective›, options: object): object

Defined in packages/utils/src/rewire.ts:32

Parameters:

originalTypeMap: Record‹string, GraphQLNamedType | null›

directives: ReadonlyArray‹GraphQLDirective›

Default value options: object= { skipPruning: false, }

NameType
skipPruningboolean

Returns: object

  • directives: Array‹GraphQLDirective›

  • typeMap: TypeMap


selectObjectFields

selectObjectFields(schema: GraphQLSchema, typeName: string, testFn: function): GraphQLFieldConfigMap‹any, any›

Defined in packages/utils/src/fields.ts:80

Parameters:

schema: GraphQLSchema

typeName: string

testFn: function

▸ (fieldName: string, field: GraphQLFieldConfig‹any, any›): boolean

Parameters:

NameType
fieldNamestring
fieldGraphQLFieldConfig‹any, any›

Returns: GraphQLFieldConfigMap‹any, any›


serializeInputValue

serializeInputValue(type: GraphQLInputType, value: any): any

Defined in packages/utils/src/transformInputValue.ts:36

Parameters:

NameType
typeGraphQLInputType
valueany

Returns: any


setErrors

setErrors(result: any, errors: Array‹GraphQLError›): void

Defined in packages/utils/src/errors.ts:38

Parameters:

NameType
resultany
errorsArray‹GraphQLError›

Returns: void


slicedError

slicedError(originalError: GraphQLError): GraphQLError‹›

Defined in packages/utils/src/errors.ts:17

Parameters:

NameType
originalErrorGraphQLError

Returns: GraphQLError‹›


transformInputValue

transformInputValue(type: GraphQLInputType, value: any, transformer: InputValueTransformer): any

Defined in packages/utils/src/transformInputValue.ts:13

Parameters:

NameType
typeGraphQLInputType
valueany
transformerInputValueTransformer

Returns: any


typeContainsSelectionSet

typeContainsSelectionSet(type: GraphQLObjectType, selectionSet: SelectionSetNode): boolean

Defined in packages/utils/src/selectionSets.ts:8

Parameters:

NameType
typeGraphQLObjectType
selectionSetSelectionSetNode

Returns: boolean


updateArgument

updateArgument(argName: string, argType: GraphQLInputType, argumentNodes: Record‹string, ArgumentNode›, variableDefinitionsMap: Record‹string, VariableDefinitionNode›, variableValues: Record‹string, any›, newArg: any): void

Defined in packages/utils/src/updateArgument.ts:5

Parameters:

NameType
argNamestring
argTypeGraphQLInputType
argumentNodesRecord‹string, ArgumentNode›
variableDefinitionsMapRecord‹string, VariableDefinitionNode›
variableValuesRecord‹string, any›
newArgany

Returns: void


validateGraphQlDocuments

validateGraphQlDocuments(schema: GraphQLSchema, documentFiles: Source[], effectiveRules?: ValidationRule[]): Promise‹ReadonlyArray‹LoadDocumentError››

Defined in packages/utils/src/validate-documents.ts:21

Parameters:

NameType
schemaGraphQLSchema
documentFilesSource[]
effectiveRules?ValidationRule[]

Returns: Promise‹ReadonlyArray‹LoadDocumentError››


visitData

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

Defined in packages/utils/src/visitResult.ts:49

Parameters:

NameType
dataany
enter?ValueVisitor
leave?ValueVisitor

Returns: any


visitErrors

visitErrors(errors: ReadonlyArray‹GraphQLError›, visitor: function): Array‹GraphQLError›

Defined in packages/utils/src/visitResult.ts:68

Parameters:

errors: ReadonlyArray‹GraphQLError›

visitor: function

▸ (error: GraphQLError): GraphQLError

Parameters:

NameType
errorGraphQLError

Returns: Array‹GraphQLError›


visitResult

visitResult(result: ExecutionResult, request: Request, schema: GraphQLSchema, resultVisitorMap?: ResultVisitorMap, errorVisitorMap?: ErrorVisitorMap): any

Defined in packages/utils/src/visitResult.ts:74

Parameters:

NameType
resultExecutionResult
requestRequest
schemaGraphQLSchema
resultVisitorMap?ResultVisitorMap
errorVisitorMap?ErrorVisitorMap

Returns: any


visitSchema

visitSchema(schema: GraphQLSchema, visitorOrVisitorSelector: VisitorSelector | Array‹SchemaVisitor | SchemaVisitorMap› | SchemaVisitor | SchemaVisitorMap): GraphQLSchema

Defined in packages/utils/src/visitSchema.ts:42

Parameters:

NameType
schemaGraphQLSchema
visitorOrVisitorSelectorVisitorSelector | Array‹SchemaVisitor | SchemaVisitorMap› | SchemaVisitor | SchemaVisitorMap

Returns: GraphQLSchema


wrapFieldNode

wrapFieldNode(fieldNode: FieldNode, path: Array‹string›): FieldNode

Defined in packages/utils/src/fieldNodes.ts:27

Parameters:

NameType
fieldNodeFieldNode
pathArray‹string›

Returns: FieldNode