Skip to content

Incorrect boolean validation #14

@olegrok

Description

@olegrok
tarantool> require('graphql.parse').parse('{ a(arg: False) }')
---
- definitions:
  - operation: query
    selectionSet:
      selections:
      - arguments:
        - kind: argument
          name:
            kind: name
            value: arg
          value:
            kind: enum
            value: False
        name:
          kind: name
          value: a
        kind: field
      kind: selectionSet
    kind: operation
  kind: document
...

Imagine that we have argument of boolean type. We make a typo - write "False" instead of "false". Parser consider it as "enum", not boolean. Finally we don't have an error - after processing we have "true" boolean value.

From spec:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions