graphql / express-graphql

Create a GraphQL HTTP server with Express.
MIT License
6.34k stars 538 forks source link

Unhandled errors does not provide mutation or query name #776

Open skiod opened 3 years ago

skiod commented 3 years ago

I'm trying t catch unhandled errors using

customFormatErrorFn : (err) => {

but it throws only stack like this

0|app      | customFormatErrorFn =>  GraphQLError: Variable "$profile_id" of non-null type "Int!" must not be null.
0|app      |     at _loop (/var/www/scalify-node-prod/node_modules/graphql/execution/values.js:103:15)
0|app      |     at coerceVariableValues (/var/www/scalify-node-prod/node_modules/graphql/execution/values.js:119:16)
0|app      |     at getVariableValues (/var/www/scalify-node-prod/node_modules/graphql/execution/values.js:48:19)
0|app      |     at buildExecutionContext (/var/www/scalify-node-prod/node_modules/graphql/execution/execute.js:184:61)
0|app      |     at executeImpl (/var/www/scalify-node-prod/node_modules/graphql/execution/execute.js:89:20)
0|app      |     at execute (/var/www/scalify-node-prod/node_modules/graphql/execution/execute.js:64:35)
0|app      |     at /var/www/scalify-node-prod/node_modules/express-graphql/index.js:152:16 {
0|app      |   locations: [ { line: 2, column: 75 } ]

Is there any ways to get mutation or query name in unhandled errors ?

Thank you

enisdenjo commented 1 year ago

This library has been deprecated and this repo will be archived soon. It has been superseded by graphql-http.

Furthermore, if you seek a fully-featured, well-maintained and performant server - I heavily recommend GraphQL Yoga!