1 | import "../utilities/globals/index.js";
|
2 | import type { GraphQLError, GraphQLErrorExtensions, GraphQLFormattedError } from "graphql";
|
3 | import type { ServerParseError } from "../link/http/index.js";
|
4 | import type { ServerError } from "../link/utils/index.js";
|
5 | import type { FetchResult } from "../link/core/index.js";
|
6 | export declare const PROTOCOL_ERRORS_SYMBOL: unique symbol;
|
7 | type FetchResultWithSymbolExtensions<T> = FetchResult<T> & {
|
8 | extensions: Record<string | symbol, any>;
|
9 | };
|
10 | export interface ApolloErrorOptions {
|
11 | graphQLErrors?: ReadonlyArray<GraphQLFormattedError>;
|
12 | protocolErrors?: ReadonlyArray<{
|
13 | message: string;
|
14 | extensions?: GraphQLErrorExtensions[];
|
15 | }>;
|
16 | clientErrors?: ReadonlyArray<Error>;
|
17 | networkError?: Error | ServerParseError | ServerError | null;
|
18 | errorMessage?: string;
|
19 | extraInfo?: any;
|
20 | }
|
21 | export declare function graphQLResultHasProtocolErrors<T>(result: FetchResult<T>): result is FetchResultWithSymbolExtensions<T>;
|
22 | export declare function isApolloError(err: Error): err is ApolloError;
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export type GraphQLErrors = ReadonlyArray<GraphQLError>;
|
30 | export type NetworkError = Error | ServerParseError | ServerError | null;
|
31 | export declare class ApolloError extends Error {
|
32 | name: string;
|
33 | message: string;
|
34 | graphQLErrors: ReadonlyArray<GraphQLFormattedError>;
|
35 | protocolErrors: ReadonlyArray<{
|
36 | message: string;
|
37 | extensions?: GraphQLErrorExtensions[];
|
38 | }>;
|
39 | clientErrors: ReadonlyArray<Error>;
|
40 | networkError: Error | ServerParseError | ServerError | null;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | cause: ({
|
47 | readonly message: string;
|
48 | extensions?: GraphQLErrorExtensions[] | GraphQLFormattedError["extensions"];
|
49 | } & Omit<Partial<Error> & Partial<GraphQLFormattedError>, "extensions">) | null;
|
50 | extraInfo: any;
|
51 | constructor({ graphQLErrors, protocolErrors, clientErrors, networkError, errorMessage, extraInfo, }: ApolloErrorOptions);
|
52 | }
|
53 | export {};
|
54 |
|
\ | No newline at end of file |