Replies: 4 comments 15 replies
-
This issue contains the reasoning for the custom implementation and not using Jackson: #549 In short, the input we're getting is not JSON, so handling it as JSON seems to work in many scenarios, but its fundamentally broken. This means that replacing the implementation would be far more involved than just using something like Jackson, and will most likely introduce other issues. Because it's such as hairy topic, I'm thinking it's probably not a good idea to make this customizable, because it's going to cause more issues than it solves. What we could consider is adding support for the specific use cases you find missing in the implementation. |
Beta Was this translation helpful? Give feedback.
-
Isn't that the same as using `DataFetchingEnvironment.getArgument(...)`
directly?
…On Fri, Dec 10, 2021 at 2:21 AM Christian Beikov ***@***.***> wrote:
I don't care how the string is parsed. In fact, I don't even want to know
about the parsing :) I can imagine though that there are some parsing
requirements with respect to support various basic types e.g. timestamp
etc., but that's a different topic.
All I need is control over how objects are constructed and how attributes
are set on the objects, so if you could introduce an abstraction for that,
this would be enough for my purposes. Something as simple as this for
example:
interface ObjectMapper {
<T> T fromAttributes(Map<String, Object> map, java.lang.reflect.Type t);
default <T> T fromAttributes(Map<String, Object> map, Class<T> clazz) {
return (T) formAttributes(map, (Type) clazz);
}
}
Where the value for a map entry referring to a nested object would be a Map<String,
Object> again.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#775 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2XLHFEMVISUGERRS4FRLUQHIBTANCNFSM5JVKSPXQ>
.
|
Beta Was this translation helpful? Give feedback.
-
@beikov hey :) Just to understand the issue a little better and be part of the discussion, could you make it a little more clear if this is a conveniens effort to make the input argument binding easier with BP is used, or is this a critical requirement to get mutations going with blaze persistence? @paulbakker as a side note, we are heavy users of blaze-persistence which @beikov is the author of, and we worked with him in the last months to get a DGS integration up and running, which we are currently already using in production (you might know, we had a couple of discussions/bugs we looked at with you together). This said we are yet only using fetchers, mutations are on our list. Regarding how deeply integrated BP is in our persistence model it would be a huge bummer if mutations are not working with DGS - this would mean we would need to remove DGS and replace it with something else (which we actually do not want to). We would love to use DGS and BP together, it is actually a great match! |
Beta Was this translation helpful? Give feedback.
-
@beikov @paulbakker we are now at at stage were we finally start with mutators and now hit this thing. I did not remember and find this issue directly, thus search around custom scalars and things like that, leading to nothing when going down the road. As far as i can see @beikov this is a similar take then we alware have with the spring-webmvc "jackson" integration ( Currently, seeing the discussion around
Thank you for the effort! |
Beta Was this translation helpful? Give feedback.
-
Hi,
I saw that the input argument handling was made completely static with this change: 2fe40a9#diff-0d8ecc929924d083759c48f18c0bda7a0671208191ccdd30ac743aaedd264b4e
and before it was only possible to "hack" into
DgsSchemaProvider
to change the internalObjectMapper
for custom deserialization logic.Can you please provide a hook for replacing the parsing of InputArgument?
My main use case is that I want to accept an interface as input argument for a mutation. Apart from that, my desired deserializer also controls how objects are constructed.
Beta Was this translation helpful? Give feedback.
All reactions