Catch the highlights of GraphQLConf 2023! Click for recordings. Or check out our recap blog post.
Docs
API Reference
Packages
delegate

@graphql-tools/delegate

Classes

Interfaces

Type Aliases

Functions

Type Aliases

CreateProxyingResolverFn

Ƭ CreateProxyingResolverFn<TContext>: (options: ICreateProxyingResolverOptions<TContext>) => GraphQLFieldResolver<any, TContext>

Type parameters

NameType
TContextRecord<string, any>

Type declaration

▸ (options): GraphQLFieldResolver<any, TContext>

Parameters
NameType
optionsICreateProxyingResolverOptions<TContext>
Returns

GraphQLFieldResolver<any, TContext>

Defined in

packages/delegate/src/types.ts:141


DelegationPlanBuilder

Ƭ DelegationPlanBuilder: (schema: GraphQLSchema, sourceSubschema: Subschema<any, any, any, any>, variableValues: Record<string, any>, fragments: Record<string, FragmentDefinitionNode>, fieldNodes: FieldNode[]) => Map<Subschema, SelectionSetNode>[]

Type declaration

▸ (schema, sourceSubschema, variableValues, fragments, fieldNodes): Map<Subschema, SelectionSetNode>[]

Parameters
NameType
schemaGraphQLSchema
sourceSubschemaSubschema<any, any, any, any>
variableValuesRecord<string, any>
fragmentsRecord<string, FragmentDefinitionNode>
fieldNodesFieldNode[]
Returns

Map<Subschema, SelectionSetNode>[]

Defined in

packages/delegate/src/types.ts:108


MergedTypeResolver

Ƭ MergedTypeResolver<TContext>: (originalResult: any, context: TContext, info: GraphQLResolveInfo, subschema: Subschema<any, any, any, TContext>, selectionSet: SelectionSetNode, key: any | undefined, type: GraphQLOutputType) => any

Type parameters

NameType
TContextRecord<string, any>

Type declaration

▸ (originalResult, context, info, subschema, selectionSet, key, type): any

Parameters
NameType
originalResultany
contextTContext
infoGraphQLResolveInfo
subschemaSubschema<any, any, any, TContext>
selectionSetSelectionSetNode
keyany | undefined
typeGraphQLOutputType
Returns

any

Defined in

packages/delegate/src/types.ts:192


RequestTransform

Ƭ RequestTransform<T, TContext>: (originalRequest: ExecutionRequest, delegationContext: DelegationContext<TContext>, transformationContext: T) => ExecutionRequest

Type parameters

NameType
TRecord<string, any>
TContextRecord<any, string>

Type declaration

▸ (originalRequest, delegationContext, transformationContext): ExecutionRequest

Parameters
NameType
originalRequestExecutionRequest
delegationContextDelegationContext<TContext>
transformationContextT
Returns

ExecutionRequest

Defined in

packages/delegate/src/types.ts:28


ResultTransform

Ƭ ResultTransform<T, TContext>: (originalResult: ExecutionResult, delegationContext: DelegationContext<TContext>, transformationContext: T) => ExecutionResult

Type parameters

NameType
TRecord<string, any>
TContextRecord<any, string>

Type declaration

▸ (originalResult, delegationContext, transformationContext): ExecutionResult

Parameters
NameType
originalResultExecutionResult
delegationContextDelegationContext<TContext>
transformationContextT
Returns

ExecutionResult

Defined in

packages/delegate/src/types.ts:33


SchemaTransform

Ƭ SchemaTransform<TContext>: (originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig<any, any, any, TContext>) => GraphQLSchema

Type parameters

NameType
TContextRecord<any, string>

Type declaration

▸ (originalWrappingSchema, subschemaConfig): GraphQLSchema

Parameters
NameType
originalWrappingSchemaGraphQLSchema
subschemaConfigSubschemaConfig<any, any, any, TContext>
Returns

GraphQLSchema

Defined in

packages/delegate/src/types.ts:24

Functions

annotateExternalObject

annotateExternalObject<TContext>(object, errors, subschema, subschemaMap): ExternalObject

Type parameters

Name
TContext

Parameters

NameType
objectany
errorsGraphQLError[]
subschemaundefined | GraphQLSchema | SubschemaConfig<any, any, any, TContext>
subschemaMapRecord<string, GraphQLSchema | SubschemaConfig<any, any, any, Record<string, any>>>

Returns

ExternalObject

Defined in

packages/delegate/src/mergeFields.ts:30


applySchemaTransforms

applySchemaTransforms(originalWrappingSchema, subschemaConfig): GraphQLSchema

Parameters

NameType
originalWrappingSchemaGraphQLSchema
subschemaConfigSubschemaConfig<any, any, any, any>

Returns

GraphQLSchema

Defined in

packages/delegate/src/applySchemaTransforms.ts:6


cloneSubschemaConfig

cloneSubschemaConfig(subschemaConfig): SubschemaConfig

Parameters

NameType
subschemaConfigSubschemaConfig<any, any, any, Record<string, any>>

Returns

SubschemaConfig

Defined in

packages/delegate/src/subschemaConfig.ts:7


createDefaultExecutor

createDefaultExecutor(schema): Executor

Parameters

NameType
schemaGraphQLSchema

Returns

Executor

Defined in

packages/delegate/src/delegateToSchema.ts:237


createRequest

createRequest(«destructured»): ExecutionRequest

Parameters

NameType
«destructured»ICreateRequest

Returns

ExecutionRequest

Defined in

packages/delegate/src/createRequest.ts:40


defaultMergedResolver

defaultMergedResolver(parent, args, context, info): any

Resolver that knows how to: a) handle aliases for proxied schemas b) handle errors from proxied schemas c) handle external to internal enum conversion

Parameters

NameType
parentExternalObject<Record<string, any>>
argsRecord<string, any>
contextRecord<string, any>
infoGraphQLResolveInfo

Returns

any

Defined in

packages/delegate/src/defaultMergedResolver.ts:13


delegateRequest

delegateRequest<TContext, TArgs>(options): any

Type parameters

NameType
TContextextends Record<string, any> = Record<string, any>
TArgsextends Record<string, any> = any

Parameters

NameType
optionsIDelegateRequestOptions<TContext, TArgs>

Returns

any

Defined in

packages/delegate/src/delegateToSchema.ts:89


delegateToSchema

delegateToSchema<TContext, TArgs>(options): any

Type parameters

NameType
TContextextends Record<string, any> = Record<string, any>
TArgsextends Record<string, any> = any

Parameters

NameType
optionsIDelegateToSchemaOptions<TContext, TArgs>

Returns

any

Defined in

packages/delegate/src/delegateToSchema.ts:37


getActualFieldNodes

getActualFieldNodes(fieldNode): FieldNode[]

Parameters

NameType
fieldNodeFieldNode

Returns

FieldNode[]

Defined in

packages/delegate/src/mergeFields.ts:58


getDelegatingOperation

getDelegatingOperation(parentType, schema): OperationTypeNode

Parameters

NameType
parentTypeGraphQLObjectType<any, any>
schemaGraphQLSchema

Returns

OperationTypeNode

Defined in

packages/delegate/src/createRequest.ts:27


getSubschema

getSubschema(object, responseKey): GraphQLSchema | SubschemaConfig

Parameters

NameType
objectExternalObject<Record<string, any>>
responseKeystring

Returns

GraphQLSchema | SubschemaConfig

Defined in

packages/delegate/src/mergeFields.ts:44


getUnpathedErrors

getUnpathedErrors(object): GraphQLError[]

Parameters

NameType
objectExternalObject<Record<string, any>>

Returns

GraphQLError[]

Defined in

packages/delegate/src/mergeFields.ts:51


isExternalObject

isExternalObject(data): data is ExternalObject<Record<string, any>>

Parameters

NameType
dataany

Returns

data is ExternalObject<Record<string, any>>

Defined in

packages/delegate/src/mergeFields.ts:26


isSubschema

isSubschema(value): value is Subschema<any, any, any, Record<string, any>>

Parameters

NameType
valueany

Returns

value is Subschema<any, any, any, Record<string, any>>

Defined in

packages/delegate/src/Subschema.ts:12


isSubschemaConfig

isSubschemaConfig(value): value is SubschemaConfig<any, any, any, any>

Parameters

NameType
valueany

Returns

value is SubschemaConfig<any, any, any, any>

Defined in

packages/delegate/src/subschemaConfig.ts:3


mergeFields

mergeFields<TContext>(mergedTypeInfo, object, sourceSubschema, context, info): MaybePromise<any>

Type parameters

Name
TContext

Parameters

NameType
mergedTypeInfoMergedTypeInfo<Record<string, any>>
objectany
sourceSubschemaSubschema<any, any, any, TContext>
contextany
infoGraphQLResolveInfo

Returns

MaybePromise<any>

Defined in

packages/delegate/src/mergeFields.ts:62


resolveExternalValue

resolveExternalValue<TContext>(result, unpathedErrors, subschema, context?, info?, returnType?, skipTypeMerging?): any

Type parameters

NameType
TContextextends Record<string, any>

Parameters

NameType
resultany
unpathedErrorsGraphQLError[]
subschemaGraphQLSchema | SubschemaConfig<any, any, any, TContext>
context?Record<string, any>
info?GraphQLResolveInfo
returnTypeGraphQLOutputType
skipTypeMerging?boolean

Returns

any

Defined in

packages/delegate/src/resolveExternalValue.ts:19