Skip to content

Commit

Permalink
feat(globals): extend debug log (#188)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kirill-ivanovvv authored Jan 15, 2025
1 parent f0ffcf3 commit 6e5cd99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion globals/data/src/getters/apollo-error-link.getter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ export const getApolloErrorLink = (): ApolloLink => {
const extendedErrorResponse = errorResponse as unknown as {
graphQLErrors: Array<GraphQLFormattedError & { debugMessage: string }>
cause?: Record<string, any>
operation?: Record<string, any>
}
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}`)
Expand Down

0 comments on commit 6e5cd99

Please sign in to comment.