graphql-java-tools icon indicating copy to clipboard operation
graphql-java-tools copied to clipboard

Null boolean parameter is coerced to false when Java type is primitive boolean

Open vojtapol opened this issue 5 years ago • 0 comments

mutation  {
  createCat(enabled: Boolean): Cat! 
}
public Cat createCat(boolean enabled) {
   ...
}

when executing:

mutation {
  createCat {
    id
   }
}

The value of enabled gets coerced to false. Instead, this should throw and require a nullable Boolean type to be used instead. Preferably it should throw at startup.

vojtapol avatar Aug 06 '20 19:08 vojtapol