Adding custom suffix to generated types
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 217
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
With DGS codegen, I want the schema types to correspond my Model entity types.
For example let's assume that I have a query in my schema:
type Dog {
name: String!
}
My generated type will be <generated_types_package>.Dog.java
In most cases, I will have another class for my model object. <model_type_package>.Dog.java
What happens in this case that in my DataFetcher I need to declare explicitly on the type package prefix, which makes the code pretty hard to read.
My suggestion is to add a custom suffix to any schema generated type (not input)
<model_type_package>.Dog.java --> <model_type_package>.DogGQL.java
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
The request concerns DGS codegen's generated schema types and the Java types consumed by DataFetchers. Start by locating the generator entry point and its tests, then trace how non-input schema types are named. Done means a configurable suffix is applied to those generated types while input types remain unchanged, with coverage for the Dog example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100