Replies: 3 comments 1 reply
-
|
Yes, I believe this has come up in another issue as well. It does make sense to be able to configure the object mapper used to extract the response. We will add this in an upcoming release. Thanks for the detailed description. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, @srinivasankavitha. Looking forward to it! |
Beta Was this translation helpful? Give feedback.
-
|
I also met the problem and I found the typename field is added by apollo client so we can config the behavior, https://community.apollographql.com/t/how-to-remove-typename-for-a-specific-query/1416 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am testing DGS mutation in the web layer via CustomGraphQLClient and GraphQLQueryRequest builder like so:
Note that all my types are generated using the DGS codegen.
In my test, I am simply extracting response and mapping to my GQL type like so:
final var myTpe = graphQLResponse.extractValueAsObject(JSON_PATH, MyType.class);
I get an exception because the server correctly returns a type name of the resource because its a union type
This is simply an issue with the ObjectMapper failing due to an unknown field.
Is there a way to configure this Object mapper?
I have tried different approaches including using what's described in the doc for overriding the object mapper but it seems it doesn't use that.
Internally, I see this is how the object mapper used is configured.
I can deserialize with my own ObjectMapper but it will be nice to be able to set the configuration of the object mapper used here
graphQLResponse.extractValueAsObjectThoughts?
Beta Was this translation helpful? Give feedback.
All reactions