Netflix / dgs-codegen

Apache License 2.0
182 stars 99 forks source link

How to generate data class with "no arg constructor" and setter? (or a data class with builder) #688

Closed dogeeeeeeeeeege closed 5 months ago

dogeeeeeeeeeege commented 5 months ago

Hi, I have a data class with many data fields. I couldn't find how to configure to get a "no arg constructor" so I can set a few data fields that I'm interested later. Builder is also good.

srinivasankavitha commented 5 months ago

Codegen should always generate a no arg constructor, no additional configuration needed. You also have a Builder that is generated to do set fields later: https://netflix.github.io/dgs/generating-code-from-schema/#quick-start