Netflix / dgs-framework

GraphQL for Java with Spring Boot made easy.
https://netflix.github.io/dgs
Apache License 2.0
3.04k stars 291 forks source link

Customize the ObjectMapper used by DgsQueryExecutor in tests #1021

Open srinivasankavitha opened 2 years ago

srinivasankavitha commented 2 years ago

The current DGSExecutor does not offer a way to customize the object mapper used for deserializing the responses, i.e. the various executeAndExtract (methods primarily used by tests).

ClaudenirFreitas commented 2 years ago

Well, you can check Custom Object Mapper page.

jakubjanecek commented 2 years ago

I don't think this https://netflix.github.io/dgs/advanced/custom-object-mapper/ helps. I've tried it with no luck and the page says it's for serialization. It seems this global ObjectMapper https://github.com/Netflix/dgs-framework/blob/v4.10.2/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/BaseDgsQueryExecutor.kt#L48 is used for deserialization in tests and that can't be changed.

srinivasankavitha commented 2 years ago

That is correct, we need to implement support for this as mentioned in my original comment.

heypko commented 1 year ago

Did this issue ever get resolved (or have a known workaround)?