dgs-codegen icon indicating copy to clipboard operation
dgs-codegen copied to clipboard

omitNullInputFields does not work

Open MartinKanters opened this issue 2 years ago • 2 comments

Hi all, thanks for all the great work you are doing!

As the generated DSL only generates fields without input fields or with all input fields, we are trying to make use of the omitNullInputFields flag to ensure that we can skip some of them. Unfortunately it seems that the field omitNullInputFields does not seem to work (anymore?). A quick search in the codebase does not yield a lot of results either..

Is it still supported?

We are running on the latest versions:

  • graphql-dgs-client: 5.0.3
  • graphql-dgs-codegen-client-core: 5.1.17

MartinKanters avatar Jun 24 '22 14:06 MartinKanters

Is this a kotlin or java project? Also could you provide, so we can an example that fails for you so we can accurately reproduce and verify the fix? Thanks so much!

srinivasankavitha avatar Jul 05 '22 16:07 srinivasankavitha

Sure thing, here is the demo project. It is a Java project by the way, but I don't think it matters. As we are using Maven we are using deweyjose's codegen plugin. This is just a small wrapper around your codegen library, as you can see here

When you run the demo, it will output the serialized query string and fail with an exception if the null input argument is present.

MartinKanters avatar Jul 22 '22 09:07 MartinKanters