Customize JSON serialization in Quarkus Smallrye GraphQL

74 Views Asked by At

How can the JSON serialization in Quarkus Smallrye GraphQL be customized? E.g. I want to omit null values from JSON:

{
  "foo": "bar",
  "baz": null
}

vs.

{
  "foo": "bar"
}

So far, I have tried the following solutions with no success:

Debugging a little into the code I found that Eclipse Parsson seems to be used to serialize the response. Is there any way to achieve the desired behavior?

1

There are 1 best solutions below

5
Jan Martiška On

Omitting fields that the client requested in a subselection would be against the GraphQL specification, so this is not possible.