mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
15 lines
536 B
TypeScript
15 lines
536 B
TypeScript
// Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
import type { ClientErrorContext } from '#shared/types/server/apollo/client.ts'
|
|
|
|
import type { Operation } from '@apollo/client/core'
|
|
|
|
export default function getErrorContext(operation: Operation): ClientErrorContext {
|
|
const defaultErrorContext: ClientErrorContext = {
|
|
logLevel: 'error',
|
|
}
|
|
const context = operation.getContext()
|
|
const error: Partial<ClientErrorContext> = context.error || {}
|
|
|
|
return Object.assign(defaultErrorContext, error)
|
|
}
|