UNPKG

1.52 kBTypeScriptView Raw
1import { RawDocumentsConfig } from '@graphql-codegen/visitor-plugin-common';
2/**
3 * @description This plugin generates Flow types based on your `GraphQLSchema` and your GraphQL operations and fragments.
4 *
5 * It generates types for your GraphQL documents: Query, Mutation, Subscription and Fragment.
6 *
7 * This plugin requires you to use `@graphql-codegen/flow` as well, because it depends on it's types.
8 */
9export interface FlowDocumentsPluginConfig extends RawDocumentsConfig {
10 /**
11 * @description Generates Flow types as Exact types.
12 * @default true
13 *
14 * @exampleMarkdown
15 * ```yml
16 * generates:
17 * path/to/file.ts:
18 * plugins:
19 * - flow
20 * config:
21 * useFlowExactObjects: false
22 * ```
23 */
24 useFlowExactObjects?: boolean;
25 /**
26 * @description Generates read-only Flow types
27 * @default false
28 *
29 * @exampleMarkdown
30 * ```yml
31 * generates:
32 * path/to/file.ts:
33 * plugins:
34 * - flow
35 * config:
36 * useFlowReadOnlyTypes: true
37 * ```
38 */
39 useFlowReadOnlyTypes?: boolean;
40 /**
41 * @description Flatten fragment spread and inline fragments into a simple selection set before generating.
42 * @default false
43 *
44 * @exampleMarkdown
45 * ```yml
46 * generates:
47 * path/to/file.ts:
48 * plugins:
49 * - typescript
50 * - typescript-operations
51 * config:
52 * flattenGeneratedTypes: true
53 * ```
54 */
55 flattenGeneratedTypes?: boolean;
56}