tarantool / graphql

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

throw if it's impossible to coerce boolean value #15

Closed olegrok closed 3 years ago

olegrok commented 3 years ago

Graphql spec states:

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.

(https://spec.graphql.org/draft/#sec-Boolean)

So we can't coerce string, numeric and enum values. And here we faced main issue - because graphql parser considered "False" and "True" as enum values (correct boolean values is "true" and "false"). And if user passed "False" value to boolean argument it silently converted to true. This patch check that passed node type is boolean and raises if it's not so.

Closes #14