UNPKG

1.47 kBTypeScriptView Raw
1import { RawConfig } from '@graphql-codegen/visitor-plugin-common';
2/**
3 * @description If you are migrating from <1.0, we created a new plugin called `typescript-compatibility` that generates backward compatibility for the `typescript-operations` and `typescript-react-apollo` plugins.
4 *
5 * It generates types that are pointing to the new form of types. It supports _most_ of the use-cases.
6 */
7export interface CompatibilityPluginRawConfig extends RawConfig {
8 /**
9 * @description Does not generate TypeScript `namespace`s and uses the operation name as prefix.
10 * @default false
11 *
12 * @exampleMarkdown
13 * ```yml
14 * generates:
15 * path/to/file.ts:
16 * plugins:
17 * - typescript
18 * - typescript-operations
19 * - typescript-compatibility
20 * config:
21 * noNamespaces: true
22 * ```
23 */
24 noNamespaces?: boolean;
25 /**
26 * @description Make sure to generate code that compatible with TypeScript strict mode.
27 * @default false
28 *
29 * @exampleMarkdown
30 * ```yml
31 * generates:
32 * path/to/file.ts:
33 * plugins:
34 * - typescript
35 * - typescript-operations
36 * - typescript-compatibility
37 * config:
38 * strict: true
39 * ```
40 */
41 strict?: boolean;
42 /**
43 * @description Avoid using `Pick` in `typescript-operations` and make sure to optimize this package as well.
44 * @default false
45 */
46 preResolveTypes?: boolean;
47}