@graphql-tools/utils
References
Enumerations
Interfaces
- DirectiveAnnotation
- ExecutionRequest
- ExecutionResult
- FieldsAndPatches
- GetDocumentNodeFromSchemaOptions
- GraphQLParseOptions
- GraphQLResolveInfo
- IAddResolversToSchemaOptions
- IFieldResolverOptions
- IResolverValidationOptions
- Loader
- Observable
- Observer
- PatchFields
- Path
- PromiseWithResolvers
- PruneSchemaOptions
- SchemaMapper
- SchemaPrintOptions
- Source
Type Aliases
- ASTVisitorKeyMap
- AbstractTypeMapper
- ArgumentFilter
- ArgumentMapper
- ArgumentToDirectives
- AsyncExecutor
- BaseLoaderOptions
- Callback
- CompositeTypeMapper
- Constructor
- DirectableASTNode
- DirectableGraphQLObject
- DirectableObject
- DirectiveArgs
- DirectiveFilter
- DirectiveLocationEnum
- DirectiveMapper
- DirectiveUsage
- DisposableAsyncExecutor
- DisposableExecutor
- DisposableSyncExecutor
- ElementOf
- EnumTypeExtensions
- EnumTypeMapper
- EnumValueFilter
- EnumValueMapper
- ErrorVisitor
- ErrorVisitorMap
- Executor
- ExtensionsObject
- FieldFilter
- FieldMapper
- FieldNodeMapper
- FieldNodeMappers
- Force
- GenericFieldMapper
- IDefaultValueIteratorFn
- IEnumTypeResolver
- IFieldIteratorFn
- IFieldResolver
- IInputObjectTypeResolver
- IInterfaceTypeResolver
- IObjectTypeResolver
- IResolvers
- IScalarTypeResolver
- ISchemaLevelResolver
- IUnionTypeResolver
- Ignore
- InputFieldFilter
- InputFieldMapper
- InputLeafValueTransformer
- InputObjectTypeMapper
- InputObjectValueTransformer
- InputTypeExtensions
- InterfaceTypeExtensions
- InterfaceTypeMapper
- Maybe
- MaybeAsyncIterable
- MaybePromise
- NamedDefinitionNode
- NamedTypeMapper
- NextResolverFn
- ObjectFieldFilter
- ObjectTypeExtensions
- ObjectTypeMapper
- ObjectValueVisitor
- PossibleTypeExtensions
- PrintSchemaWithDirectivesOptions
- PruneSchemaFilter
- RenameTypesOptions
- ResultVisitorMap
- RootFieldFilter
- ScalarTypeExtensions
- ScalarTypeMapper
- SchemaExtensions
- SchemaFieldMapperTypes
- SelectedFields
- Skip
- SyncExecutor
- TypeAndFieldToArgumentDirectives
- TypeAndFieldToDirectives
- TypeFilter
- TypeSource
- UnionTypeExtensions
- UnionTypeMapper
- ValidationRule
- ValidatorBehavior
- ValueVisitor
- VisitableSchemaType
- WithList
Variables
Functions
- addPath
- addTypes
- appendObjectFields
- asArray
- assertSome
- astFromArg
- astFromDirective
- astFromEnumType
- astFromEnumValue
- astFromField
- astFromInputField
- astFromInputObjectType
- astFromInterfaceType
- astFromObjectType
- astFromScalarType
- astFromSchema
- astFromType
- astFromUnionType
- astFromValueUntyped
- buildOperationNodeForField
- collectComment
- collectFields
- collectSubFields
- compareNodes
- compareStrings
- correctASTNodes
- createDefaultRules
- createDeferred
- createGraphQLError
- createNamedStub
- createStub
- createVariableNameGenerator
- debugTimerEnd
- debugTimerStart
- dedentBlockStringValue
- doesFragmentConditionMatch
- fakePromise
- filterSchema
- fixSchemaAst
- forEachDefaultValue
- forEachField
- getAbortPromise
- getArgumentValues
- getArgumentsWithDirectives
- getAsyncIterableWithCancel
- getAsyncIteratorWithCancel
- getBlockStringIndentation
- getBuiltInForStub
- getComment
- getDeferValues
- getDefinedRootType
- getDescription
- getDirective
- getDirectiveExtensions
- getDirectiveInExtensions
- getDirectiveNodes
- getDirectives
- getDirectivesInExtensions
- getDocumentNodeFromSchema
- getFieldEntryKey
- getFieldsWithDirectives
- getImplementingTypes
- getLeadingCommentBlock
- getOperationASTFromDocument
- getOperationASTFromRequest
- getResolversFromSchema
- getResponseKeyFromInfo
- getRootTypeMap
- getRootTypeNames
- getRootTypes
- hasOwnProperty
- healSchema
- healTypes
- implementsAbstractType
- isAsyncIterable
- isDescribable
- isDocumentNode
- isDocumentString
- isIterableObject
- isNamedStub
- isObjectLike
- isPromise
- isSome
- isUrl
- isValidPath
- makeDeprecatedDirective
- makeDirectiveNode
- makeDirectiveNodes
- mapAsyncIterator
- mapMaybePromise
- mapSchema
- memoize1
- memoize2
- memoize2of4
- memoize2of5
- memoize3
- memoize4
- memoize5
- mergeDeep
- mergeIncrementalResult
- modifyObjectFields
- nodeToString
- observableToAsyncIterable
- parseGraphQLJSON
- parseGraphQLSDL
- parseInputValue
- parseInputValueLiteral
- parseSelectionSet
- pathToArray
- printComment
- printPathArray
- printSchemaWithDirectives
- printWithComments
- promiseReduce
- pruneSchema
- pushComment
- registerAbortSignalListener
- relocatedError
- removeObjectFields
- renameType
- resetComments
- rewireTypes
- selectObjectFields
- serializeInputValue
- shouldIncludeNode
- transformCommentsToDescriptions
- transformInputValue
- updateArgument
- validateGraphQlDocuments
- valueMatchesCriteria
- visitData
- visitErrors
- visitResult
References
extractExtensionsFromSchema
Re-exports extractExtensionsFromSchema
inspect
Re-exports inspect
withCancel
Renames and re-exports getAsyncIterableWithCancel
Type Aliases
ASTVisitorKeyMap
Ƭ ASTVisitorKeyMap: Partial<Parameters<typeof visit>[2]>
Defined in
packages/utils/src/types.ts:74
AbstractTypeMapper
Ƭ AbstractTypeMapper: (type: GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLInterfaceType | GraphQLUnionType | null | undefined
Type declaration
▸ (type, schema): GraphQLInterfaceType | GraphQLUnionType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLInterfaceType | GraphQLUnionType |
schema | GraphQLSchema |
Returns
GraphQLInterfaceType | GraphQLUnionType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:474
ArgumentFilter
Ƭ ArgumentFilter: (typeName?: string, fieldName?: string, argName?: string, argConfig?: GraphQLArgumentConfig) => boolean
Type declaration
▸ (typeName?, fieldName?, argName?, argConfig?): boolean
Parameters
| Name | Type |
|---|---|
typeName? | string |
fieldName? | string |
argName? | string |
argConfig? | GraphQLArgumentConfig |
Returns
boolean
Defined in
packages/utils/src/Interfaces.ts:243
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
| Name | Type |
|---|---|
argumentConfig | GraphQLArgumentConfig |
fieldName | string |
typeName | string |
schema | GraphQLSchema |
Returns
GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined
Defined in
packages/utils/src/Interfaces.ts:503
ArgumentToDirectives
Ƭ ArgumentToDirectives: Object
Index signature
▪ [argumentName: string]: DirectiveUsage[]
Defined in
packages/utils/src/get-arguments-with-directives.ts:14
AsyncExecutor
Ƭ AsyncExecutor<TBaseContext, TBaseExtensions>: <TReturn, TArgs, TContext, TRoot, TExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>
Type parameters
| Name | Type |
|---|---|
TBaseContext | Record<string, any> |
TBaseExtensions | Record<string, any> |
Type declaration
▸ <TReturn, TArgs, TContext, TRoot, TExtensions>(request): Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>
Type parameters
| Name | Type |
|---|---|
TReturn | any |
TArgs | extends Record<string, any> = Record<string, any> |
TContext | extends TBaseContext = TBaseContext |
TRoot | any |
TExtensions | extends TBaseExtensions = TBaseExtensions |
Parameters
| Name | Type |
|---|---|
request | ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn> |
Returns
Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>
Defined in
packages/utils/src/executor.ts:8
BaseLoaderOptions
Ƭ BaseLoaderOptions: GraphQLParseOptions & BuildSchemaOptions & { cwd?: string ; ignore?: string | string[] ; includeSources?: boolean }
Defined in
packages/utils/src/loaders.ts:11
Callback
Ƭ Callback: (value?: any) => any
Type declaration
▸ (value?): any
Parameters
| Name | Type |
|---|---|
value? | any |
Returns
any
Defined in
packages/utils/src/observableToAsyncIterable.ts:15
CompositeTypeMapper
Ƭ CompositeTypeMapper: (type: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined
Type declaration
▸ (type, schema): GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType |
schema | GraphQLSchema |
Returns
GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:459
Constructor
Ƭ Constructor<T>: (…args: any[]) => T
Type parameters
| Name |
|---|
T |
Type declaration
• (...args): T
Parameters
| Name | Type |
|---|---|
...args | any[] |
Returns
T
Defined in
packages/utils/src/types.ts:31
DirectableASTNode
Ƭ DirectableASTNode: ASTNode & { directives?: readonly DirectiveNode[] }
Defined in
packages/utils/src/getDirectiveExtensions.ts:6
DirectableGraphQLObject
Ƭ DirectableGraphQLObject: DirectableObject
Defined in
packages/utils/src/get-directives.ts:9
DirectableObject
Ƭ DirectableObject: Object
Type declaration
| Name | Type |
|---|---|
astNode? | DirectableASTNode | null |
extensionASTNodes? | readonly DirectableASTNode[] | null |
extensions? | any |
Defined in
packages/utils/src/getDirectiveExtensions.ts:10
DirectiveArgs
Ƭ DirectiveArgs: Object
Index signature
▪ [name: string]: any
Defined in
packages/utils/src/types.ts:151
DirectiveFilter
Ƭ DirectiveFilter: (directiveName: string, directive: GraphQLDirective) => boolean
Type declaration
▸ (directiveName, directive): boolean
Parameters
| Name | Type |
|---|---|
directiveName | string |
directive | GraphQLDirective |
Returns
boolean
Defined in
packages/utils/src/Interfaces.ts:250
DirectiveLocationEnum
Ƭ DirectiveLocationEnum: typeof DirectiveLocation
Defined in
packages/utils/src/types.ts:76
DirectiveMapper
Ƭ DirectiveMapper: (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined
Type declaration
▸ (directive, schema): GraphQLDirective | null | undefined
Parameters
| Name | Type |
|---|---|
directive | GraphQLDirective |
schema | GraphQLSchema |
Returns
GraphQLDirective | null | undefined
Defined in
packages/utils/src/Interfaces.ts:489
DirectiveUsage
Ƭ DirectiveUsage: Object
Type declaration
| Name | Type |
|---|---|
args | DirectiveArgs |
name | string |
Defined in
packages/utils/src/types.ts:152
DisposableAsyncExecutor
Ƭ DisposableAsyncExecutor<TBaseContext, TBaseExtensions>: AsyncExecutor<TBaseContext, TBaseExtensions> & AsyncDisposable
Type parameters
| Name | Type |
|---|---|
TBaseContext | Record<string, any> |
TBaseExtensions | Record<string, any> |
Defined in
packages/utils/src/executor.ts:48
DisposableExecutor
Ƭ DisposableExecutor<TBaseContext, TBaseExtensions>: DisposableSyncExecutor<TBaseContext, TBaseExtensions> | DisposableAsyncExecutor<TBaseContext, TBaseExtensions>
Type parameters
| Name | Type |
|---|---|
TBaseContext | Record<string, any> |
TBaseExtensions | Record<string, any> |
Defined in
packages/utils/src/executor.ts:52
DisposableSyncExecutor
Ƭ DisposableSyncExecutor<TBaseContext, TBaseExtensions>: SyncExecutor<TBaseContext, TBaseExtensions> & Disposable
Type parameters
| Name | Type |
|---|---|
TBaseContext | Record<string, any> |
TBaseExtensions | Record<string, any> |
Defined in
packages/utils/src/executor.ts:44
ElementOf
Ƭ ElementOf<TList>: TList extends infer TElement[] ? TElement : never
Type parameters
| Name |
|---|
TList |
Defined in
packages/utils/src/loaders.ts:19
EnumTypeExtensions
Ƭ EnumTypeExtensions: Object
Type declaration
| Name | Type |
|---|---|
type | "enum" |
values | Record<string, ExtensionsObject> |
Defined in
packages/utils/src/types.ts:133
EnumTypeMapper
Ƭ EnumTypeMapper: (type: GraphQLEnumType, schema: GraphQLSchema) => GraphQLEnumType | null | undefined
Type declaration
▸ (type, schema): GraphQLEnumType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLEnumType |
schema | GraphQLSchema |
Returns
GraphQLEnumType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:447
EnumValueFilter
Ƭ EnumValueFilter: (typeName: string, valueName: string, valueConfig: GraphQLEnumValueConfig) => boolean
Type declaration
▸ (typeName, valueName, valueConfig): boolean
Parameters
| Name | Type |
|---|---|
typeName | string |
valueName | string |
valueConfig | GraphQLEnumValueConfig |
Returns
boolean
Defined in
packages/utils/src/Interfaces.ts:252
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
| Name | Type |
|---|---|
valueConfig | GraphQLEnumValueConfig |
typeName | string |
schema | GraphQLSchema |
externalValue | string |
Returns
GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined
Defined in
packages/utils/src/Interfaces.ts:452
ErrorVisitor
Ƭ ErrorVisitor: (error: GraphQLError, pathIndex: number) => GraphQLError
Type declaration
▸ (error, pathIndex): GraphQLError
Parameters
| Name | Type |
|---|---|
error | GraphQLError |
pathIndex | number |
Returns
GraphQLError
Defined in
packages/utils/src/visitResult.ts:32
ErrorVisitorMap
Ƭ ErrorVisitorMap: { __unpathed?: (error: GraphQLError) => GraphQLError } & Record<string, Record<string, ErrorVisitor>>
Defined in
packages/utils/src/visitResult.ts:34
Executor
Ƭ Executor<TBaseContext, TBaseExtensions>: <TReturn, TArgs, TContext, TRoot, TExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>
Type parameters
| Name | Type |
|---|---|
TBaseContext | Record<string, any> |
TBaseExtensions | Record<string, any> |
Type declaration
▸ <TReturn, TArgs, TContext, TRoot, TExtensions>(request): MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>
Type parameters
| Name | Type |
|---|---|
TReturn | any |
TArgs | extends Record<string, any> = Record<string, any> |
TContext | extends TBaseContext = TBaseContext |
TRoot | any |
TExtensions | extends TBaseExtensions = TBaseExtensions |
Parameters
| Name | Type |
|---|---|
request | ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn> |
Returns
MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>
Defined in
packages/utils/src/executor.ts:34
ExtensionsObject
Ƭ ExtensionsObject: Record<string, any>
Defined in
packages/utils/src/types.ts:102
FieldFilter
Ƭ FieldFilter: (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig) => boolean
Type declaration
▸ (typeName, fieldName, fieldConfig): boolean
Parameters
| Name | Type |
|---|---|
typeName | string |
fieldName | string |
fieldConfig | GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig |
Returns
boolean
Defined in
packages/utils/src/Interfaces.ts:223
FieldMapper
Ƭ FieldMapper: GenericFieldMapper<GraphQLFieldConfig<any, any>>
Defined in
packages/utils/src/Interfaces.ts:501
FieldNodeMapper
Ƭ FieldNodeMapper: (fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => SelectionNode | SelectionNode[]
Type declaration
▸ (fieldNode, fragments, transformationContext): SelectionNode | SelectionNode[]
Parameters
| Name | Type |
|---|---|
fieldNode | FieldNode |
fragments | Record<string, FragmentDefinitionNode> |
transformationContext | Record<string, any> |
Returns
SelectionNode | SelectionNode[]
Defined in
packages/utils/src/Interfaces.ts:209
FieldNodeMappers
Ƭ FieldNodeMappers: Record<string, Record<string, FieldNodeMapper>>
Defined in
packages/utils/src/Interfaces.ts:215
Force
Ƭ Force: string[]
Defined in
packages/utils/src/build-operation-for-field.ts:48
GenericFieldMapper
Ƭ GenericFieldMapper<F>: (fieldConfig: F, fieldName: string, typeName: string, schema: GraphQLSchema) => F | [string, F] | null | undefined
Type parameters
| Name | Type |
|---|---|
F | extends GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig |
Type declaration
▸ (fieldConfig, fieldName, typeName, schema): F | [string, F] | null | undefined
Parameters
| Name | Type |
|---|---|
fieldConfig | F |
fieldName | string |
typeName | string |
schema | GraphQLSchema |
Returns
F | [string, F] | null | undefined
Defined in
packages/utils/src/Interfaces.ts:494
IDefaultValueIteratorFn
Ƭ IDefaultValueIteratorFn: (type: GraphQLInputType, value: any) => void
Type declaration
▸ (type, value): void
Parameters
| Name | Type |
|---|---|
type | GraphQLInputType |
value | any |
Returns
void
Defined in
packages/utils/src/Interfaces.ts:351
IEnumTypeResolver
Ƭ IEnumTypeResolver: Record<string, any> & { __astNode?: EnumTypeDefinitionNode ; __description?: string ; __extensionASTNodes?: EnumTypeExtensionNode[] ; __extensions?: Record<string, any> ; __name?: string }
Defined in
packages/utils/src/Interfaces.ts:188
IFieldIteratorFn
Ƭ IFieldIteratorFn: (fieldDef: GraphQLField<any, any>, typeName: string, fieldName: string) => void
Type declaration
▸ (fieldDef, typeName, fieldName): void
Parameters
| Name | Type |
|---|---|
fieldDef | GraphQLField<any, any> |
typeName | string |
fieldName | string |
Returns
void
Defined in
packages/utils/src/Interfaces.ts:345
IFieldResolver
Ƭ IFieldResolver<TSource, TContext, TArgs, TReturn>: (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn
Type parameters
| Name | Type |
|---|---|
TSource | TSource |
TContext | TContext |
TArgs | Record<string, any> |
TReturn | any |
Type declaration
▸ (source, args, context, info): TReturn
Parameters
| Name | Type |
|---|---|
source | TSource |
args | TArgs |
context | TContext |
info | GraphQLResolveInfo |
Returns
TReturn
Defined in
packages/utils/src/Interfaces.ts:263
IInputObjectTypeResolver
Ƭ IInputObjectTypeResolver: Object
Type declaration
| Name | Type |
|---|---|
__astNode? | InputObjectTypeDefinitionNode |
__description? | string |
__extensionASTNodes? | InputObjectTypeExtensionNode[] |
__extensions? | Record<string, any> |
__name? | string |
Defined in
packages/utils/src/Interfaces.ts:314
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
| Name | Type |
|---|---|
TSource | any |
TContext | any |
TArgs | any |
Defined in
packages/utils/src/Interfaces.ts:292
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
| Name | Type |
|---|---|
TSource | any |
TContext | any |
TArgs | any |
Defined in
packages/utils/src/Interfaces.ts:279
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
| Name | Type |
|---|---|
TSource | any |
TContext | any |
TArgs | Record<string, any> |
TReturn | any |
Defined in
packages/utils/src/Interfaces.ts:329
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:177
ISchemaLevelResolver
Ƭ ISchemaLevelResolver<TSource, TContext, TArgs, TReturn>: IFieldResolver<TSource, TContext, TArgs, TReturn>
Type parameters
| Name | Type |
|---|---|
TSource | TSource |
TContext | TContext |
TArgs | Record<string, any> |
TReturn | any |
Defined in
packages/utils/src/Interfaces.ts:322
IUnionTypeResolver
Ƭ IUnionTypeResolver: Object
Type declaration
| Name | Type |
|---|---|
__astNode? | UnionTypeDefinitionNode |
__description? | string |
__extensionASTNodes? | UnionTypeExtensionNode[] |
__extensions? | Record<string, any> |
__name? | string |
__resolveType? | GraphQLTypeResolver<any, any> |
Defined in
packages/utils/src/Interfaces.ts:305
Ignore
Ƭ Ignore: string[]
Defined in
packages/utils/src/build-operation-for-field.ts:49
InputFieldFilter
Ƭ InputFieldFilter: (typeName?: string, fieldName?: string, inputFieldConfig?: GraphQLInputFieldConfig) => boolean
Type declaration
▸ (typeName?, fieldName?, inputFieldConfig?): boolean
Parameters
| Name | Type |
|---|---|
typeName? | string |
fieldName? | string |
inputFieldConfig? | GraphQLInputFieldConfig |
Returns
boolean
Defined in
packages/utils/src/Interfaces.ts:217
InputFieldMapper
Ƭ InputFieldMapper: GenericFieldMapper<GraphQLInputFieldConfig>
Defined in
packages/utils/src/Interfaces.ts:510
InputLeafValueTransformer
Ƭ InputLeafValueTransformer: (type: GraphQLEnumType | GraphQLScalarType, originalValue: any) => any
Type declaration
▸ (type, originalValue): any
Parameters
| Name | Type |
|---|---|
type | GraphQLEnumType | GraphQLScalarType |
originalValue | any |
Returns
any
Defined in
packages/utils/src/types.ts:64
InputObjectTypeMapper
Ƭ InputObjectTypeMapper: (type: GraphQLInputObjectType, schema: GraphQLSchema) => GraphQLInputObjectType | null | undefined
Type declaration
▸ (type, schema): GraphQLInputObjectType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLInputObjectType |
schema | GraphQLSchema |
Returns
GraphQLInputObjectType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:469
InputObjectValueTransformer
Ƭ InputObjectValueTransformer: (type: GraphQLInputObjectType, originalValue: Record<string, any>) => Record<string, any>
Type declaration
▸ (type, originalValue): Record<string, any>
Parameters
| Name | Type |
|---|---|
type | GraphQLInputObjectType |
originalValue | Record<string, any> |
Returns
Record<string, any>
Defined in
packages/utils/src/types.ts:68
InputTypeExtensions
Ƭ InputTypeExtensions: Object
Type declaration
| Name | Type |
|---|---|
fields | Record<string, { extensions: ExtensionsObject }> |
type | "input" |
Defined in
packages/utils/src/types.ts:112
InterfaceTypeExtensions
Ƭ InterfaceTypeExtensions: Object
Type declaration
| Name | Type |
|---|---|
fields | Record<string, { arguments: Record<string, ExtensionsObject> ; extensions: ExtensionsObject }> |
type | "interface" |
Defined in
packages/utils/src/types.ts:117
InterfaceTypeMapper
Ƭ InterfaceTypeMapper: (type: GraphQLInterfaceType, schema: GraphQLSchema) => GraphQLInterfaceType | null | undefined
Type declaration
▸ (type, schema): GraphQLInterfaceType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLInterfaceType |
schema | GraphQLSchema |
Returns
GraphQLInterfaceType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:484
Maybe
Ƭ Maybe<T>: null | undefined | T
Type parameters
| Name |
|---|
T |
Defined in
packages/utils/src/types.ts:29
MaybeAsyncIterable
Ƭ MaybeAsyncIterable<T>: AsyncIterable<T> | T
Type parameters
| Name |
|---|
T |
Defined in
packages/utils/src/executor.ts:6
MaybePromise
Ƭ MaybePromise<T>: Promise<T> | T
Type parameters
| Name |
|---|
T |
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:1
NamedDefinitionNode
Ƭ NamedDefinitionNode: DefinitionNode & { name?: NameNode }
Defined in
packages/utils/src/comments.ts:16
NamedTypeMapper
Ƭ NamedTypeMapper: (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined
Type declaration
▸ (type, schema): GraphQLNamedType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLNamedType |
schema | GraphQLSchema |
Returns
GraphQLNamedType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:437
NextResolverFn
Ƭ NextResolverFn: () => Promise<any>
Type declaration
▸ (): Promise<any>
Returns
Promise<any>
Defined in
packages/utils/src/Interfaces.ts:353
ObjectFieldFilter
Ƭ ObjectFieldFilter: (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean
Type declaration
▸ (typeName, fieldName, fieldConfig): boolean
Parameters
| Name | Type |
|---|---|
typeName | string |
fieldName | string |
fieldConfig | GraphQLFieldConfig<any, any> |
Returns
boolean
Defined in
packages/utils/src/Interfaces.ts:229
ObjectTypeExtensions
Ƭ ObjectTypeExtensions: Object
Type declaration
| Name | Type |
|---|---|
fields | Record<string, { arguments: Record<string, ExtensionsObject> ; extensions: ExtensionsObject }> |
type | "object" |
Defined in
packages/utils/src/types.ts:104
ObjectTypeMapper
Ƭ ObjectTypeMapper: (type: GraphQLObjectType, schema: GraphQLSchema) => GraphQLObjectType | null | undefined
Type declaration
▸ (type, schema): GraphQLObjectType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLObjectType |
schema | GraphQLSchema |
Returns
GraphQLObjectType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:464
ObjectValueVisitor
Ƭ ObjectValueVisitor: { __enter?: ValueVisitor ; __leave?: ValueVisitor } & Record<string, ValueVisitor>
Defined in
packages/utils/src/visitResult.ts:25
PossibleTypeExtensions
Ƭ PossibleTypeExtensions: InputTypeExtensions | InterfaceTypeExtensions | ObjectTypeExtensions | UnionTypeExtensions | ScalarTypeExtensions | EnumTypeExtensions
Defined in
packages/utils/src/types.ts:138
PrintSchemaWithDirectivesOptions
Ƭ PrintSchemaWithDirectivesOptions: SchemaPrintOptions & GetDocumentNodeFromSchemaOptions
Defined in
packages/utils/src/types.ts:26
PruneSchemaFilter
Ƭ PruneSchemaFilter: (type: GraphQLNamedType) => boolean
Type declaration
▸ (type): boolean
Parameters
| Name | Type |
|---|---|
type | GraphQLNamedType |
Returns
boolean
Defined in
packages/utils/src/types.ts:33
RenameTypesOptions
Ƭ RenameTypesOptions: Object
Type declaration
| Name | Type |
|---|---|
renameBuiltins | boolean |
renameScalars | boolean |
Defined in
packages/utils/src/Interfaces.ts:258
ResultVisitorMap
Ƭ ResultVisitorMap: Record<string, ValueVisitor | ObjectValueVisitor>
Defined in
packages/utils/src/visitResult.ts:30
RootFieldFilter
Ƭ RootFieldFilter: (operation: "Query" | "Mutation" | "Subscription", rootFieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean
Type declaration
▸ (operation, rootFieldName, fieldConfig): boolean
Parameters
| Name | Type |
|---|---|
operation | "Query" | "Mutation" | "Subscription" |
rootFieldName | string |
fieldConfig | GraphQLFieldConfig<any, any> |
Returns
boolean
Defined in
packages/utils/src/Interfaces.ts:235
ScalarTypeExtensions
Ƭ ScalarTypeExtensions: Object
Type declaration
| Name | Type |
|---|---|
type | "scalar" |
Defined in
packages/utils/src/types.ts:129
ScalarTypeMapper
Ƭ ScalarTypeMapper: (type: GraphQLScalarType, schema: GraphQLSchema) => GraphQLScalarType | null | undefined
Type declaration
▸ (type, schema): GraphQLScalarType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLScalarType |
schema | GraphQLSchema |
Returns
GraphQLScalarType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:442
SchemaExtensions
Ƭ SchemaExtensions: Object
Type declaration
| Name | Type |
|---|---|
schemaExtensions | ExtensionsObject |
types | Record<string, { extensions: ExtensionsObject } & PossibleTypeExtensions> |
Defined in
packages/utils/src/types.ts:146
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:425
SelectedFields
Ƭ SelectedFields: { [key: string]: SelectedFields; } | boolean
Defined in
packages/utils/src/build-operation-for-field.ts:51
Skip
Ƭ Skip: string[]
Defined in
packages/utils/src/build-operation-for-field.ts:47
SyncExecutor
Ƭ SyncExecutor<TBaseContext, TBaseExtensions>: <TReturn, TArgs, TContext, TRoot, TExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => ExecutionResult<TReturn>
Type parameters
| Name | Type |
|---|---|
TBaseContext | Record<string, any> |
TBaseExtensions | Record<string, any> |
Type declaration
▸ <TReturn, TArgs, TContext, TRoot, TExtensions>(request): ExecutionResult<TReturn>
Type parameters
| Name | Type |
|---|---|
TReturn | any |
TArgs | extends Record<string, any> = Record<string, any> |
TContext | extends TBaseContext = TBaseContext |
TRoot | any |
TExtensions | extends TBaseExtensions = TBaseExtensions |
Parameters
| Name | Type |
|---|---|
request | ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn> |
Returns
ExecutionResult<TReturn>
Defined in
packages/utils/src/executor.ts:21
TypeAndFieldToArgumentDirectives
Ƭ TypeAndFieldToArgumentDirectives: Object
Index signature
▪ [typeAndField: string]: ArgumentToDirectives
Defined in
packages/utils/src/get-arguments-with-directives.ts:17
TypeAndFieldToDirectives
Ƭ TypeAndFieldToDirectives: Object
Index signature
▪ [typeAndField: string]: DirectiveUsage[]
Defined in
packages/utils/src/get-fields-with-directives.ts:11
TypeFilter
Ƭ TypeFilter: (typeName: string, type: GraphQLType) => boolean
Type declaration
▸ (typeName, type): boolean
Parameters
| Name | Type |
|---|---|
typeName | string |
type | GraphQLType |
Returns
boolean
Defined in
packages/utils/src/Interfaces.ts:241
TypeSource
Ƭ TypeSource: string | Source | DocumentNode | GraphQLSchema | DefinitionNode | TypeSource[] | () => TypeSource
Defined in
packages/utils/src/Interfaces.ts:270
UnionTypeExtensions
Ƭ UnionTypeExtensions: Object
Type declaration
| Name | Type |
|---|---|
type | "union" |
Defined in
packages/utils/src/types.ts:125
UnionTypeMapper
Ƭ UnionTypeMapper: (type: GraphQLUnionType, schema: GraphQLSchema) => GraphQLUnionType | null | undefined
Type declaration
▸ (type, schema): GraphQLUnionType | null | undefined
Parameters
| Name | Type |
|---|---|
type | GraphQLUnionType |
schema | GraphQLSchema |
Returns
GraphQLUnionType | null | undefined
Defined in
packages/utils/src/Interfaces.ts:479
ValidationRule
Ƭ ValidationRule: (context: ValidationContext) => ASTVisitor
Type declaration
▸ (context): ASTVisitor
Parameters
| Name | Type |
|---|---|
context | ValidationContext |
Returns
ASTVisitor
Defined in
packages/utils/src/validate-documents.ts:13
ValidatorBehavior
Ƭ ValidatorBehavior: "error" | "warn" | "ignore"
Defined in
packages/utils/src/Interfaces.ts:113
ValueVisitor
Ƭ ValueVisitor: (value: any) => any
Type declaration
▸ (value): any
Parameters
| Name | Type |
|---|---|
value | any |
Returns
any
Defined in
packages/utils/src/visitResult.ts:23
VisitableSchemaType
Ƭ VisitableSchemaType: GraphQLSchema | GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType | GraphQLNamedType | GraphQLScalarType | GraphQLField<any, any> | GraphQLInputField | GraphQLArgument | GraphQLUnionType | GraphQLEnumType | GraphQLEnumValue
Defined in
packages/utils/src/Interfaces.ts:355
WithList
Ƭ WithList<T>: T | T[]
Type parameters
| Name |
|---|
T |
Defined in
packages/utils/src/loaders.ts:18
Variables
GraphQLDeferDirective
• Const GraphQLDeferDirective: GraphQLDirective
Used to conditionally defer fragments.
Defined in
packages/utils/src/directives.ts:13
GraphQLStreamDirective
• Const GraphQLStreamDirective: GraphQLDirective
Used to conditionally stream list fields.
Defined in
packages/utils/src/directives.ts:34
Functions
addPath
▸ addPath(prev, key, typename): Path
Given a Path and a key, return a new Path containing the new key.
Parameters
| Name | Type |
|---|---|
prev | undefined | Readonly<Path> |
key | string | number |
typename | undefined | string |
Returns
Defined in
addTypes
▸ addTypes(schema, newTypesOrDirectives): GraphQLSchema
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
newTypesOrDirectives | (GraphQLDirective | GraphQLNamedType)[] |
Returns
GraphQLSchema
Defined in
packages/utils/src/addTypes.ts:39
appendObjectFields
▸ appendObjectFields(schema, typeName, additionalFields): GraphQLSchema
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
typeName | string |
additionalFields | GraphQLFieldConfigMap<any, any> |
Returns
GraphQLSchema
Defined in
packages/utils/src/fields.ts:11
asArray
▸ asArray<T>(fns): T[]
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
fns | T | T[] |
Returns
T[]
Defined in
packages/utils/src/helpers.ts:33
assertSome
▸ assertSome<T>(input, message?): asserts input is Exclude<T, undefined | null>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type | Default value |
|---|---|---|
input | T | undefined |
message | string | 'Value should be something' |
Returns
asserts input is Exclude<T, undefined | null>
Defined in
packages/utils/src/helpers.ts:136
astFromArg
▸ astFromArg(arg, schema?, pathToDirectivesInExtensions?): InputValueDefinitionNode
Parameters
| Name | Type |
|---|---|
arg | GraphQLArgument |
schema? | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
InputValueDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:277
astFromDirective
▸ astFromDirective(directive, schema?, pathToDirectivesInExtensions?): DirectiveDefinitionNode
Parameters
| Name | Type |
|---|---|
directive | GraphQLDirective |
schema? | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
DirectiveDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:195
astFromEnumType
▸ astFromEnumType(type, schema, pathToDirectivesInExtensions?): EnumTypeDefinitionNode
Parameters
| Name | Type |
|---|---|
type | GraphQLEnumType |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
EnumTypeDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:386
astFromEnumValue
▸ astFromEnumValue(value, schema, pathToDirectivesInExtensions?): EnumValueDefinitionNode
Parameters
| Name | Type |
|---|---|
value | GraphQLEnumValue |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
EnumValueDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:477
astFromField
▸ astFromField(field, schema, pathToDirectivesInExtensions?): FieldDefinitionNode
Parameters
| Name | Type |
|---|---|
field | GraphQLField<any, any, any> |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
FieldDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:439
astFromInputField
▸ astFromInputField(field, schema, pathToDirectivesInExtensions?): InputValueDefinitionNode
Parameters
| Name | Type |
|---|---|
field | GraphQLInputField |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
InputValueDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:458
astFromInputObjectType
▸ astFromInputObjectType(type, schema, pathToDirectivesInExtensions?): InputObjectTypeDefinitionNode
Parameters
| Name | Type |
|---|---|
type | GraphQLInputObjectType |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
InputObjectTypeDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:366
astFromInterfaceType
▸ astFromInterfaceType(type, schema, pathToDirectivesInExtensions?): InterfaceTypeDefinitionNode
Parameters
| Name | Type |
|---|---|
type | GraphQLInterfaceType |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
InterfaceTypeDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:321
astFromObjectType
▸ astFromObjectType(type, schema, pathToDirectivesInExtensions?): ObjectTypeDefinitionNode
Parameters
| Name | Type |
|---|---|
type | GraphQLObjectType<any, any> |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
ObjectTypeDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:299
astFromScalarType
▸ astFromScalarType(type, schema, pathToDirectivesInExtensions?): ScalarTypeDefinitionNode
Parameters
| Name | Type |
|---|---|
type | GraphQLScalarType<unknown, unknown> |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
ScalarTypeDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:406
astFromSchema
▸ astFromSchema(schema, pathToDirectivesInExtensions?): SchemaDefinitionNode | SchemaExtensionNode | null
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
SchemaDefinitionNode | SchemaExtensionNode | null
Defined in
packages/utils/src/print-schema-with-directives.ts:126
astFromType
▸ astFromType(type): TypeNode
Parameters
| Name | Type |
|---|---|
type | GraphQLType |
Returns
TypeNode
Defined in
packages/utils/src/astFromType.ts:4
astFromUnionType
▸ astFromUnionType(type, schema, pathToDirectivesInExtensions?): UnionTypeDefinitionNode
Parameters
| Name | Type |
|---|---|
type | GraphQLUnionType |
schema | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
UnionTypeDefinitionNode
Defined in
packages/utils/src/print-schema-with-directives.ts:348
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 Value | GraphQL Value |
|---|---|
| Object | Input Object |
| Array | List |
| Boolean | Boolean |
| String | String |
| Number | Int / Float |
| BigInt | Int |
| null | NullValue |
Parameters
| Name | Type |
|---|---|
value | any |
Returns
ValueNode | null
Defined in
packages/utils/src/astFromValueUntyped.ts:19
buildOperationNodeForField
▸ buildOperationNodeForField(«destructured»): OperationDefinitionNode
Parameters
| Name | Type | Default value |
|---|---|---|
«destructured» | Object | undefined |
› argNames? | string[] | undefined |
› circularReferenceDepth? | number | undefined |
› depthLimit? | number | undefined |
› field | string | undefined |
› ignore? | Ignore | [] |
› kind | OperationTypeNode | undefined |
› models? | string[] | undefined |
› schema | GraphQLSchema | undefined |
› selectedFields? | SelectedFields | true |
Returns
OperationDefinitionNode
Defined in
packages/utils/src/build-operation-for-field.ts:57
collectComment
▸ collectComment(node): void
Parameters
| Name | Type |
|---|---|
node | NamedDefinitionNode |
Returns
void
Defined in
packages/utils/src/comments.ts:28
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
| Name | Type |
|---|---|
TVariables | any |
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
fragments | Record<string, FragmentDefinitionNode> |
variableValues | TVariables |
runtimeType | GraphQLObjectType<any, any> |
selectionSet | SelectionSetNode |
Returns
Defined in
packages/utils/src/collectFields.ts:152
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
| Name | Type |
|---|---|
schema | GraphQLSchema |
fragments | Record<string, FragmentDefinitionNode> |
variableValues | Object |
returnType | GraphQLObjectType<any, any> |
fieldNodes | FieldNode[] |
Returns
Defined in
packages/utils/src/collectFields.ts:257
compareNodes
▸ compareNodes(a, b, customFn?): number
Parameters
| Name | Type |
|---|---|
a | ASTNode |
b | ASTNode |
customFn? | (a: any, b: any) => number |
Returns
number
Defined in
packages/utils/src/helpers.ts:121
compareStrings
▸ compareStrings<A, B>(a, b): -1 | 0 | 1
Type parameters
| Name |
|---|
A |
B |
Parameters
| Name | Type |
|---|---|
a | A |
b | B |
Returns
-1 | 0 | 1
Defined in
packages/utils/src/helpers.ts:94
correctASTNodes
▸ correctASTNodes(type): GraphQLObjectType
Parameters
| Name | Type |
|---|---|
type | GraphQLObjectType<any, any> |
Returns
GraphQLObjectType
Defined in
packages/utils/src/mapSchema.ts:539
▸ correctASTNodes(type): GraphQLInterfaceType
Parameters
| Name | Type |
|---|---|
type | GraphQLInterfaceType |
Returns
GraphQLInterfaceType
Defined in
packages/utils/src/mapSchema.ts:540
▸ correctASTNodes(type): GraphQLInputObjectType
Parameters
| Name | Type |
|---|---|
type | GraphQLInputObjectType |
Returns
GraphQLInputObjectType
Defined in
packages/utils/src/mapSchema.ts:541
▸ correctASTNodes(type): GraphQLEnumType
Parameters
| Name | Type |
|---|---|
type | GraphQLEnumType |
Returns
GraphQLEnumType
Defined in
packages/utils/src/mapSchema.ts:542
createDefaultRules
▸ createDefaultRules(): ValidationRule[]
Returns
ValidationRule[]
Defined in
packages/utils/src/validate-documents.ts:47
createDeferred
▸ createDeferred<T>(): DeferredPromise<T>
Type parameters
| Name | Type |
|---|---|
T | void |
Returns
DeferredPromise<T>
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:16
createGraphQLError
▸ createGraphQLError(message, options?): GraphQLError
Parameters
| Name | Type |
|---|---|
message | string |
options? | GraphQLErrorOptions |
Returns
GraphQLError
Defined in
packages/utils/src/errors.ts:38
createNamedStub
▸ createNamedStub(name, type): GraphQLObjectType
Parameters
| Name | Type |
|---|---|
name | string |
type | "object" |
Returns
GraphQLObjectType
Defined in
▸ createNamedStub(name, type): GraphQLInterfaceType
Parameters
| Name | Type |
|---|---|
name | string |
type | "interface" |
Returns
GraphQLInterfaceType
Defined in
▸ createNamedStub(name, type): GraphQLInputObjectType
Parameters
| Name | Type |
|---|---|
name | string |
type | "input" |
Returns
GraphQLInputObjectType
Defined in
createStub
▸ createStub(node, type): GraphQLOutputType
Parameters
| Name | Type |
|---|---|
node | TypeNode |
type | "output" |
Returns
GraphQLOutputType
Defined in
▸ createStub(node, type): GraphQLInputType
Parameters
| Name | Type |
|---|---|
node | TypeNode |
type | "input" |
Returns
GraphQLInputType
Defined in
▸ createStub(node, type): GraphQLType
Parameters
| Name | Type |
|---|---|
node | TypeNode |
type | "input" | "output" |
Returns
GraphQLType
Defined in
createVariableNameGenerator
▸ createVariableNameGenerator(variableDefinitionMap): (argName: string) => string
Parameters
| Name | Type |
|---|---|
variableDefinitionMap | Record<string, VariableDefinitionNode> |
Returns
fn
▸ (argName): string
Parameters
| Name | Type |
|---|---|
argName | string |
Returns
string
Defined in
packages/utils/src/updateArgument.ts:53
debugTimerEnd
▸ debugTimerEnd(name): void
Parameters
| Name | Type |
|---|---|
name | string |
Returns
void
Defined in
packages/utils/src/debugTimer.ts:11
debugTimerStart
▸ debugTimerStart(name): void
Parameters
| Name | Type |
|---|---|
name | string |
Returns
void
Defined in
packages/utils/src/debugTimer.ts:3
dedentBlockStringValue
▸ dedentBlockStringValue(rawString): string
Parameters
| Name | Type |
|---|---|
rawString | string |
Returns
string
Defined in
packages/utils/src/comments.ts:492
doesFragmentConditionMatch
▸ doesFragmentConditionMatch(schema, fragment, type): boolean
Determines if a fragment is applicable to the given type.
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
fragment | InlineFragmentNode | FragmentDefinitionNode |
type | GraphQLObjectType<any, any> |
Returns
boolean
Defined in
packages/utils/src/collectFields.ts:197
fakePromise
▸ fakePromise<T>(value): Promise<T>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
value | MaybePromise<T> |
Returns
Promise<T>
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:8
▸ fakePromise<T>(value): Promise<T>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
value | MaybePromiseLike<T> |
Returns
Promise<T>
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:9
▸ fakePromise(value): Promise<void>
Parameters
| Name | Type |
|---|---|
value | void |
Returns
Promise<void>
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:10
filterSchema
▸ filterSchema(«destructured»): GraphQLSchema
Parameters
| Name | Type | Default value |
|---|---|---|
«destructured» | Object | undefined |
› argumentFilter? | ArgumentFilter | undefined |
› directiveFilter? | DirectiveFilter | undefined |
› enumValueFilter? | EnumValueFilter | undefined |
› fieldFilter? | FieldFilter | undefined |
› inputObjectFieldFilter? | FieldFilter | undefined |
› interfaceFieldFilter? | FieldFilter | undefined |
› objectFieldFilter? | FieldFilter | undefined |
› rootFieldFilter? | RootFieldFilter | undefined |
› schema | GraphQLSchema | undefined |
› typeFilter? | TypeFilter | undefined |
Returns
GraphQLSchema
Defined in
packages/utils/src/filterSchema.ts:22
fixSchemaAst
▸ fixSchemaAst(schema, options): GraphQLSchema
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
options | BuildSchemaOptions & SchemaPrintOptions |
Returns
GraphQLSchema
Defined in
packages/utils/src/fixSchemaAst.ts:12
forEachDefaultValue
▸ forEachDefaultValue(schema, fn): void
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
fn | IDefaultValueIteratorFn |
Returns
void
Defined in
packages/utils/src/forEachDefaultValue.ts:4
forEachField
▸ forEachField(schema, fn): void
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
fn | IFieldIteratorFn |
Returns
void
Defined in
packages/utils/src/forEachField.ts:4
getAbortPromise
▸ getAbortPromise(signal): Promise<unknown>
Parameters
| Name | Type |
|---|---|
signal | AbortSignal |
Returns
Promise<unknown>
Defined in
packages/utils/src/registerAbortSignalListener.ts:35
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
| Name | Type |
|---|---|
def | GraphQLDirective | GraphQLField<any, any, any> |
node | FieldNode | DirectiveNode |
variableValues | Record<string, any> |
Returns
Record<string, any>
Defined in
packages/utils/src/getArgumentValues.ts:24
getArgumentsWithDirectives
▸ getArgumentsWithDirectives(documentNode): TypeAndFieldToArgumentDirectives
Parameters
| Name | Type |
|---|---|
documentNode | DocumentNode |
Returns
TypeAndFieldToArgumentDirectives
Defined in
packages/utils/src/get-arguments-with-directives.ts:21
getAsyncIterableWithCancel
▸ getAsyncIterableWithCancel<T, TAsyncIterable, TReturn>(asyncIterable, onCancel): TAsyncIterable
Type parameters
| Name | Type |
|---|---|
T | T |
TAsyncIterable | extends AsyncIterable<T, any, any> |
TReturn | any |
Parameters
| Name | Type |
|---|---|
asyncIterable | TAsyncIterable |
onCancel | (value?: TReturn) => void | Promise<void> |
Returns
TAsyncIterable
Defined in
packages/utils/src/withCancel.ts:43
getAsyncIteratorWithCancel
▸ getAsyncIteratorWithCancel<T, TReturn>(asyncIterator, onCancel): AsyncIterator<T>
Type parameters
| Name | Type |
|---|---|
T | T |
TReturn | any |
Parameters
| Name | Type |
|---|---|
asyncIterator | AsyncIterator<T, any, any> |
onCancel | (value?: TReturn) => void | Promise<void> |
Returns
AsyncIterator<T>
Defined in
packages/utils/src/withCancel.ts:16
getBlockStringIndentation
▸ getBlockStringIndentation(lines): number
Parameters
| Name | Type |
|---|---|
lines | readonly string[] |
Returns
number
Defined in
packages/utils/src/comments.ts:519
getBuiltInForStub
▸ getBuiltInForStub(type): GraphQLNamedType
Parameters
| Name | Type |
|---|---|
type | GraphQLNamedType |
Returns
GraphQLNamedType
Defined in
getComment
▸ getComment(node): undefined | string
Parameters
| Name | Type |
|---|---|
node | Object |
node.loc? | Location |
Returns
undefined | string
Defined in
packages/utils/src/comments.ts:463
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
| Name | Type |
|---|---|
variableValues | any |
node | FragmentSpreadNode | InlineFragmentNode |
Returns
undefined | { label: string | undefined }
Defined in
packages/utils/src/collectFields.ts:229
getDefinedRootType
▸ getDefinedRootType(schema, operation, nodes?): GraphQLObjectType
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
operation | OperationTypeNode |
nodes? | ASTNode[] |
Returns
GraphQLObjectType
Defined in
packages/utils/src/rootTypes.ts:5
getDescription
▸ getDescription(node, options?): string | undefined
Parameters
| Name | Type |
|---|---|
node | Object |
node.description? | StringValueNode |
node.loc? | Location |
options? | Object |
options.commentDescriptions? | boolean |
Returns
string | undefined
Defined in
packages/utils/src/comments.ts:451
getDirective
▸ getDirective(schema, node, directiveName, pathToDirectivesInExtensions?): Record<string, any>[] | undefined
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
node | DirectableObject |
directiveName | string |
pathToDirectivesInExtensions | string[] |
Returns
Record<string, any>[] | undefined
Defined in
packages/utils/src/get-directives.ts:53
getDirectiveExtensions
▸ getDirectiveExtensions<TDirectiveAnnotationsMap>(directableObj, schema?, pathToDirectivesInExtensions?): { [directiveName in string | number | symbol]?: TDirectiveAnnotationsMap[directiveName][] }
Type parameters
| Name | Type |
|---|---|
TDirectiveAnnotationsMap | extends Object |
Parameters
| Name | Type |
|---|---|
directableObj | DirectableObject |
schema? | GraphQLSchema |
pathToDirectivesInExtensions | string[] |
Returns
{ [directiveName in string | number | symbol]?: TDirectiveAnnotationsMap[directiveName][] }
Defined in
packages/utils/src/getDirectiveExtensions.ts:16
getDirectiveInExtensions
▸ getDirectiveInExtensions(node, directiveName, pathToDirectivesInExtensions?): Record<string, any>[] | undefined
Parameters
| Name | Type |
|---|---|
node | DirectableObject |
directiveName | string |
pathToDirectivesInExtensions | string[] |
Returns
Record<string, any>[] | undefined
Defined in
packages/utils/src/get-directives.ts:27
getDirectiveNodes
▸ getDirectiveNodes<TDirectiveNode>(entity, schema?, pathToDirectivesInExtensions?): TDirectiveNode[]
Type parameters
| Name | Type |
|---|---|
TDirectiveNode | extends DirectiveNode |
Parameters
| Name | Type |
|---|---|
entity | DirectableObject & { deprecationReason?: null | string ; specifiedByURL?: null | string ; specifiedByUrl?: null | string } |
schema? | GraphQLSchema |
pathToDirectivesInExtensions? | string[] |
Returns
TDirectiveNode[]
Defined in
packages/utils/src/print-schema-with-directives.ts:217
getDirectives
▸ getDirectives(schema, node, pathToDirectivesInExtensions?): DirectiveAnnotation[]
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
node | DirectableObject |
pathToDirectivesInExtensions | string[] |
Returns
Defined in
packages/utils/src/get-directives.ts:36
getDirectivesInExtensions
▸ getDirectivesInExtensions(node, pathToDirectivesInExtensions?): DirectiveAnnotation[]
Parameters
| Name | Type |
|---|---|
node | DirectableObject |
pathToDirectivesInExtensions | string[] |
Returns
Defined in
packages/utils/src/get-directives.ts:11
getDocumentNodeFromSchema
▸ getDocumentNodeFromSchema(schema, options?): DocumentNode
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
options | GetDocumentNodeFromSchemaOptions |
Returns
DocumentNode
Defined in
packages/utils/src/print-schema-with-directives.ts:64
getFieldEntryKey
▸ getFieldEntryKey(node): string
Implements the logic to compute the key of a given field’s entry
Parameters
| Name | Type |
|---|---|
node | FieldNode |
Returns
string
Defined in
packages/utils/src/collectFields.ts:220
getFieldsWithDirectives
▸ getFieldsWithDirectives(documentNode, options?): TypeAndFieldToDirectives
Parameters
| Name | Type |
|---|---|
documentNode | DocumentNode |
options | Options |
Returns
Defined in
packages/utils/src/get-fields-with-directives.ts:25
getImplementingTypes
▸ getImplementingTypes(interfaceName, schema): string[]
Parameters
| Name | Type |
|---|---|
interfaceName | string |
schema | GraphQLSchema |
Returns
string[]
Defined in
packages/utils/src/get-implementing-types.ts:3
getLeadingCommentBlock
▸ getLeadingCommentBlock(node): void | string
Parameters
| Name | Type |
|---|---|
node | Object |
node.loc? | Location |
Returns
void | string
Defined in
packages/utils/src/comments.ts:470
getOperationASTFromDocument
▸ getOperationASTFromDocument(documentNode, operationName?): OperationDefinitionNode
Parameters
| Name | Type |
|---|---|
documentNode | DocumentNode |
operationName? | string |
Returns
OperationDefinitionNode
Defined in
packages/utils/src/getOperationASTFromRequest.ts:5
getOperationASTFromRequest
▸ getOperationASTFromRequest(request): OperationDefinitionNode
Parameters
| Name | Type |
|---|---|
request | ExecutionRequest<any, any, any, Record<string, any>, any> |
Returns
OperationDefinitionNode
Defined in
packages/utils/src/getOperationASTFromRequest.ts:16
getResolversFromSchema
▸ getResolversFromSchema(schema, includeDefaultMergedResolver?): IResolvers
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
includeDefaultMergedResolver? | boolean |
Returns
Defined in
packages/utils/src/getResolversFromSchema.ts:13
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
| Name | Type | Description |
|---|---|---|
info | GraphQLResolveInfo | The info argument to the resolver. |
Returns
string
Defined in
packages/utils/src/getResponseKeyFromInfo.ts:8
getRootTypeMap
▸ getRootTypeMap(schema): Map<OperationTypeNode, GraphQLObjectType<any, any>>
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
Returns
Map<OperationTypeNode, GraphQLObjectType<any, any>>
Defined in
packages/utils/src/rootTypes.ts:35
getRootTypeNames
▸ getRootTypeNames(schema): Set<string>
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
Returns
Set<string>
Defined in
packages/utils/src/rootTypes.ts:21
getRootTypes
▸ getRootTypes(schema): Set<GraphQLObjectType<any, any>>
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
Returns
Set<GraphQLObjectType<any, any>>
Defined in
packages/utils/src/rootTypes.ts:28
hasOwnProperty
▸ hasOwnProperty(obj, prop): boolean
Parameters
| Name | Type |
|---|---|
obj | unknown |
prop | string |
Returns
boolean
Defined in
packages/utils/src/jsutils.ts:30
healSchema
▸ healSchema(schema): GraphQLSchema
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
Returns
GraphQLSchema
Defined in
healTypes
▸ healTypes(originalTypeMap, directives): void
Parameters
| Name | Type |
|---|---|
originalTypeMap | Record<string, null | GraphQLNamedType> |
directives | readonly GraphQLDirective[] |
Returns
void
Defined in
implementsAbstractType
▸ implementsAbstractType(schema, typeA, typeB): boolean
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
typeA | Maybe<GraphQLType> |
typeB | Maybe<GraphQLType> |
Returns
boolean
Defined in
packages/utils/src/implementsAbstractType.ts:4
isAsyncIterable
▸ isAsyncIterable<T>(value): value is AsyncIterable<T, any, any>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
value | any |
Returns
value is AsyncIterable<T, any, any>
Defined in
packages/utils/src/isAsyncIterable.ts:1
isDescribable
▸ isDescribable(node): node is DescribableASTNodes
Parameters
| Name | Type |
|---|---|
node | ASTNode |
Returns
node is DescribableASTNodes
Defined in
packages/utils/src/parse-graphql-sdl.ts:104
isDocumentNode
▸ isDocumentNode(object): object is DocumentNode
Parameters
| Name | Type |
|---|---|
object | any |
Returns
object is DocumentNode
Defined in
packages/utils/src/isDocumentNode.ts:3
isDocumentString
▸ isDocumentString(str): boolean
Determines if a given input is a valid GraphQL document string.
Parameters
| Name | Type | Description |
|---|---|---|
str | any | The input to validate as a GraphQL document |
Returns
boolean
A boolean indicating whether the input is a valid GraphQL document string
Remarks
This function performs several validation checks:
- Ensures the input is a string
- Filters out strings with invalid document extensions
- Excludes URLs
- Attempts to parse the string as a GraphQL document
Throws
If the document fails to parse and is empty except GraphQL comments
Defined in
packages/utils/src/helpers.ts:51
isIterableObject
▸ isIterableObject(value): value is Iterable<unknown, any, any>
Parameters
| Name | Type |
|---|---|
value | unknown |
Returns
value is Iterable<unknown, any, any>
Defined in
packages/utils/src/jsutils.ts:3
isNamedStub
▸ isNamedStub(type): boolean
Parameters
| Name | Type |
|---|---|
type | GraphQLNamedType |
Returns
boolean
Defined in
isObjectLike
▸ isObjectLike(value): value is Object
Parameters
| Name | Type |
|---|---|
value | unknown |
Returns
value is Object
Defined in
packages/utils/src/jsutils.ts:7
isPromise
▸ isPromise<T>(value): value is Promise<T>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
value | MaybePromise<T> |
Returns
value is Promise<T>
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:3
▸ isPromise<T>(value): value is PromiseLike<T>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
value | MaybePromiseLike<T> |
Returns
value is PromiseLike<T>
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:4
isSome
▸ isSome<T>(input): input is Exclude<T, undefined | null>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
input | T |
Returns
input is Exclude<T, undefined | null>
Defined in
packages/utils/src/helpers.ts:132
isUrl
▸ isUrl(str): boolean
Checks if the given string is a valid URL.
Parameters
| Name | Type | Description |
|---|---|---|
str | string | The string to validate as a URL |
Returns
boolean
A boolean indicating whether the string is a valid URL
Remarks
This function first attempts to use the URL.canParse method if available.
If not, it falls back to creating a new URL object to validate the string.
Defined in
packages/utils/src/helpers.ts:15
isValidPath
▸ isValidPath(str): boolean
Checkes whether the str contains any path illegal characters.
A string may sometimes look like a path but is not (like an SDL of a simple GraphQL schema). To make sure we don’t yield false-positives in such cases, we disallow new lines in paths (even though most Unix systems support new lines in file names).
Parameters
| Name | Type |
|---|---|
str | any |
Returns
boolean
Defined in
packages/utils/src/helpers.ts:90
makeDeprecatedDirective
▸ makeDeprecatedDirective<TDirectiveNode>(deprecationReason): TDirectiveNode
Type parameters
| Name | Type |
|---|---|
TDirectiveNode | extends DirectiveNode |
Parameters
| Name | Type |
|---|---|
deprecationReason | string |
Returns
TDirectiveNode
Defined in
packages/utils/src/print-schema-with-directives.ts:493
makeDirectiveNode
▸ makeDirectiveNode<TDirectiveNode>(name, args?, directive?): TDirectiveNode
Type parameters
| Name | Type |
|---|---|
TDirectiveNode | extends DirectiveNode |
Parameters
| Name | Type |
|---|---|
name | string |
args? | Record<string, any> |
directive? | Maybe<GraphQLDirective> |
Returns
TDirectiveNode
Defined in
packages/utils/src/print-schema-with-directives.ts:499
makeDirectiveNodes
▸ makeDirectiveNodes<TDirectiveNode>(schema, directiveValues): TDirectiveNode[]
Type parameters
| Name | Type |
|---|---|
TDirectiveNode | extends DirectiveNode |
Parameters
| Name | Type |
|---|---|
schema | Maybe<GraphQLSchema> |
directiveValues | DirectiveAnnotation[] |
Returns
TDirectiveNode[]
Defined in
packages/utils/src/print-schema-with-directives.ts:540
mapAsyncIterator
▸ mapAsyncIterator<T, U>(iterator, onNext, onError?, onEnd?): 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
| Name | Type |
|---|---|
iterator | AsyncIterable<T, any, any> | AsyncIterator<T, any, any> |
onNext | (value: T) => MaybePromise<U> |
onError? | any |
onEnd? | () => MaybePromise<void> |
Returns
AsyncIterableIterator<U>
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:29
mapMaybePromise
▸ mapMaybePromise<TInput, TOutput>(input, onSuccess, onError?): MaybePromise<TOutput>
Type parameters
| Name |
|---|
TInput |
TOutput |
Parameters
| Name | Type |
|---|---|
input | MaybePromise<TInput> |
onSuccess | (value: TInput) => MaybePromise<TOutput> |
onError? | (err: any) => MaybePromise<TOutput> |
Returns
MaybePromise<TOutput>
Deprecated
Use handleMaybePromise instead.
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:23
▸ mapMaybePromise<TInput, TOutput>(input, onSuccess, onError?): MaybePromiseLike<TOutput>
Type parameters
| Name |
|---|
TInput |
TOutput |
Parameters
| Name | Type |
|---|---|
input | MaybePromiseLike<TInput> |
onSuccess | (value: TInput) => MaybePromiseLike<TOutput> |
onError? | (err: any) => MaybePromiseLike<TOutput> |
Returns
MaybePromiseLike<TOutput>
Defined in
node_modules/@whatwg-node/promise-helpers/typings/index.d.ts:24
mapSchema
▸ mapSchema(schema, schemaMapper?): GraphQLSchema
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
schemaMapper | SchemaMapper |
Returns
GraphQLSchema
Defined in
packages/utils/src/mapSchema.ts:47
memoize1
▸ memoize1<F>(fn): F
Type parameters
| Name | Type |
|---|---|
F | extends (a1: any) => any |
Parameters
| Name | Type |
|---|---|
fn | F |
Returns
F
Defined in
packages/utils/src/memoize.ts:1
memoize2
▸ memoize2<F>(fn): F
Type parameters
| Name | Type |
|---|---|
F | extends (a1: any, a2: any) => any |
Parameters
| Name | Type |
|---|---|
fn | F |
Returns
F
Defined in
packages/utils/src/memoize.ts:18
memoize2of4
▸ memoize2of4<F>(fn): F
Type parameters
| Name | Type |
|---|---|
F | extends (a1: any, a2: any, a3: any, a4: any) => any |
Parameters
| Name | Type |
|---|---|
fn | F |
Returns
F
Defined in
packages/utils/src/memoize.ts:196
memoize2of5
▸ memoize2of5<F>(fn): F
Type parameters
| Name | Type |
|---|---|
F | extends (a1: any, a2: any, a3: any, a4: any, a5: any) => any |
Parameters
| Name | Type |
|---|---|
fn | F |
Returns
F
Defined in
packages/utils/src/memoize.ts:222
memoize3
▸ memoize3<F>(fn): F
Type parameters
| Name | Type |
|---|---|
F | extends (a1: any, a2: any, a3: any) => any |
Parameters
| Name | Type |
|---|---|
fn | F |
Returns
F
Defined in
packages/utils/src/memoize.ts:44
memoize4
▸ memoize4<F>(fn): F
Type parameters
| Name | Type |
|---|---|
F | extends (a1: any, a2: any, a3: any, a4: any) => any |
Parameters
| Name | Type |
|---|---|
fn | F |
Returns
F
Defined in
packages/utils/src/memoize.ts:81
memoize5
▸ memoize5<F>(fn): F
Type parameters
| Name | Type |
|---|---|
F | extends (a1: any, a2: any, a3: any, a4: any, a5: any) => any |
Parameters
| Name | Type |
|---|---|
fn | F |
Returns
F
Defined in
packages/utils/src/memoize.ts:131
mergeDeep
▸ mergeDeep<S>(sources, respectPrototype?, respectArrays?, respectArrayLength?): UnboxIntersection<UnionToIntersection<BoxedTupleTypes<S>>> & any
Type parameters
| Name | Type |
|---|---|
S | extends any[] |
Parameters
| Name | Type | Default value |
|---|---|---|
sources | S | undefined |
respectPrototype | boolean | false |
respectArrays | boolean | false |
respectArrayLength | boolean | false |
Returns
UnboxIntersection<UnionToIntersection<BoxedTupleTypes<S>>> & any
Defined in
packages/utils/src/mergeDeep.ts:9
mergeIncrementalResult
▸ mergeIncrementalResult(«destructured»): void
Parameters
| Name | Type |
|---|---|
«destructured» | Object |
› executionResult | ExecutionResult<any, any> |
› incrementalResult | ExecutionResult<any, any> |
Returns
void
Defined in
packages/utils/src/mergeIncrementalResult.ts:5
modifyObjectFields
▸ modifyObjectFields(schema, typeName, testFn, newFields): [GraphQLSchema, GraphQLFieldConfigMap<any, any>]
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
typeName | string |
testFn | (fieldName: string, field: GraphQLFieldConfig<any, any, any>) => boolean |
newFields | GraphQLFieldConfigMap<any, any> |
Returns
[GraphQLSchema, GraphQLFieldConfigMap<any, any>]
Defined in
packages/utils/src/fields.ts:113
nodeToString
▸ nodeToString(a): string
Parameters
| Name | Type |
|---|---|
a | ASTNode |
Returns
string
Defined in
packages/utils/src/helpers.ts:106
observableToAsyncIterable
▸ observableToAsyncIterable<T>(observable): AsyncIterableIterator<T>
Type parameters
| Name |
|---|
T |
Parameters
| Name | Type |
|---|---|
observable | Observable<T> |
Returns
AsyncIterableIterator<T>
Defined in
packages/utils/src/observableToAsyncIterable.ts:17
parseGraphQLJSON
▸ parseGraphQLJSON(location, jsonContent, options): Source
Parameters
| Name | Type |
|---|---|
location | string |
jsonContent | string |
options | SchemaPrintOptions & ParseOptions |
Returns
Defined in
packages/utils/src/parse-graphql-json.ts:21
parseGraphQLSDL
▸ parseGraphQLSDL(location, rawSDL, options?): Object
Parameters
| Name | Type |
|---|---|
location | undefined | string |
rawSDL | string |
options | GraphQLParseOptions |
Returns
Object
| Name | Type |
|---|---|
document | DocumentNode |
location | undefined | string |
Defined in
packages/utils/src/parse-graphql-sdl.ts:15
parseInputValue
▸ parseInputValue(type, value): any
Parameters
| Name | Type |
|---|---|
type | GraphQLInputType |
value | any |
Returns
any
Defined in
packages/utils/src/transformInputValue.ts:68
parseInputValueLiteral
▸ parseInputValueLiteral(type, value): any
Parameters
| Name | Type |
|---|---|
type | GraphQLInputType |
value | any |
Returns
any
Defined in
packages/utils/src/transformInputValue.ts:78
parseSelectionSet
▸ parseSelectionSet(selectionSet, options?): SelectionSetNode
Parameters
| Name | Type |
|---|---|
selectionSet | string |
options? | GraphQLParseOptions |
Returns
SelectionSetNode
Defined in
packages/utils/src/selectionSets.ts:4
pathToArray
▸ pathToArray(path): (string | number)[]
Given a Path, return an Array of the path keys.
Parameters
| Name | Type |
|---|---|
path | Maybe<Readonly<Path>> |
Returns
(string | number)[]
Defined in
printComment
▸ printComment(comment): string
Parameters
| Name | Type |
|---|---|
comment | string |
Returns
string
Defined in
packages/utils/src/comments.ts:89
printPathArray
▸ printPathArray(path): string
Build a string describing the path.
Parameters
| Name | Type |
|---|---|
path | readonly (string | number)[] |
Returns
string
Defined in
printSchemaWithDirectives
▸ printSchemaWithDirectives(schema, options?): string
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
options | PrintSchemaWithDirectivesOptions |
Returns
string
Defined in
packages/utils/src/print-schema-with-directives.ts:118
printWithComments
▸ printWithComments(ast): string
Converts an AST into a string, using one set of reasonable formatting rules.
Parameters
| Name | Type |
|---|---|
ast | ASTNode |
Returns
string
Defined in
packages/utils/src/comments.ts:442
promiseReduce
▸ promiseReduce<T, U>(values, callbackFn, initialValue): MaybePromise<U>
Type parameters
| Name |
|---|
T |
U |
Parameters
| Name | Type |
|---|---|
values | Iterable<T, any, any> |
callbackFn | (accumulator: U, currentValue: T) => MaybePromise<U> |
initialValue | MaybePromise<U> |
Returns
MaybePromise<U>
Defined in
packages/utils/src/jsutils.ts:13
pruneSchema
▸ pruneSchema(schema, options?): GraphQLSchema
Prunes the provided schema, removing unused and empty types
Parameters
| Name | Type | Description |
|---|---|---|
schema | GraphQLSchema | The schema to prune |
options | PruneSchemaOptions | Additional options for removing unused types from the schema |
Returns
GraphQLSchema
Defined in
packages/utils/src/prune.ts:25
pushComment
▸ pushComment(node, entity, field?, argument?): void
Parameters
| Name | Type |
|---|---|
node | any |
entity | string |
field? | string |
argument? | string |
Returns
void
Defined in
packages/utils/src/comments.ts:63
registerAbortSignalListener
▸ registerAbortSignalListener(signal, listener): void
Register an AbortSignal handler for a signal. This helper function mainly exists to work around the “possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.” warning occuring on Node.js
Parameters
| Name | Type |
|---|---|
signal | AbortSignal |
listener | () => void |
Returns
void
Defined in
packages/utils/src/registerAbortSignalListener.ts:26
relocatedError
▸ relocatedError(originalError, path?): GraphQLError
Parameters
| Name | Type |
|---|---|
originalError | GraphQLError |
path? | readonly (string | number)[] |
Returns
GraphQLError
Defined in
packages/utils/src/errors.ts:63
removeObjectFields
▸ removeObjectFields(schema, typeName, testFn): [GraphQLSchema, GraphQLFieldConfigMap<any, any>]
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
typeName | string |
testFn | (fieldName: string, field: GraphQLFieldConfig<any, any, any>) => boolean |
Returns
[GraphQLSchema, GraphQLFieldConfigMap<any, any>]
Defined in
packages/utils/src/fields.ts:51
renameType
▸ renameType(type, newTypeName): GraphQLObjectType
Parameters
| Name | Type |
|---|---|
type | GraphQLObjectType<any, any> |
newTypeName | string |
Returns
GraphQLObjectType
Defined in
packages/utils/src/renameType.ts:17
▸ renameType(type, newTypeName): GraphQLInterfaceType
Parameters
| Name | Type |
|---|---|
type | GraphQLInterfaceType |
newTypeName | string |
Returns
GraphQLInterfaceType
Defined in
packages/utils/src/renameType.ts:18
▸ renameType(type, newTypeName): GraphQLUnionType
Parameters
| Name | Type |
|---|---|
type | GraphQLUnionType |
newTypeName | string |
Returns
GraphQLUnionType
Defined in
packages/utils/src/renameType.ts:19
▸ renameType(type, newTypeName): GraphQLEnumType
Parameters
| Name | Type |
|---|---|
type | GraphQLEnumType |
newTypeName | string |
Returns
GraphQLEnumType
Defined in
packages/utils/src/renameType.ts:20
▸ renameType(type, newTypeName): GraphQLScalarType
Parameters
| Name | Type |
|---|---|
type | GraphQLScalarType<unknown, unknown> |
newTypeName | string |
Returns
GraphQLScalarType
Defined in
packages/utils/src/renameType.ts:21
▸ renameType(type, newTypeName): GraphQLInputObjectType
Parameters
| Name | Type |
|---|---|
type | GraphQLInputObjectType |
newTypeName | string |
Returns
GraphQLInputObjectType
Defined in
packages/utils/src/renameType.ts:22
▸ renameType(type, newTypeName): GraphQLNamedType
Parameters
| Name | Type |
|---|---|
type | GraphQLNamedType |
newTypeName | string |
Returns
GraphQLNamedType
Defined in
packages/utils/src/renameType.ts:26
resetComments
▸ resetComments(): void
Returns
void
Defined in
packages/utils/src/comments.ts:24
rewireTypes
▸ rewireTypes(originalTypeMap, directives): Object
Parameters
| Name | Type |
|---|---|
originalTypeMap | Record<string, null | GraphQLNamedType> |
directives | readonly GraphQLDirective[] |
Returns
Object
| Name | Type |
|---|---|
directives | GraphQLDirective[] |
typeMap | Record<string, GraphQLNamedType> |
Defined in
packages/utils/src/rewire.ts:30
selectObjectFields
▸ selectObjectFields(schema, typeName, testFn): GraphQLFieldConfigMap<any, any>
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
typeName | string |
testFn | (fieldName: string, field: GraphQLFieldConfig<any, any, any>) => boolean |
Returns
GraphQLFieldConfigMap<any, any>
Defined in
packages/utils/src/fields.ts:86
serializeInputValue
▸ serializeInputValue(type, value): any
Parameters
| Name | Type |
|---|---|
type | GraphQLInputType |
value | any |
Returns
any
Defined in
packages/utils/src/transformInputValue.ts:58
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
| Name | Type |
|---|---|
variableValues | any |
node | FieldNode | FragmentSpreadNode | InlineFragmentNode |
Returns
boolean
Defined in
packages/utils/src/collectFields.ts:178
transformCommentsToDescriptions
▸ transformCommentsToDescriptions(sourceSdl, options?): DocumentNode
Parameters
| Name | Type |
|---|---|
sourceSdl | string |
options | GraphQLParseOptions |
Returns
DocumentNode
Defined in
packages/utils/src/parse-graphql-sdl.ts:52
transformInputValue
▸ transformInputValue(type, value, inputLeafValueTransformer?, inputObjectValueTransformer?): any
Parameters
| Name | Type | Default value |
|---|---|---|
type | GraphQLInputType | undefined |
value | any | undefined |
inputLeafValueTransformer | Maybe<InputLeafValueTransformer> | null |
inputObjectValueTransformer | Maybe<InputObjectValueTransformer> | null |
Returns
any
Defined in
packages/utils/src/transformInputValue.ts:11
updateArgument
▸ updateArgument(argumentNodes, variableDefinitionsMap, variableValues, argName, varName, type, value): void
Parameters
| Name | Type |
|---|---|
argumentNodes | Record<string, ArgumentNode> |
variableDefinitionsMap | Record<string, VariableDefinitionNode> |
variableValues | Record<string, any> |
argName | string |
varName | string |
type | GraphQLInputType |
value | any |
Returns
void
Defined in
packages/utils/src/updateArgument.ts:4
validateGraphQlDocuments
▸ validateGraphQlDocuments(schema, documents, rules?): readonly GraphQLError[]
Parameters
| Name | Type |
|---|---|
schema | GraphQLSchema |
documents | DocumentNode[] |
rules | ValidationRule[] |
Returns
readonly GraphQLError[]
Defined in
packages/utils/src/validate-documents.ts:15
valueMatchesCriteria
▸ valueMatchesCriteria(value, criteria): boolean
Parameters
| Name | Type |
|---|---|
value | any |
criteria | any |
Returns
boolean
Defined in
packages/utils/src/valueMatchesCriteria.ts:1
visitData
▸ visitData(data, enter?, leave?): any
Parameters
| Name | Type |
|---|---|
data | any |
enter? | ValueVisitor |
leave? | ValueVisitor |
Returns
any
Defined in
packages/utils/src/visitResult.ts:54
visitErrors
▸ visitErrors(errors, visitor): GraphQLError[]
Parameters
| Name | Type |
|---|---|
errors | readonly GraphQLError[] |
visitor | (error: GraphQLError) => GraphQLError |
Returns
GraphQLError[]
Defined in
packages/utils/src/visitResult.ts:75
visitResult
▸ visitResult(result, request, schema, resultVisitorMap?, errorVisitorMap?): any
Parameters
| Name | Type |
|---|---|
result | ExecutionResult<any, any> |
request | ExecutionRequest<any, any, any, Record<string, any>, any> |
schema | GraphQLSchema |
resultVisitorMap? | ResultVisitorMap |
errorVisitorMap? | ErrorVisitorMap |
Returns
any