@graphql-tools/delegate

Interfaces#

Type aliases#

Functions#

Type aliases#

AsyncExecutor#

Ƭ AsyncExecutor: <TReturn, TArgs, TContext\>(params: ExecutionParams<TArgs, TContext\>) => Promise<ExecutionResult<TReturn\>\>

Defined in: packages/delegate/src/types.ts:130


CreateProxyingResolverFn#

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

Defined in: packages/delegate/src/types.ts:154


DelegationBinding#

Ƭ DelegationBinding: (delegationContext: DelegationContext) => Transform[]

Defined in: packages/delegate/src/types.ts:60


Executor#

Ƭ Executor: <TReturn, TArgs, TContext\>(params: ExecutionParams<TArgs, TContext\>) => ExecutionResult<TReturn\> | Promise<ExecutionResult<TReturn\>\>

Defined in: packages/delegate/src/types.ts:140


MergedTypeResolver#

Ƭ MergedTypeResolver: (originalResult: any, context: Record<string, any\>, info: GraphQLResolveInfo, subschema: GraphQLSchema | SubschemaConfig, selectionSet: SelectionSetNode, key?: any) => any

Defined in: packages/delegate/src/types.ts:193


RequestTransform#

Ƭ RequestTransform<T\>: (originalRequest: Request, delegationContext: DelegationContext, transformationContext: T) => Request

Type parameters:#

NameDefault
TRecord<string, any\>

Defined in: packages/delegate/src/types.ts:28


ResultTransform#

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

Type parameters:#

NameDefault
TRecord<string, any\>

Defined in: packages/delegate/src/types.ts:33


SchemaTransform#

Ƭ SchemaTransform: (originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema) => GraphQLSchema

Defined in: packages/delegate/src/types.ts:23


Subscriber#

Ƭ Subscriber: <TReturn, TArgs, TContext\>(params: ExecutionParams<TArgs, TContext\>) => Promise<AsyncIterator<ExecutionResult<TReturn\>\> | ExecutionResult<TReturn\>\>

Defined in: packages/delegate/src/types.ts:143


SyncExecutor#

Ƭ SyncExecutor: <TReturn, TArgs, TContext\>(params: ExecutionParams<TArgs, TContext\>) => ExecutionResult<TReturn\>

Defined in: packages/delegate/src/types.ts:137

Functions#

annotateExternalObject#

annotateExternalObject(object: any, errors: GraphQLError[], subschema: GraphQLSchema | SubschemaConfig): ExternalObject

Parameters:#

NameType
objectany
errorsGraphQLError[]
subschemaGraphQLSchema | SubschemaConfig

Returns: ExternalObject

Defined in: packages/delegate/src/externalObjects.ts:12


applySchemaTransforms#

applySchemaTransforms(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema?: GraphQLSchema): GraphQLSchema

Parameters:#

NameType
originalWrappingSchemaGraphQLSchema
subschemaConfigSubschemaConfig
transformedSchema?GraphQLSchema

Returns: GraphQLSchema

Defined in: packages/delegate/src/applySchemaTransforms.ts:7


checkResultAndHandleErrors#

checkResultAndHandleErrors(result: ExecutionResult, context: Record<string, any\>, info: GraphQLResolveInfo, responseKey?: string, subschema?: GraphQLSchema | SubschemaConfig, returnType?: GraphQLOutputType, skipTypeMerging?: boolean, onLocatedError?: (originalError: GraphQLError) => GraphQLError): any

Parameters:#

NameTypeDefault value
resultExecutionResult-
contextRecord<string, any\>-
infoGraphQLResolveInfo-
responseKeystring...
subschema?GraphQLSchema | SubschemaConfig-
returnTypeGraphQLOutputType...
skipTypeMerging?boolean-
onLocatedError?(originalError: GraphQLError) => GraphQLError-

Returns: any

Defined in: packages/delegate/src/transforms/CheckResultAndHandleErrors.ts:36


cloneSubschemaConfig#

cloneSubschemaConfig(subschemaConfig: SubschemaConfig): SubschemaConfig

Parameters:#

NameType
subschemaConfigSubschemaConfig

Returns: SubschemaConfig

Defined in: packages/delegate/src/subschemaConfig.ts:7


createRequest#

createRequest(__namedParameters: ICreateRequest): Request

Parameters:#

NameType
__namedParametersICreateRequest

Returns: Request

Defined in: packages/delegate/src/createRequest.ts:56


createRequestFromInfo#

createRequestFromInfo(__namedParameters: ICreateRequestFromInfo): Request

Parameters:#

NameType
__namedParametersICreateRequestFromInfo

Returns: Request

Defined in: packages/delegate/src/createRequest.ts:33


defaultDelegationBinding#

defaultDelegationBinding(delegationContext: DelegationContext): Transform[]

Parameters:#

NameType
delegationContextDelegationContext

Returns: Transform[]

Defined in: packages/delegate/src/delegationBindings.ts:11


defaultMergedResolver#

defaultMergedResolver(parent: ExternalObject, args: Record<string, any\>, context: Record<string, any\>, info: GraphQLResolveInfo): any

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

Parameters:#

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

Returns: any

Defined in: packages/delegate/src/defaultMergedResolver.ts:15


delegateRequest#

delegateRequest(__namedParameters: IDelegateRequestOptions): any

Parameters:#

NameType
__namedParametersIDelegateRequestOptions

Returns: any

Defined in: packages/delegate/src/delegateToSchema.ts:86


delegateToSchema#

delegateToSchema(options: IDelegateToSchemaOptions): any

Parameters:#

NameType
optionsIDelegateToSchemaOptions

Returns: any

Defined in: packages/delegate/src/delegateToSchema.ts:40


getDelegatingOperation#

getDelegatingOperation(parentType: GraphQLObjectType, schema: GraphQLSchema): OperationTypeNode

Parameters:#

NameType
parentTypeGraphQLObjectType
schemaGraphQLSchema

Returns: OperationTypeNode

Defined in: packages/delegate/src/createRequest.ts:23


getSubschema#

getSubschema(object: ExternalObject, responseKey: string): GraphQLSchema | SubschemaConfig

Parameters:#

NameType
objectExternalObject
responseKeystring

Returns: GraphQLSchema | SubschemaConfig

Defined in: packages/delegate/src/externalObjects.ts:25


getUnpathedErrors#

getUnpathedErrors(object: ExternalObject): GraphQLError[]

Parameters:#

NameType
objectExternalObject

Returns: GraphQLError[]

Defined in: packages/delegate/src/externalObjects.ts:29


isExternalObject#

isExternalObject(data: any): data is ExternalObject

Parameters:#

NameType
dataany

Returns: data is ExternalObject

Defined in: packages/delegate/src/externalObjects.ts:8


isSubschema#

isSubschema(value: any): value is Subschema<any, any, any\>

Parameters:#

NameType
valueany

Returns: value is Subschema<any, any, any\>

Defined in: packages/delegate/src/Subschema.ts:15


isSubschemaConfig#

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

Parameters:#

NameType
valueany

Returns: value is SubschemaConfig<any, any, any\>

Defined in: packages/delegate/src/subschemaConfig.ts:3


mergeExternalObjects#

mergeExternalObjects(schema: GraphQLSchema, path: (string | number)[], typeName: string, target: ExternalObject, sources: ExternalObject[], selectionSets: SelectionSetNode[]): ExternalObject

Parameters:#

NameType
schemaGraphQLSchema
path(string | number)[]
typeNamestring
targetExternalObject
sourcesExternalObject[]
selectionSetsSelectionSetNode[]

Returns: ExternalObject

Defined in: packages/delegate/src/externalObjects.ts:33


resolveExternalValue#

resolveExternalValue(result: any, unpathedErrors: GraphQLError[], subschema: GraphQLSchema | SubschemaConfig, context: Record<string, any\>, info: GraphQLResolveInfo, returnType?: GraphQLOutputType, skipTypeMerging?: boolean): any

Parameters:#

NameTypeDefault value
resultany-
unpathedErrorsGraphQLError[]-
subschemaGraphQLSchema | SubschemaConfig-
contextRecord<string, any\>-
infoGraphQLResolveInfo-
returnTypeGraphQLOutputType...
skipTypeMerging?boolean-

Returns: any

Defined in: packages/delegate/src/resolveExternalValue.ts:24