Answer the question
In order to leave comments, you need to log in
How to log errors in ApolloServer?
When I make a request, I make an error, as a result, it comes in the response, but I can’t get it to write it to the log. I'm trying to deal with logging in apollo, I will be glad to all the advice.
RESOLVER
getSomething: () => {
throw new Error("hello error");
return service.getAllSomething();
},
const logger = {
async didEncounterErrors(requestContext) {
console.log('some error');
},
async requestDidStart(requestContext) {
console.log('Request started! Query:\n' + requestContext.request.query);
return {
async didEncounterErrors(requestContext) {
console.log('some error');
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question