Created
October 24, 2017 07:50
-
-
Save zapkub/fbb4cf4ce4bc7947a6e2a532679325f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
graphqlExpress(req => { | |
const extendContext = require('./graphql').getGraphQLExtendedContext(req) | |
// } | |
return ({ | |
schema, | |
tracing, | |
context: { | |
...req, | |
...extendContext | |
}, | |
formatError: ({ originalError, message, stack }) => { | |
if (originalError && !(originalError instanceof GenericError)) { | |
console.error('GraphQL track:', originalError) | |
} | |
return { | |
message: message, | |
code: originalError ? originalError.code : null, | |
stack: dev ? stack.split('\n') : null | |
} | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment