How to customize enum mapping? #426
-
|
Hey, Is there any way to customize how enum is mapped/serialized? I have a following Java enum: public enum CustomEnum {
VALUE_1("value1"),
VALUE_2("value2")
}schema: And when I run a query I get the following results: but I want to have the following: Is there any way to customize how enum is mapped? Thanks for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Value of Enum type cannot be customized as of current implementation. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, that's what I did, however, it introduces duplication. It would be nice if it would be possible to configure such behavior. |
Beta Was this translation helpful? Give feedback.
Value of Enum type cannot be customized as of current implementation.
To get the result that you're looking for, you can create a custom scalar that wraps Enum and uses the property of Enum that you want