adding some data to error returning

This commit is contained in:
Nikola Bjelo committed 2018-11-01 05:19:16 +01:00
1 parent df4dbef6d0
commit 205b451495
1 file changed
+8
+8
View File
@@ -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' }));