Documentation
API Reference
Packages
stitch

@graphql-tools/stitch

Enumerations

Interfaces

Type Aliases

Functions

Type Aliases

MergeTypeFilter

Ƭ MergeTypeFilter<TContext>: (mergeTypeCandidates: MergeTypeCandidate<TContext>[], typeName: string) => boolean

Type parameters

NameType
TContextRecord<string, any>

Type declaration

▸ (mergeTypeCandidates, typeName): boolean

Parameters
NameType
mergeTypeCandidatesMergeTypeCandidate<TContext>[]
typeNamestring
Returns

boolean

Defined in

packages/stitch/src/types.ts:48


OnTypeConflict

Ƭ OnTypeConflict<TContext>: (left: GraphQLNamedType, right: GraphQLNamedType, info?: { left: { subschema?: GraphQLSchema | SubschemaConfig<any, any, any, TContext> ; transformedSubschema?: Subschema<any, any, any, TContext> } ; right: { subschema?: GraphQLSchema | SubschemaConfig<any, any, any, TContext> ; transformedSubschema?: Subschema<any, any, any, TContext> } }) => GraphQLNamedType

Type parameters

NameType
TContextRecord<string, any>

Type declaration

▸ (left, right, info?): GraphQLNamedType

Parameters
NameType
leftGraphQLNamedType
rightGraphQLNamedType
info?Object
info.leftObject
info.left.subschema?GraphQLSchema | SubschemaConfig<any, any, any, TContext>
info.left.transformedSubschema?Subschema<any, any, any, TContext>
info.rightObject
info.right.subschema?GraphQLSchema | SubschemaConfig<any, any, any, TContext>
info.right.transformedSubschema?Subschema<any, any, any, TContext>
Returns

GraphQLNamedType

Defined in

packages/stitch/src/types.ts:99


SubschemaConfigTransform

Ƭ SubschemaConfigTransform<TContext>: (subschemaConfig: SubschemaConfig<any, any, any, TContext>) => SubschemaConfig<any, any, any, TContext> | SubschemaConfig<any, any, any, TContext>[]

Type parameters

NameType
TContextRecord<string, any>

Type declaration

▸ (subschemaConfig): SubschemaConfig<any, any, any, TContext> | SubschemaConfig<any, any, any, TContext>[]

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

SubschemaConfig<any, any, any, TContext> | SubschemaConfig<any, any, any, TContext>[]

Defined in

packages/stitch/src/types.ts:65

Functions

createMergedTypeResolver

createMergedTypeResolver<TContext>(mergedTypeResolverOptions): MergedTypeResolver<TContext> | undefined

Type parameters

NameType
TContextextends Record<string, any> = any

Parameters

NameType
mergedTypeResolverOptionsMergedTypeResolverOptions<any, any>

Returns

MergedTypeResolver<TContext> | undefined

Defined in

packages/stitch/src/createMergedTypeResolver.ts:9


createStitchingExecutor

createStitchingExecutor(stitchedSchema): (executorRequest: ExecutionRequest<any, any, any, Record<string, any>, any>) => Promise<{ data: Record<string, any> }>

Creates an executor that uses the schema created by stitching together multiple subschemas. Not ready for production Breaking changes can be introduced in the meanwhile

Parameters

NameType
stitchedSchemaGraphQLSchema

Returns

fn

▸ (executorRequest): Promise<{ data: Record<string, any> }>

Parameters
NameType
executorRequestExecutionRequest<any, any, any, Record<string, any>, any>
Returns

Promise<{ data: Record<string, any> }>

Defined in

packages/stitch/src/executor.ts:19


forwardArgsToSelectionSet

forwardArgsToSelectionSet(selectionSet, mapping?): (field: FieldNode) => SelectionSetNode

Parameters

NameType
selectionSetstring
mapping?Record<string, string[]>

Returns

fn

▸ (field): SelectionSetNode

Parameters
NameType
fieldFieldNode
Returns

SelectionSetNode

Defined in

packages/stitch/src/selectionSetArgs.ts:4


handleRelaySubschemas

handleRelaySubschemas(subschemas, getTypeNameFromId?): SubschemaConfig<any, any, any, Record<string, any>>[]

Parameters

NameType
subschemasSubschemaConfig<any, any, any, Record<string, any>>[]
getTypeNameFromId?(id: string) => string

Returns

SubschemaConfig<any, any, any, Record<string, any>>[]

Defined in

packages/stitch/src/relay.ts:11


isolateComputedFieldsTransformer

isolateComputedFieldsTransformer(subschemaConfig): SubschemaConfig[]

Parameters

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

Returns

SubschemaConfig[]

Defined in

packages/stitch/src/subschemaConfigTransforms/isolateComputedFieldsTransformer.ts:27


splitMergedTypeEntryPointsTransformer

splitMergedTypeEntryPointsTransformer(subschemaConfig): SubschemaConfig[]

Parameters

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

Returns

SubschemaConfig[]

Defined in

packages/stitch/src/subschemaConfigTransforms/splitMergedTypeEntryPointsTransformer.ts:3


stitchSchemas

stitchSchemas<TContext>(«destructured»): GraphQLSchema

Type parameters

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

Parameters

NameType
«destructured»IStitchSchemasOptions<TContext>

Returns

GraphQLSchema

Defined in

packages/stitch/src/stitchSchemas.ts:29