@graphql-tools/stitch
Enumerations
Interfaces
- IStitchSchemasOptions
- MergeEnumValueConfigCandidate
- MergeFieldConfigCandidate
- MergeInputFieldConfigCandidate
- MergeTypeCandidate
- TypeMergingOptions
- ValidationSettings
Type Aliases
Functions
- calculateSelectionScore
- createMergedTypeResolver
- createStitchingExecutor
- forwardArgsToSelectionSet
- getDefaultFieldConfigMerger
- handleRelaySubschemas
- isolateComputedFieldsTransformer
- splitMergedTypeEntryPointsTransformer
- stitchSchemas
Type Aliases
MergeTypeFilter
Ƭ MergeTypeFilter<TContext
>: (mergeTypeCandidates
: MergeTypeCandidate
<TContext
>[], typeName
: string
) => boolean
Type parameters
Name | Type |
---|---|
TContext | Record <string , any > |
Type declaration
▸ (mergeTypeCandidates
, typeName
): boolean
Parameters
Name | Type |
---|---|
mergeTypeCandidates | MergeTypeCandidate <TContext >[] |
typeName | string |
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
Name | Type |
---|---|
TContext | Record <string , any > |
Type declaration
▸ (left
, right
, info?
): GraphQLNamedType
Parameters
Name | Type |
---|---|
left | GraphQLNamedType |
right | GraphQLNamedType |
info? | Object |
info.left | Object |
info.left.subschema? | GraphQLSchema | SubschemaConfig <any , any , any , TContext > |
info.left.transformedSubschema? | Subschema <any , any , any , TContext > |
info.right | Object |
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
Name | Type |
---|---|
TContext | Record <string , any > |
Type declaration
▸ (subschemaConfig
): SubschemaConfig
<any
, any
, any
, TContext
> | SubschemaConfig
<any
, any
, any
, TContext
>[]
Parameters
Name | Type |
---|---|
subschemaConfig | SubschemaConfig <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
Name | Type |
---|---|
selections | readonly SelectionNode [] |
Returns
number
Defined in
packages/stitch/src/createDelegationPlanBuilder.ts:202
createMergedTypeResolver
▸ createMergedTypeResolver<TContext
>(mergedTypeResolverOptions
, mergedType?
): MergedTypeResolver
<TContext
> | undefined
Type parameters
Name | Type |
---|---|
TContext | extends Record <string , any > = any |
Parameters
Name | Type |
---|---|
mergedTypeResolverOptions | MergedTypeResolverOptions <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
Name | Type |
---|---|
stitchedSchema | GraphQLSchema |
Returns
fn
▸ (executorRequest
): Promise
<{ data
: Record
<string
, any
> }>
Parameters
Name | Type |
---|---|
executorRequest | ExecutionRequest <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
Name | Type |
---|---|
selectionSet | string |
mapping? | Record <string , string []> |
Returns
fn
▸ (field
): SelectionSetNode
Parameters
Name | Type |
---|---|
field | FieldNode |
Returns
SelectionSetNode
Defined in
packages/stitch/src/selectionSetArgs.ts:4
getDefaultFieldConfigMerger
▸ getDefaultFieldConfigMerger(useNonNullableFieldOnConflict?
): <TContext>(candidates
: MergeFieldConfigCandidate
<TContext
>[]) => GraphQLFieldConfig
<any
, TContext
, any
>
Parameters
Name | Type | Default value |
---|---|---|
useNonNullableFieldOnConflict | boolean | false |
Returns
fn
▸ <TContext
>(candidates
): GraphQLFieldConfig
<any
, TContext
, any
>
Type parameters
Name | Type |
---|---|
TContext | Record <string , any > |
Parameters
Name | Type |
---|---|
candidates | MergeFieldConfigCandidate <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
Name | Type |
---|---|
subschemas | SubschemaConfig <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
Name | Type |
---|---|
subschemaConfig | SubschemaConfig <any , any , any , Record <string , any >> |
Returns
Defined in
packages/stitch/src/subschemaConfigTransforms/isolateComputedFieldsTransformer.ts:29
splitMergedTypeEntryPointsTransformer
▸ splitMergedTypeEntryPointsTransformer(subschemaConfig
): SubschemaConfig
[]
Parameters
Name | Type |
---|---|
subschemaConfig | SubschemaConfig <any , any , any , Record <string , any >> |
Returns
Defined in
packages/stitch/src/subschemaConfigTransforms/splitMergedTypeEntryPointsTransformer.ts:3
stitchSchemas
▸ stitchSchemas<TContext
>(«destructured»
): GraphQLSchema
Type parameters
Name | Type |
---|---|
TContext | extends Record <string , any > = Record <string , any > |
Parameters
Name | Type |
---|---|
«destructured» | IStitchSchemasOptions <TContext > |
Returns
GraphQLSchema