Commit 1546f45
unknown
fix(codegen): pass typeRegistry to CLI generation for proper required/optional field detection
The CLI generator's getFieldsWithDefaults() checks introspection data to
determine which fields are nullable or have defaults, and marks them as
optional. However, the typeRegistry was never passed through to the CLI
generator in either the single-target or multi-target code paths.
This caused ALL fields to be marked as required: true in create commands,
even nullable fields like inheritsId (UUID without ! in GraphQL).
Fixes:
1. Single-target generate(): pass typeRegistry to generateCliFiles()
2. pipelineData: include typeRegistry so multi-target can access it
3. Multi-target generateMulti(): pass typeRegistry from pipelineData
to cliTargets1 parent 2ce4c3c commit 1546f45
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| |||
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
| 444 | + | |
442 | 445 | | |
443 | 446 | | |
444 | 447 | | |
| |||
676 | 679 | | |
677 | 680 | | |
678 | 681 | | |
| 682 | + | |
679 | 683 | | |
680 | 684 | | |
681 | 685 | | |
| |||
0 commit comments