Skip to content

Commit 2a97f71

Browse files
committed
[typescript][cli] chore: drop type-safety comments on real-handling defaults
`TsVisitor` and `CodegenContext` are exported: a parsed union can have no `types`, and a context can be created without `config`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VazhaQJ1EYc8Mk39FnQxJ6
1 parent ce22a28 commit 2a97f71

2 files changed

Lines changed: 0 additions & 2 deletions

File tree

‎packages/graphql-codegen-cli/src/config.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ export class CodegenContext {
424424
};
425425
} else {
426426
this.config = {
427-
// This `generates: {}` is only to satisfy type safety: a context created without `config` still fails with codegen's missing "generates" error
428427
generates: {},
429428
...this._config,
430429
pluginContext: this._pluginContext,

‎packages/plugins/typescript/typescript/src/visitor.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ export class TsVisitor<
246246
];
247247
}
248248
const originalNode = parent[key] as UnionTypeDefinitionNode;
249-
// This `|| []` is only to satisfy type safety: a union without members has no types to list
250249
const possibleTypes = (originalNode.types || [])
251250
.map(t =>
252251
this.scalars[t.name.value] ? this._getScalar(t.name.value, 'output') : this.convertName(t),

0 commit comments

Comments
 (0)