Skip to content

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

@vojtapol

Description

@vojtapol
Member
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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @vojtapol

        Issue actions

          Null boolean parameter is coerced to false when Java type is primitive boolean · Issue #425 · graphql-java-kickstart/graphql-java-tools