Error handling and logging
GraphQL servers can be tricky to debug. The following functions can help find error faster in many cases.
This function may be deprecated in the near future. Instead of using addErrorLoggingToSchema, the
formatError option of
graphqlHTTP should be used, which was recently added in graphql-js v0.5.0
addErrorLoggingToSchema takes two arguments:
schema must be an instance of
logger must be an Object with a callable property
log. Every time an error occurs,
logger.log(e) will be called.