1 | import { IResolvers, IResolverValidationOptions } from '@graphql-tools/utils';
|
2 | import { Type } from '@nestjs/common';
|
3 | import { ModuleMetadata } from '@nestjs/common/interfaces';
|
4 | import { GraphQLSchema } from 'graphql';
|
5 | import { GraphQLDriver } from '.';
|
6 | import { DefinitionsGeneratorOptions } from '../graphql-ast.explorer';
|
7 | import { BuildSchemaOptions } from './build-schema-options.interface';
|
8 | export declare type Enhancer = 'guards' | 'interceptors' | 'filters';
|
9 |
|
10 |
|
11 |
|
12 | export interface GqlModuleOptions<TDriver extends GraphQLDriver = any> {
|
13 | |
14 |
|
15 |
|
16 | path?: string;
|
17 | |
18 |
|
19 |
|
20 | typeDefs?: string | string[];
|
21 | |
22 |
|
23 |
|
24 | typePaths?: string[];
|
25 | |
26 |
|
27 |
|
28 | driver?: Type<TDriver>;
|
29 | |
30 |
|
31 |
|
32 | include?: Function[];
|
33 | |
34 |
|
35 |
|
36 | directiveResolvers?: any;
|
37 | |
38 |
|
39 |
|
40 | schema?: GraphQLSchema;
|
41 | |
42 |
|
43 |
|
44 | resolvers?: IResolvers | Array<IResolvers>;
|
45 | |
46 |
|
47 |
|
48 | definitions?: {
|
49 | path?: string;
|
50 | outputAs?: 'class' | 'interface';
|
51 | } & DefinitionsGeneratorOptions;
|
52 | |
53 |
|
54 |
|
55 | autoSchemaFile?: string | boolean;
|
56 | |
57 |
|
58 |
|
59 | sortSchema?: boolean;
|
60 | |
61 |
|
62 |
|
63 |
|
64 | buildSchemaOptions?: BuildSchemaOptions;
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 | useGlobalPrefix?: boolean;
|
71 | |
72 |
|
73 |
|
74 | fieldResolverEnhancers?: Enhancer[];
|
75 | |
76 |
|
77 |
|
78 | resolverValidationOptions?: IResolverValidationOptions;
|
79 | |
80 |
|
81 |
|
82 | inheritResolversFromInterfaces?: boolean;
|
83 | |
84 |
|
85 |
|
86 | transformSchema?: (schema: GraphQLSchema) => GraphQLSchema | Promise<GraphQLSchema>;
|
87 | |
88 |
|
89 |
|
90 | transformAutoSchemaFile?: boolean;
|
91 | |
92 |
|
93 |
|
94 | context?: any;
|
95 | }
|
96 | export interface GqlOptionsFactory<T extends Record<string, any> = GqlModuleOptions> {
|
97 | createGqlOptions(): Promise<Omit<T, 'driver'>> | Omit<T, 'driver'>;
|
98 | }
|
99 | export interface GqlModuleAsyncOptions<TOptions extends Record<string, any> = GqlModuleOptions, TFactory = GqlOptionsFactory<TOptions>> extends Pick<ModuleMetadata, 'imports'> {
|
100 | |
101 |
|
102 |
|
103 | driver?: TOptions['driver'];
|
104 | useExisting?: Type<TFactory>;
|
105 | useClass?: Type<TFactory>;
|
106 | useFactory?: (...args: any[]) => Promise<Omit<TOptions, 'driver'>> | Omit<TOptions, 'driver'>;
|
107 | inject?: any[];
|
108 | }
|
109 |
|
\ | No newline at end of file |