graphql-community / koa-graphql

Create a GraphQL HTTP server with Koa.
MIT License
843 stars 61 forks source link

Set the HTTP status if one of the GraphQL errors has a status field #113

Closed entropitor closed 2 years ago

entropitor commented 6 years ago

Otherwise the status is always 500, which is not ideal, e.g. in case of a login mutation that failed because of an invalid password

chentsulin commented 2 years ago

These lines from express-graphql handles status and avoid setting it to 500 directly:

https://github.com/graphql-community/koa-graphql/blob/a5ea62198c342225fc769c02bbfa6bef15677c81/src/index.ts#L334-L340

Thanks