Skip to content

Check default values at the end, not at the beginning for multi-project GraphQL config #10840

@Diluka

Description

@Diluka

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

  1. Set up codegen with multiple projects (using projects field).
  2. At least one project uses a default value in configuration.
  3. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions