UNPKG

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