import { type ExecutorContext } from '@nx/devkit'; /** * Options for the codegen executor. * Runs graphql-codegen with a preset plugin stack (default: @pawells/graphql-codegen-ts for Node.js/TypeScript). * * @example * // In project.json executor options: * // { * // "schemaFile": "dist/schema.graphql", * // "documentsGlob": "src/**\/*.graphql", * // "outputFile": "src/generated/graphql.ts" * // } */ export interface ICodegenExecutorSchema { /** Input .graphql schema file path. */ schemaFile: string; /** Glob pattern for GraphQL operation files (e.g., src/**\/*.graphql). */ documentsGlob: string; /** Output .ts file path for generated code. */ outputFile: string; /** Target platform (currently 'typescript' only). Defaults to 'typescript'. */ target?: 'typescript'; /** Override default plugin list. Default: typescript, typescript-operations, typed-document-node, typescript-apollo-client-helpers, @pawells/graphql-codegen-ts. */ plugins?: string[]; /** Merge into default codegen config (default: { namingConvention: 'keep', immutableTypes: false }). */ config?: Record; /** Run in watch mode for development. Defaults to false. */ watch?: boolean; } /** * NX executor that runs graphql-codegen with a preset plugin stack. * Merges default plugins and config with any overrides, calls graphql-codegen's generate function, * and supports watch mode for development. * All errors are logged and returned as success: false. * * @param options - Executor options. * @param context - NX executor context (provides workspaceRoot for path containment validation). * @returns Execution result with success flag (never throws; returns success: false on error). * @example * ```typescript * const result = await codegenExecutor( * { schemaFile: 'dist/schema.graphql', documentsGlob: 'src/**\/*.graphql', outputFile: 'src/generated/graphql.ts' }, * context * ); * // result: { success: true } * ``` */ export default function codegenExecutor(options: ICodegenExecutorSchema, context: ExecutorContext): Promise<{ success: boolean; }>; //# sourceMappingURL=executor.d.ts.map