Skip to content

Commit

Permalink
chore(common): merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-ivanovvv committed Jan 15, 2025
2 parents d4725e4 + f0ffcf3 commit 259790e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 11 additions & 8 deletions globals/data/src/getters/apollo-error-link.getter.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
/* eslint-disable no-console */

import type { ApolloLink } from '@apollo/client'
import type { ErrorResponse } from '@apollo/client/link/error'
import type { ApolloLink } from '@apollo/client'
import type { GraphQLFormattedError } from 'graphql'

import { onError } from '@apollo/client/link/error'
import { onError } from '@apollo/client/link/error'

export const getApolloErrorLink = (): ApolloLink => {
const errorLink = onError((errorResponse) => {
const extendedErrorResponse = errorResponse as unknown as ErrorResponse & {
const extendedErrorResponse = errorResponse as unknown as {
graphQLErrors: Array<GraphQLFormattedError & { debugMessage: string }>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
cause?: Record<string, any>
}
const { graphQLErrors, cause } = extendedErrorResponse

if (graphQLErrors) {
graphQLErrors.forEach(({ message, locations, path, extensions }) => {
console.debug(`[GraphQL error]: Message: ${message}`)
graphQLErrors.forEach(({ debugMessage, message, locations, path, extensions }) => {
console.debug(`DebugMessage: ${debugMessage}`)
console.debug(`Message: ${message}`)
console.debug(`Location:`, locations)
console.debug(`Path:`, path)
console.debug(`Extenstions:`, extensions)
})
}
if (cause) {
const { message, extensions, locations, path } = cause
console.debug(`Cause: ${message}`)
const { debugMessage, message, extensions, locations, path } = cause
console.debug(`DebugMessage: ${debugMessage}`)
console.debug(`Message: ${message}`)
console.debug(`Location:`, locations)
console.debug(`Path:`, path)
console.debug(`Extenstions:`, extensions)
Expand Down
3 changes: 3 additions & 0 deletions site/app/next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable */

Check failure on line 1 in site/app/next.config.js

View workflow job for this annotation

GitHub Actions / Lint

(unknown): Parsing error: /home/runner/work/shdvor/shdvor/site/app/next.config.js was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.

Parsing error: /home/runner/work/shdvor/shdvor/site/app/next.config.js was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.
Raw output
  1 | /* eslint-disable */
  2 |
  3 | import { join } from 'path'

import { join } from 'path'
import { dirname } from 'path'

Expand All @@ -22,6 +24,7 @@ const nextConfig = {
},
],
},

experimental: {
instrumentationHook: true,
externalDir: true,
Expand Down

0 comments on commit 259790e

Please sign in to comment.