Skip to content

Commit 7c2eb0d

Browse files
jasonkuhrtclaude
andcommitted
fix(generator): use dynamic root type names in SelectionSets.ts
Replace hardcoded "Query" and "Mutation" type names with dynamic references to actual root type names from the schema. This allows schemas with custom root type names (e.g., QueryRoot, MutationRoot) to work correctly. Fixes #1353 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 20c09b5 commit 7c2eb0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/generator/generators/SelectionSets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export const ModuleGeneratorSelectionSets = createModuleGenerator(
4646
parameters: $ScalarsTypeParameter,
4747
// dprint-ignore
4848
block: `
49-
${config.schema.kindMap.index.Root.query ? `query?: Record<string, Query<${i._$Scalars}>>` : ``}
50-
${config.schema.kindMap.index.Root.mutation ? `mutation?: Record<string, Mutation<${i._$Scalars}>>` : ``}
49+
${config.schema.kindMap.index.Root.query ? `query?: Record<string, ${renderName(config.schema.kindMap.index.Root.query)}<${i._$Scalars}>>` : ``}
50+
${config.schema.kindMap.index.Root.mutation ? `mutation?: Record<string, ${renderName(config.schema.kindMap.index.Root.mutation)}<${i._$Scalars}>>` : ``}
5151
`,
5252
}))
5353
code``

0 commit comments

Comments
 (0)