From 205b45149573df4b3d22d867b634c7f6cbf0c43b Mon Sep 17 00:00:00 2001 From: Nikola Bjelo Date: Thu, 1 Nov 2018 05:19:16 +0100 Subject: [PATCH] adding some data to error returning --- server/src/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/index.js b/server/src/index.js index 2ec8de3d2..683314b41 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -43,6 +43,14 @@ app.use('/graphql', graphqlHTTP(req => ({ userId: req.headers.userid, authorization: req.headers.authorization, }, + formatError(err) { + return { + message: err.message, + code: err.originalError && err.originalError.code, + locations: err.locations, + path: err.path, + }; + }, }))); app.get('/playground', expressPlayground({ endpoint: '/graphql' }));