tarantool / graphql

GraphQL implementation in Lua
MIT License
15 stars 3 forks source link

Incorrect boolean validation #14

Closed olegrok closed 3 years ago

olegrok commented 3 years ago
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.

Totktonada commented 3 years ago

It seems, it is the regression from 84e9cce88e033c232c3d80e0c2bf650e8b8c7a72.