Repository navigation
Closed
Description
I am getting a type error in the codegen.ts file due to the return value of defineConfig function:
Type 'Pick<ConfiguredOutput, "preset" | "presetConfig" | "schema" | "hooks" | "watchPattern">' is not assignable to type 'ConfiguredOutput | ConfiguredPlugin[]'.
Type 'Pick<ConfiguredOutput, "preset" | "presetConfig" | "schema" | "hooks" | "watchPattern">' is not assignable to type 'ConfiguredOutput'.
Types of property 'preset' are incompatible.
Type 'import("<PATH>/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.PresetNames | import("<PATH>/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.OutputPreset<any> | undefined' is not assignable to type 'import("<PATH>/node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.PresetNames | import("<PATH>/node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.OutputPreset<any> | undefined'.
Type 'OutputPreset<any>' is not assignable to type 'PresetNames | OutputPreset<any> | undefined'.
Type 'import("<PATH>/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.OutputPreset<any>' is not assignable to type 'import("<PATH>/node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.OutputPreset<any>'.
Types of property 'buildGeneratesSection' are incompatible.
Type '(options: import("<PATH>/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.PresetFnArgs<any, { [key: string]: any; }>) => import("<PATH>/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.Promisable<import("<PATH>/node_modules/@graphql-codegen/plugin-...' is not assignable to type '(options: import("<PATH>/node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.PresetFnArgs<any, { [key: string]: any; }>) => import("<PATH>/node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.Promis...'.
Types of parameters 'options' and 'options' are incompatible.
Type 'import("<PATH>/node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.PresetFnArgs<any, { [key: string]: any; }>' is not assignable to type 'import("<PATH>/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.PresetFnArgs<any, { [key: string]: any; }>'.
Types of property 'documents' are incompatible.
Type 'import("<PATH>/node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.DocumentFile[]' is not assignable to type 'import("<PATH>/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.DocumentFile[]'.
Type 'import("<PATH>/node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.DocumentFile' is not assignable to type 'import("<PATH>/node_modules/@graphql-codegen/plugin-helpers/typings/types").Types.DocumentFile'.
Types of property 'hash' are incompatible.
Type 'string | null | undefined' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.
To Reproduce
I think this set up should be enough:
import { defineConfig } from "@eddeee888/gcg-typescript-resolver-files";
import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
generates: {
"./src/graphql/generated/server/": defineConfig({
...
}),
},
};
export default config;OS: Windows 11
Packages:
- @eddeee888/gcg-typescript-resolver-files: 0.15.0
- @graphql-codegen/cli: 6.3.0
Metadata
Metadata
Assignees
Labels
No labels
Activity
eddeee888 commentedon Apr 16, 2026
This has been fixed in @eddeee888/gcg-typescript-resolver-files@0.15.1
Thanks for reporting @Jaime02 !
Please let me know if you still have issues and I'll re-open this
Jaime02 commentedon Apr 17, 2026
Fixed, thank you so much, I really appreciate it ❤️❤️
LongLiveCHIEF commentedon Jul 30, 2026
This one seems to be happening again with:
Using the exact same basic config demo from the README of the plugin.
eddeee888 commentedon Aug 9, 2026
Hello, I've released v0.18 with a few bumps to latest dep versions. This works in a repo I had
Could you please try?
haydn commentedon Aug 11, 2026
@eddeee888 I just updated and the problem was solved. 👍
mbaker40 commentedon Nov 16, 2026
@eddeee888, unfortunately seeing this again with the codegen v8 release:
Same error as the OP ->
defineConfig()'s return type isn't assignable toCodegenConfig['generates'][string], failing onpreset→buildGeneratesSection. 0.20.0 still depends on@graphql-codegen/plugin-helpers ^7.4.2(plustypescript ^6.1.1/typescript-resolvers ^6.1.1), so itsOutputPresetcomes from a differentplugin-helpersmajor than cli 8'sCodegenConfig. Runtime generation still works, but still getting a type error.eddeee888 commentedon Nov 19, 2026
Ah thanks for the callout @mbaker40
I'll look into this
eddeee888 commentedon Nov 21, 2026
Type issue should be fixed here: https://github.com/eddeee888/graphql-code-generator-plugins/releases/tag/%40eddeee888%2Fgcg-typescript-resolver-files%400.21.0
Thank you!