Code gen doesn't generate client queries when queries are defined in a schema block
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 217
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
My GraphQL server generates a GraphQL schema and I'm trying to use that schema to generate the client with the code gen. In the auto-generated schema queries are defined in a schema block:
schema {
query: MyQuery
}
type MyQuery {
MyObjects: [MyObject]
}
When I run the code gen the query MyObjects isn't detected and the code for the query isn't generated. When I change type MyQuery to type Query it works fine but I can't change the definition on the server side and I don't want to make any changes in the auto-generated schema.
Do I have to configure the code gen to detect queries defined in a schema block or is this feature unsupported at the moment?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the schema block and named root type shown in the report, then trace how code generation identifies query types. Done means the generated client includes code for the MyObjects query without changing the schema; no specific files or tests are named in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, kotlin
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100