dgs-codegen
dgs-codegen copied to clipboard
Kotlin Generation Failure for GraphQL Enum value ‘name’
When a GraphQL enum has a value name, generating Kotlin code fails with the error:
java.lang.IllegalArgumentException: constant with name "name" conflicts with a supertype member with the same name at com.squareup.kotlinpoet.TypeSpec$Builder.addEnumConstant(TypeSpec.kt:663)
Kotlinpoet is correct: name is not an allowed enum constant in Kotlin.
A name constant should probably be treated like a reserved keyword, and the code should refer to it with _name.