UNPKG

@graphql-tools/stitch

Version:

A set of utils for faster development of GraphQL tools

34 lines (33 loc) 1.92 kB
import { DocumentNode, GraphQLDirective, GraphQLNamedType, GraphQLSchema, OperationTypeNode, SchemaDefinitionNode, SchemaExtensionNode } from 'graphql'; import { StitchingInfo, Subschema, SubschemaConfig } from '@graphql-tools/delegate'; import { GraphQLParseOptions, TypeSource } from '@graphql-tools/utils'; import { MergeTypeCandidate, MergeTypeFilter, OnTypeConflict, TypeMergingOptions } from './types.cjs'; export declare function buildTypeCandidates<TContext extends Record<string, any> = Record<string, any>>({ subschemas, originalSubschemaMap, types, typeDefs, parseOptions, directiveMap, schemaDefs, mergeDirectives: isMergeDirectives, }: { subschemas: Array<Subschema<any, any, any, TContext>>; originalSubschemaMap: Map<Subschema<any, any, any, TContext>, GraphQLSchema | SubschemaConfig<any, any, any, TContext>>; types: Array<GraphQLNamedType>; typeDefs: TypeSource; parseOptions: GraphQLParseOptions; directiveMap: Record<string, GraphQLDirective>; schemaDefs: { schemaDef: SchemaDefinitionNode; schemaExtensions: Array<SchemaExtensionNode>; }; mergeDirectives?: boolean | undefined; }): [ Record<string, Array<MergeTypeCandidate<TContext>>>, Record<OperationTypeNode, string>, DocumentNode[] ]; export declare function buildTypes<TContext = Record<string, any>>({ typeCandidates, directives, stitchingInfo, rootTypeNames, onTypeConflict, mergeTypes, typeMergingOptions, }: { typeCandidates: Record<string, Array<MergeTypeCandidate<TContext>>>; directives: Array<GraphQLDirective>; stitchingInfo: StitchingInfo<TContext>; rootTypeNames: Array<string>; onTypeConflict?: OnTypeConflict<TContext>; mergeTypes: boolean | Array<string> | MergeTypeFilter<TContext>; typeMergingOptions?: TypeMergingOptions<TContext>; }): { typeMap: Record<string, GraphQLNamedType>; directives: Array<GraphQLDirective>; };