UNPKG

1.64 kBTypeScriptView Raw
1import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
2/**
3 * @description This plugin generates a GraphQL introspection file based on your GraphQL schema.
4 */
5export interface IntrospectionPluginConfig {
6 /**
7 * @description Set to `true` in order to minify the JSON output.
8 * @default false
9 *
10 * @exampleMarkdown
11 * ```tsx {10} filename="codegen.ts"
12 * import type { CodegenConfig } from '@graphql-codegen/cli';
13 *
14 * const config: CodegenConfig = {
15 * schema: 'https://localhost:4000/graphql',
16 * documents: ['src/**\/*.tsx'],
17 * generates: {
18 * 'introspection.json': {
19 * plugins: ['introspection'],
20 * config: {
21 * minify: true
22 * },
23 * },
24 * },
25 * };
26 * export default config;
27 * ```
28 */
29 minify?: boolean;
30 /**
31 * @description Whether to include descriptions in the introspection result.
32 * @default true
33 */
34 descriptions?: boolean;
35 /**
36 * @description Whether to include `specifiedByUrl` in the introspection result.
37 * @default false
38 */
39 specifiedByUrl?: boolean;
40 /**
41 * @description Whether to include `isRepeatable` flag on directives.
42 * @default true
43 */
44 directiveIsRepeatable?: boolean;
45 /**
46 * @description Whether to include `description` field on schema.
47 * @default false
48 */
49 schemaDescription?: boolean;
50 federation?: boolean;
51}
52export declare const plugin: PluginFunction<IntrospectionPluginConfig>;
53export declare const validate: PluginValidateFn<any>;