How to customize enum mapping? #426
Answered
by
priyaaggarwal24
maciejkopecpl
asked this question in
Q&A
|
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! |
Answered by
priyaaggarwal24
Aug 15, 2020
Replies: 2 comments
|
Value of Enum type cannot be customized as of current implementation. |
0 replies
Answer selected by
vojtapol
|
Yeah, that's what I did, however, it introduces duplication. It would be nice if it would be possible to configure such behavior. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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