Das135
03/10/2021, 12:37 PMEnum
that as got name
property.
I have got Graphql server that has got enum class properties defined in UPPERCASE and renamed with @GraphQLName
(because of name
property).
enum class EnumClass {
@GraphQLName("id")
@JsonProperty("id")
ID,
@GraphQLName("name")
@JsonProperty("name")
NAME,
@GraphQLName("createdAt")
@JsonProperty("createdAt")
CREATED_AT,
@GraphQLName("createdById")
@JsonProperty("createdById")
CREATED_BY_ID,
}
Now I want to use this type in my graphql-kotlin-client, but generator creates this class:
enum class EnumClass {
createdAt,
createdById,
id,
name,
/**
* This is a default enum value that will be used when attempting to deserialize unknown value.
*/
@JsonEnumDefaultValue
__UNKNOWN_VALUE
}
There is a problem that Kotlin Enum cannot has got a name
property.
Please, it is possible to somehow solve it? Thank youDariusz Kuc
03/10/2021, 1:15 PMDariusz Kuc
03/10/2021, 1:16 PMShane Myrick
03/10/2021, 4:59 PMenum class EnumClass {
id
class_name, // This will clash so must change
createdAt,
createdById
}
Das135
03/15/2021, 9:08 AM