From 6e5cd999554a939847fa5356e863c67f159b4111 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Wed, 15 Jan 2025 15:49:00 +0300 Subject: [PATCH] feat(globals): extend debug log (#188) * style(github): format * feat(blog): log on query * style(ui): format * fix(blog): prepack script * feat(blog): logs on queries * refactor(blog): back server queries to stock * feat(globals): add error-link * refactor(globals): console.log to console.debug * fix(globals): apollo log * feat(globals): console debug message * feat(site): trigger build * feat(globals): extend debug log --- globals/data/src/getters/apollo-error-link.getter.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/globals/data/src/getters/apollo-error-link.getter.ts b/globals/data/src/getters/apollo-error-link.getter.ts index 4d71d7d3..f13db890 100644 --- a/globals/data/src/getters/apollo-error-link.getter.ts +++ b/globals/data/src/getters/apollo-error-link.getter.ts @@ -8,9 +8,14 @@ export const getApolloErrorLink = (): ApolloLink => { const extendedErrorResponse = errorResponse as unknown as { graphQLErrors: Array cause?: Record + operation?: Record } - const { graphQLErrors, cause } = extendedErrorResponse + const { graphQLErrors, cause, operation } = extendedErrorResponse + if (operation) { + console.debug('OperationVariables:', operation.variables) + console.debug('OperationQuery:', operation.query) + } if (graphQLErrors) { graphQLErrors.forEach(({ debugMessage, message, locations, path, extensions }) => { console.debug(`DebugMessage: ${debugMessage}`)