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:100


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

calculateSelectionScore

calculateSelectionScore(selections): number

Parameters

NameType
selectionsreadonly SelectionNode[]

Returns

number

Defined in

packages/stitch/src/createDelegationPlanBuilder.ts:202


createMergedTypeResolver

createMergedTypeResolver<TContext>(mergedTypeResolverOptions, mergedType?): MergedTypeResolver<TContext> | undefined

Type parameters

NameType
TContextextends Record<string, any> = any

Parameters

NameType
mergedTypeResolverOptionsMergedTypeResolverOptions<any, any>
mergedType?GraphQLOutputType

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


getDefaultFieldConfigMerger

getDefaultFieldConfigMerger(useNonNullableFieldOnConflict?): <TContext>(candidates: MergeFieldConfigCandidate<TContext>[]) => GraphQLFieldConfig<any, TContext, any>

Parameters

NameTypeDefault value
useNonNullableFieldOnConflictbooleanfalse

Returns

fn

▸ <TContext>(candidates): GraphQLFieldConfig<any, TContext, any>

Type parameters
NameType
TContextRecord<string, any>
Parameters
NameType
candidatesMergeFieldConfigCandidate<TContext>[]
Returns

GraphQLFieldConfig<any, TContext, any>

Defined in

packages/stitch/src/mergeCandidates.ts:541


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:28


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