Summary
The $typeName discriminator convention can leak a literal $ into auto-generated GraphQL type names, producing schema files that are not valid GraphQL.
Evidence
The committed goldens of union-dollar-typename-basic and union-typename-priority (packages/cli/src/gen-orchestrator/testdata/) emit:
enum SearchQuery$typeNameInput { ... }
$ is not a valid character in GraphQL names, so the committed schema.graphql is unparseable by graphql-js (parse() throws).
Origin
Auto-type naming builds generated names from field paths; when the field is the $typeName discriminator itself, the $ passes through unsanitized into the type name.
Expected
Either sanitize/exclude the discriminator field from auto-type naming, or reject the situation with a diagnostic — emitting syntactically invalid SDL should never happen.
Context
Discovered during the refactoring plan's Phase 6 pruning survey (.kiro/specs/refactor-plan.md, Phase 6 execution note), where parsing the generated SDL crashed on these cases. Deliberately not fixed in that PR (out of scope).
🤖 Generated with Claude Code
Summary
The
$typeNamediscriminator convention can leak a literal$into auto-generated GraphQL type names, producing schema files that are not valid GraphQL.Evidence
The committed goldens of
union-dollar-typename-basicandunion-typename-priority(packages/cli/src/gen-orchestrator/testdata/) emit:$is not a valid character in GraphQL names, so the committed schema.graphql is unparseable by graphql-js (parse()throws).Origin
Auto-type naming builds generated names from field paths; when the field is the
$typeNamediscriminator itself, the$passes through unsanitized into the type name.Expected
Either sanitize/exclude the discriminator field from auto-type naming, or reject the situation with a diagnostic — emitting syntactically invalid SDL should never happen.
Context
Discovered during the refactoring plan's Phase 6 pruning survey (
.kiro/specs/refactor-plan.md, Phase 6 execution note), where parsing the generated SDL crashed on these cases. Deliberately not fixed in that PR (out of scope).🤖 Generated with Claude Code