@graphql-tools/delegate
Classes
Interfaces
- BatchingOptions
- DelegationContext
- ExternalObject
- ICreateProxyingResolverOptions
- ICreateRequest
- IDelegateRequestOptions
- IDelegateToSchemaOptions
- MergedFieldConfig
- MergedTypeConfig
- MergedTypeEntryPoint
- MergedTypeInfo
- MergedTypeResolverOptions
- StitchingInfo
- SubschemaConfig
- Transform
Type Aliases
- CreateProxyingResolverFn
- DelegationPlanBuilder
- MergedTypeResolver
- RequestTransform
- ResultTransform
- SchemaTransform
Functions
- annotateExternalObject
- applySchemaTransforms
- cloneSubschemaConfig
- createDefaultExecutor
- createRequest
- defaultMergedResolver
- delegateRequest
- delegateToSchema
- getActualFieldNodes
- getDelegatingOperation
- getSubschema
- getUnpathedErrors
- isExternalObject
- isSubschema
- isSubschemaConfig
- mergeFields
- resolveExternalValue
Type Aliases
CreateProxyingResolverFn
Ƭ CreateProxyingResolverFn<TContext
>: (options
: ICreateProxyingResolverOptions
<TContext
>) => GraphQLFieldResolver
<any
, TContext
>
Type parameters
Name | Type |
---|---|
TContext | Record <string , any > |
Type declaration
▸ (options
): GraphQLFieldResolver
<any
, TContext
>
Parameters
Name | Type |
---|---|
options | ICreateProxyingResolverOptions <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
Name | Type |
---|---|
schema | GraphQLSchema |
sourceSubschema | Subschema <any , any , any , any > |
variableValues | Record <string , any > |
fragments | Record <string , FragmentDefinitionNode > |
fieldNodes | FieldNode [] |
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
Name | Type |
---|---|
TContext | Record <string , any > |
Type declaration
▸ (originalResult
, context
, info
, subschema
, selectionSet
, key
, type
): any
Parameters
Name | Type |
---|---|
originalResult | any |
context | TContext |
info | GraphQLResolveInfo |
subschema | Subschema <any , any , any , TContext > |
selectionSet | SelectionSetNode |
key | any | undefined |
type | GraphQLOutputType |
Returns
any
Defined in
packages/delegate/src/types.ts:193
RequestTransform
Ƭ RequestTransform<T
, TContext
>: (originalRequest
: ExecutionRequest
, delegationContext
: DelegationContext
<TContext
>, transformationContext
: T
) => ExecutionRequest
Type parameters
Name | Type |
---|---|
T | Record <string , any > |
TContext | Record <any , string > |
Type declaration
▸ (originalRequest
, delegationContext
, transformationContext
): ExecutionRequest
Parameters
Name | Type |
---|---|
originalRequest | ExecutionRequest |
delegationContext | DelegationContext <TContext > |
transformationContext | T |
Returns
Defined in
packages/delegate/src/types.ts:28
ResultTransform
Ƭ ResultTransform<T
, TContext
>: (originalResult
: ExecutionResult
, delegationContext
: DelegationContext
<TContext
>, transformationContext
: T
) => ExecutionResult
Type parameters
Name | Type |
---|---|
T | Record <string , any > |
TContext | Record <any , string > |
Type declaration
▸ (originalResult
, delegationContext
, transformationContext
): ExecutionResult
Parameters
Name | Type |
---|---|
originalResult | ExecutionResult |
delegationContext | DelegationContext <TContext > |
transformationContext | T |
Returns
Defined in
packages/delegate/src/types.ts:33
SchemaTransform
Ƭ SchemaTransform<TContext
>: (originalWrappingSchema
: GraphQLSchema
, subschemaConfig
: SubschemaConfig
<any
, any
, any
, TContext
>) => GraphQLSchema
Type parameters
Name | Type |
---|---|
TContext | Record <any , string > |
Type declaration
▸ (originalWrappingSchema
, subschemaConfig
): GraphQLSchema
Parameters
Name | Type |
---|---|
originalWrappingSchema | GraphQLSchema |
subschemaConfig | SubschemaConfig <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
Name | Type |
---|---|
object | any |
errors | GraphQLError [] |
subschema | undefined | GraphQLSchema | SubschemaConfig <any , any , any , TContext > |
subschemaMap | Record <string , GraphQLSchema | SubschemaConfig <any , any , any , Record <string , any >>> |
Returns
Defined in
packages/delegate/src/mergeFields.ts:30
applySchemaTransforms
▸ applySchemaTransforms(originalWrappingSchema
, subschemaConfig
): GraphQLSchema
Parameters
Name | Type |
---|---|
originalWrappingSchema | GraphQLSchema |
subschemaConfig | SubschemaConfig <any , any , any , any > |
Returns
GraphQLSchema
Defined in
packages/delegate/src/applySchemaTransforms.ts:6
cloneSubschemaConfig
▸ cloneSubschemaConfig(subschemaConfig
): SubschemaConfig
Parameters
Name | Type |
---|---|
subschemaConfig | SubschemaConfig <any , any , any , Record <string , any >> |
Returns
Defined in
packages/delegate/src/subschemaConfig.ts:7
createDefaultExecutor
▸ createDefaultExecutor(schema
): Executor
Parameters
Name | Type |
---|---|
schema | GraphQLSchema |
Returns
Defined in
packages/delegate/src/delegateToSchema.ts:237
createRequest
▸ createRequest(«destructured»
): ExecutionRequest
Parameters
Name | Type |
---|---|
«destructured» | ICreateRequest |
Returns
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
Name | Type |
---|---|
parent | ExternalObject <Record <string , any >> |
args | Record <string , any > |
context | Record <string , any > |
info | GraphQLResolveInfo |
Returns
any
Defined in
packages/delegate/src/defaultMergedResolver.ts:13
delegateRequest
▸ delegateRequest<TContext
, TArgs
>(options
): any
Type parameters
Name | Type |
---|---|
TContext | extends Record <string , any > = Record <string , any > |
TArgs | extends Record <string , any > = any |
Parameters
Name | Type |
---|---|
options | IDelegateRequestOptions <TContext , TArgs > |
Returns
any
Defined in
packages/delegate/src/delegateToSchema.ts:89
delegateToSchema
▸ delegateToSchema<TContext
, TArgs
>(options
): any
Type parameters
Name | Type |
---|---|
TContext | extends Record <string , any > = Record <string , any > |
TArgs | extends Record <string , any > = any |
Parameters
Name | Type |
---|---|
options | IDelegateToSchemaOptions <TContext , TArgs > |
Returns
any
Defined in
packages/delegate/src/delegateToSchema.ts:37
getActualFieldNodes
▸ getActualFieldNodes(fieldNode
): FieldNode
[]
Parameters
Name | Type |
---|---|
fieldNode | FieldNode |
Returns
FieldNode
[]
Defined in
packages/delegate/src/mergeFields.ts:58
getDelegatingOperation
▸ getDelegatingOperation(parentType
, schema
): OperationTypeNode
Parameters
Name | Type |
---|---|
parentType | GraphQLObjectType <any , any > |
schema | GraphQLSchema |
Returns
OperationTypeNode
Defined in
packages/delegate/src/createRequest.ts:27
getSubschema
▸ getSubschema(object
, responseKey
): GraphQLSchema
| SubschemaConfig
Parameters
Name | Type |
---|---|
object | ExternalObject <Record <string , any >> |
responseKey | string |
Returns
GraphQLSchema
| SubschemaConfig
Defined in
packages/delegate/src/mergeFields.ts:44
getUnpathedErrors
▸ getUnpathedErrors(object
): GraphQLError
[]
Parameters
Name | Type |
---|---|
object | ExternalObject <Record <string , any >> |
Returns
GraphQLError
[]
Defined in
packages/delegate/src/mergeFields.ts:51
isExternalObject
▸ isExternalObject(data
): data is ExternalObject<Record<string, any>>
Parameters
Name | Type |
---|---|
data | any |
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
Name | Type |
---|---|
value | any |
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
Name | Type |
---|---|
value | any |
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
Name | Type |
---|---|
mergedTypeInfo | MergedTypeInfo <Record <string , any >> |
object | any |
sourceSubschema | Subschema <any , any , any , TContext > |
context | any |
info | GraphQLResolveInfo |
Returns
MaybePromise
<any
>
Defined in
packages/delegate/src/mergeFields.ts:62
resolveExternalValue
▸ resolveExternalValue<TContext
>(result
, unpathedErrors
, subschema
, context?
, info?
, returnType?
, skipTypeMerging?
): any
Type parameters
Name | Type |
---|---|
TContext | extends Record <string , any > |
Parameters
Name | Type |
---|---|
result | any |
unpathedErrors | GraphQLError [] |
subschema | GraphQLSchema | SubschemaConfig <any , any , any , TContext > |
context? | Record <string , any > |
info? | GraphQLResolveInfo |
returnType | GraphQLOutputType |
skipTypeMerging? | boolean |
Returns
any