Skip to content

Boolean scalars accept strings outside true and false (unlike literals) #1103

@tipok

Description

@tipok

I found an issue for Boolean typed scalars in

private Boolean convertImpl(Object input) {

As of GraphQL specs:
http://facebook.github.io/graphql/June2018/#sec-Boolean

Input Coercion

When expected as an input type, only boolean input values are accepted. All other input values must > raise a query error indicating an incorrect type.

The problem here:
If the value is a string the call Boolean.parseBoolean((String)input) returns a false if the string is not containing "true".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions