tarantool / graphql

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

coerce* in types submodule silenly returns nil if coercion failed #56

Open no1seman opened 2 years ago

no1seman commented 2 years ago

coerceInt, coerceLong, coerceFloat, coerceBoolean, coerceString - silenly returns nil if coesion failed:

https://github.com/tarantool/graphql/blob/58b64a6672e4aa86a9d649bfd66a619948b31f2e/graphql/types.lua#L263

https://github.com/tarantool/graphql/blob/58b64a6672e4aa86a9d649bfd66a619948b31f2e/graphql/types.lua#L302

https://github.com/tarantool/graphql/blob/58b64a6672e4aa86a9d649bfd66a619948b31f2e/graphql/types.lua#L346

Seems it wiil better to raise an error if coercion failed (to be discussed)

no1seman commented 2 years ago

Also pay attention to this comment: https://github.com/tarantool/graphql/pull/55#discussion_r852604639