Unnecessary warning is generated on `fieldsSet`
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 217
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
Having a schema like this
enum PokemonType {
FIRE
WATER
ELECTRIC
GRASS
}
type Query {
getAllPokemonTypes: [PokemonType!]!
}
The plugin generates a GetAllPokemonTypesGraphQLQuery class containing a warning inside the Builder
public static class Builder {
private Set<String> fieldsSet = new HashSet<>();
....
}
The value of the field GetAllPokemonTypesGraphQLQuery.Builder.fieldsSet is not used
I believe it happens always when the return value of a query is a [xxx!]!, whether is an enum or type.
It's not very important but it would be nice to remove it, so we can keep the generated code warning-free!
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
Reproduce the issue with the provided GraphQL schema and inspect the generated GetAllPokemonTypesGraphQLQuery.Builder, focusing on the fieldsSet declaration and the generation path for non-null list return values. Done means the generated Builder no longer contains an unused fieldsSet warning for this schema, while preserving query generation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, java, kotlin
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100