UNPKG

1.53 kBTypeScriptView Raw
1import { TypeSource, IResolvers, IResolverValidationOptions, GraphQLParseOptions, PruneSchemaOptions } from '@graphql-tools/utils';
2import { SchemaExtensions } from '@graphql-tools/merge';
3import { BuildSchemaOptions } from 'graphql';
4/**
5 * Configuration object for creating an executable schema
6 */
7export interface IExecutableSchemaDefinition<TContext = any> {
8 /**
9 * The type definitions used to create the schema
10 */
11 typeDefs: TypeSource;
12 /**
13 * Object describing the field resolvers for the provided type definitions
14 */
15 resolvers?: IResolvers<any, TContext> | Array<IResolvers<any, TContext>>;
16 /**
17 * Additional options for validating the provided resolvers
18 */
19 resolverValidationOptions?: IResolverValidationOptions;
20 /**
21 * Additional options for parsing the type definitions if they are provided
22 * as a string
23 */
24 parseOptions?: BuildSchemaOptions & GraphQLParseOptions;
25 /**
26 * GraphQL object types that implement interfaces will inherit any missing
27 * resolvers from their interface types defined in the `resolvers` object
28 */
29 inheritResolversFromInterfaces?: boolean;
30 /**
31 * Additional options for removing unused types from the schema
32 */
33 pruningOptions?: PruneSchemaOptions;
34 /**
35 * Do not create a schema again and use the one from `buildASTSchema`
36 */
37 updateResolversInPlace?: boolean;
38 /**
39 * Schema extensions
40 */
41 schemaExtensions?: SchemaExtensions | Array<SchemaExtensions>;
42}