import { RequestResponseError, type RequestResponse } from '../request.js'; import type { GraphqlErrorData, GraphqlErrorLike, GraphqlRequest, GraphqlResponseData } from './interfaces.js'; /** Graphql 错误 */ export declare class GraphqlError extends RequestResponseError implements GraphqlErrorData, GraphqlErrorLike { constructor(request: GraphqlRequest, response: RequestResponse, error: GraphqlErrorData); /** 原始请求 */ readonly request: GraphqlRequest; } /** 多个 Graphql 错误,默认包含第一个错误的信息,其他错误在 `errors` 字段中 */ export declare class GraphqlAggregateError extends GraphqlError { constructor(request: GraphqlRequest, response: RequestResponse, errors: GraphqlError[]); /** 所有错误 */ readonly errors: readonly GraphqlError[]; } /** 包装其他错误 */ export declare function wrapError(error: T, request: GraphqlRequest, response?: RequestResponse): T & GraphqlErrorLike; /** 创建响应异常 */ export declare function checkError(request: GraphqlRequest, response: RequestResponse, payload: GraphqlResponseData | null): GraphqlError[] | undefined; //# sourceMappingURL=error.d.ts.map