graphql-go
graphql-go copied to clipboard
panic with wrong input type
Hi,
When I use a wrong input argument, it panics. It works with {"name": ["abc"] }, but panics with {"name": "abc" }. A proper error would be better.
2016/11/29 18:00:45 CRITICAL: panic: interface conversion: interface is string, not []interface {}
goroutine 24 [running]:
...
github.com/neelance/graphql-go/internal/exec.coerceValue(0x0, 0x8b8840, 0xc4205154f0, 0x51bd20, 0xc4205143c0, 0xc42050d001, 0xc4205143d4, 0x1, 0xc4204142f8)
/Users/.../external/src/github.com/neelance/graphql-go/internal/exec/exec.go:649 +0x18c
github.com/neelance/graphql-go/internal/exec.coerceMap(0x0, 0xc4202d3058, 0xc42050c600, 0xc4202d3040, 0x0, 0x0)
/Users/.../external/src/github.com/neelance/graphql-go/internal/exec/exec.go:621 +0x144
github.com/neelance/graphql-go/internal/exec.ExecuteRequest(0x8c15c0, 0xc42050d290, 0xc4204387c0, 0xc420515440, 0xc4205143d4, 0x1, 0xc42050c600, 0x8c4aa0, 0xc4201dd900, 0xea2000, ...)
/Users/.../external/src/github.com/neelance/graphql-go/internal/exec/exec.go:323 +0x9c
github.com/neelance/graphql-go.(*Schema).Exec(0xc420536d00, 0x8c15c0, 0xc42050cc00, 0xc4202b8500, 0x4d8, 0xc4205143d4, 0x1, 0xc42050c600, 0x0)
INFO 2016-11-29 23:00:45,399 module.py:788] default: "POST /graphql HTTP/1.1" 500 -
/Users/.../external/src/github.com/neelance/graphql-go/graphql.go:125 +0x3cd
main.(*Handler).ServeHTTP(0xc42051b518, 0x8be100, 0xc420526420, 0xc42025c0f0)