Serialization of LocalDate scalar as parameter for GraphQLOperationRequest #464
-
Hi, I hope this is the right place to ask my question. I have a graphql shema that will give data based on a java.timeLocalDate like so:
The generated GraphQLOperationRequest implements the method with the LocalDate parameter which is great. When the request get's serialized with request.toHttpJsonBody() the result is
This query is rejected by the server because of the dashes in the String representation of the LocalDate. When the value is quoted, the server accepts the request:
My quick solution is to change the parameter to type String and fill the parameter with localDate.toString(). Would there be another way to get the escaped quotes in the serialized request? I would prefer to use the LocalDate. I am using the following plugin version to generate the client code:
Any advice will be very much appreciated! Ida |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
As far as I know, double quotes are included only if the type is gradle plugin
|
Beta Was this translation helpful? Give feedback.
-
@idegroot, in the description of your issue you mentioned that you are using 3.1.1 |
Beta Was this translation helpful? Give feedback.
-
This involves how to properly serialize a Scalars if it is an imported class that cannot be modified. The #260 's unit test did not give the this test case(Scalars are used directly, not in |
Beta Was this translation helpful? Give feedback.
-
@idegroot, I've created a ticket for supporting your scenario (custom scalar as a parameter in GraphQL operation): #472 |
Beta Was this translation helpful? Give feedback.
@idegroot, I've created a ticket for supporting your scenario (custom scalar as a parameter in GraphQL operation): #472