Which packages are impacted by your issue?
@graphql-codegen/cli
Describe the bug
There is a logic issue where default values are checked too early in the process. The default value should be checked last, but in the current implementation, it is checked first, which may cause errors or unexpected results.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Set up codegen with multiple projects (using
projects field).
- At least one project uses a default value in configuration.
- Run codegen and check generated output. The default value is applied earlier than expected.
Expected behavior
Default values should only be used after all other conditions are checked – not as an initial shortcut. The current logic uses defaults too soon.
Screenshots or Videos
No response
Platform
- OS: Any
- NodeJS: Any
- graphql version: Any
- @graphql-codegen/* version(s): Any
Codegen Config File
No response
Additional context
Related PR: #10335
Which packages are impacted by your issue?
@graphql-codegen/cli
Describe the bug
There is a logic issue where default values are checked too early in the process. The default value should be checked last, but in the current implementation, it is checked first, which may cause errors or unexpected results.
Your Example Website or App
Steps to Reproduce the Bug or Issue
projectsfield).Expected behavior
Default values should only be used after all other conditions are checked – not as an initial shortcut. The current logic uses defaults too soon.
Screenshots or Videos
No response
Platform
Codegen Config File
No response
Additional context
Related PR: #10335