Skip to content

Commit

Permalink
chore(tmp-993): add logs for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
seldinpQ committed Apr 30, 2024
1 parent 2fec2de commit 904c7e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/ssr/src/lib/graphql-error-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ const { onError } = require("apollo-link-error");

const errorLink = logger =>
onError(({ operation, networkError, graphQLErrors }) => {
logger.error("[Seldin] Error in GraphQL request");
let msg = "";
if (graphQLErrors) {
graphQLErrors.forEach(({ message }) => {
logger.error(
`[Seldin error]: Message: ${message}, Query: ${
operation.query
}, Variables: ${JSON.stringify(operation.variables)}`
);
msg = `[GraphQL error]: Message: ${message}, Query: ${
operation.query
}, Variables: ${JSON.stringify(operation.variables)}`;
Expand Down

0 comments on commit 904c7e6

Please sign in to comment.