Use Upload scalar in input model #498
Replies: 1 comment
-
Hi Cristian, unfortunately this is a known limitation. One way to overcome this is by replacing
Another workaround is to help jackson serialize the I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have the following mutation:
From Postman I'm sending this input:
The purpose is to map property file to an object of type Part.
When executing the request, it throws an exception because it can't deserialize the Part object.
At the same time, the following mutation and input work fine:
I looked into the java and kt code in order to understand why when using the Upload scalar as a direct variable it works and why it doesn't when the scalar is in the input object. The difference seem to be that in the first case, the object of type Part is just passed on while in the second case is deserialized, leading to an exception.
L.E. It seems that the problem comes from the fact that class MethodFieldResolver.kt detects scalar types only when they are endpoint parameters. If a scalar is part of a broader input model, it is seen as a JSON and sent to ObjectMapper for deserialization. Deserializing an object of type Part is not possible.
Any help is appreciated.
Regards,
Cristian.
Beta Was this translation helpful? Give feedback.
All reactions