UNPKG

2.06 kBTypeScriptView Raw
1import { ITypeDefinitions, IResolvers, IResolverValidationOptions, IDirectiveResolvers, SchemaDirectiveVisitorClass, GraphQLParseOptions, SchemaTransform, PruneSchemaOptions } from '@graphql-tools/utils';
2export interface ILogger {
3 log: (error: Error) => void;
4}
5/**
6 * Configuration object for creating an executable schema
7 */
8export interface IExecutableSchemaDefinition<TContext = any> {
9 /**
10 * The type definitions used to create the schema
11 */
12 typeDefs: ITypeDefinitions;
13 /**
14 * Object describing the field resolvers for the provided type definitions
15 */
16 resolvers?: IResolvers<any, TContext> | Array<IResolvers<any, TContext>>;
17 /**
18 * Logger instance used to print errors to the server console that are
19 * usually swallowed by GraphQL.
20 */
21 logger?: ILogger;
22 /**
23 * Set to `false` to have resolvers throw an if they return undefined, which
24 * can help make debugging easier
25 */
26 allowUndefinedInResolve?: boolean;
27 /**
28 * Additional options for validating the provided resolvers
29 */
30 resolverValidationOptions?: IResolverValidationOptions;
31 /**
32 * Map of directive resolvers
33 */
34 directiveResolvers?: IDirectiveResolvers<any, TContext>;
35 /**
36 * A map of schema directives used with the legacy class-based implementation
37 * of schema directives
38 */
39 schemaDirectives?: Record<string, SchemaDirectiveVisitorClass>;
40 /**
41 * An array of schema transformation functions
42 */
43 schemaTransforms?: Array<SchemaTransform>;
44 /**
45 * Additional options for parsing the type definitions if they are provided
46 * as a string
47 */
48 parseOptions?: GraphQLParseOptions;
49 /**
50 * GraphQL object types that implement interfaces will inherit any missing
51 * resolvers from their interface types defined in the `resolvers` object
52 */
53 inheritResolversFromInterfaces?: boolean;
54 /**
55 * Additional options for removing unused types from the schema
56 */
57 pruningOptions?: PruneSchemaOptions;
58}