Enums in arguments are serialized in quotes
See original GitHub issueWhen there is an enum in query inlined arguments it is serialized as a string in quotes. See the following example - the alignment
input field is an enum field.
Current request:
mutation {
someMutation(
update: {alignment: "left"}
) {
ok
errorMessage
}
}
Expected request:
mutation {
someMutation(
update: {alignment: left}
) {
ok
errorMessage
}
}
I can work around it by sending the arguments in variables, but that’s not ideal for my use case.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How to ensure consistency of enums in Java serialization?
The serialized form of an enum constant consists solely of its name; field values of the constant are not present in the form....
Read more >(De)serialization of enums could use a simpler format #251
My workaround so far has been a two step deserialization. First, serde is used to deserialize the data into a StructRaw where the...
Read more >How To Serialize and Deserialize Enums with Jackson
In this quick tutorial, we'll learn how to control the way Java Enums are serialized and deserialized with Jackson 2.
Read more >[CLOSED] The best approach to serialize an enum as its value
Hi everybody, By default, JSON.NET serializes an enum with its value. There is a special StringEnumConverter to get it converted with its name ......
Read more >Enums - Swagger
Enums. You can use the enum keyword to specify possible values of a request parameter or a model property. For example, the sort...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Different from the parameters of variables-style, inline-style parameters are not developed based on the type system (This problem was thought about when the project is created, and the reason why it was not dealt with is because inline-style is not the main design goal).
To fix this flaw, a major refactoring would have to be done to make inline-style parameters based on type information instead of plain JSON, so that the system can distinguish between strings and enums.
So, it’s a huge task and can’t be achieved in the short term.
The variables-style is better than the inline-style, and almost all frameworks recommend the variable-style.
However, your answer surprised me, what particular scenario leads you to think inline-style is better? Could you share your scenario and your thoughts?. maybe there is a better way.
Because 3.1.3 or 3.1.4 fixed it.
Later, 3.1.5 will be released.