@graphql-codegen/introspection
Version: 
GraphQL Code Generator plugin for generating an introspection JSON file for a GraphQLSchema
54 lines (53 loc) • 1.64 kB
TypeScript
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
/**
 * @description This plugin generates a GraphQL introspection file based on your GraphQL schema.
 */
export interface IntrospectionPluginConfig {
    /**
     * @description Set to `true` in order to minify the JSON output.
     * @default false
     *
     * @exampleMarkdown
     * ```tsx {10} filename="codegen.ts"
     *  import type { CodegenConfig } from '@graphql-codegen/cli';
     *
     *  const config: CodegenConfig = {
     *    schema: 'https://localhost:4000/graphql',
     *    documents: ['src/**\/*.tsx'],
     *    generates: {
     *      'introspection.json': {
     *        plugins: ['introspection'],
     *        config: {
     *          minify: true
     *        },
     *      },
     *    },
     *  };
     *  export default config;
     * ```
     */
    minify?: boolean;
    /**
     * @description Whether to include descriptions in the introspection result.
     * @default true
     */
    descriptions?: boolean;
    /**
     * @description Whether to include `specifiedByUrl` in the introspection result.
     * @default false
     */
    specifiedByUrl?: boolean;
    /**
     * @description Whether to include `isRepeatable` flag on directives.
     * @default true
     */
    directiveIsRepeatable?: boolean;
    /**
     * @description Whether to include `description` field on schema.
     * @default false
     */
    schemaDescription?: boolean;
    federation?: boolean;
}
export declare const plugin: PluginFunction<IntrospectionPluginConfig>;
export declare const validate: PluginValidateFn<any>;