UNPKG

1.25 kBTypeScriptView Raw
1import { DecoratorConfig } from './visitor.js';
2import { TypeScriptPluginConfig } from '@graphql-codegen/typescript';
3export interface TypeGraphQLPluginConfig extends TypeScriptPluginConfig {
4 /**
5 * @name decoratorName
6 * @description allow overriding of TypeGraphQL decorator types
7 * @default { type: 'ObjectType', interface: 'InterfaceType', arguments: 'ArgsType', field: 'Field', input: 'InputType' }
8 */
9 decoratorName?: Partial<DecoratorConfig>;
10 /**
11 * @name decorateTypes
12 * @description Specifies the objects that will have TypeGraphQL decorators prepended to them, by name. Non-matching types will still be output, but without decorators. If not set, all types will be decorated.
13 * @exampleMarkdown Decorate only type User
14 * ```ts filename="codegen.ts"
15 * import type { CodegenConfig } from '@graphql-codegen/cli';
16 *
17 * const config: CodegenConfig = {
18 * // ...
19 * generates: {
20 * 'path/to/file.ts': {
21 * plugins: ['typescript-type-graphql'],
22 * config: {
23 * decorateTypes: ['User']
24 * },
25 * },
26 * },
27 * };
28 * export default config;
29 * ```
30 */
31 decorateTypes?: string[];
32}