@apollo/client
Version:
A fully-featured caching GraphQL client.
28 lines • 1.14 kB
TypeScript
import type { FormattedExecutionResult, GraphQLFormattedError } from "graphql";
import type { NetworkError } from "../../errors/index.js";
import { Observable } from "../../utilities/index.js";
import type { Operation, FetchResult, NextLink } from "../core/index.js";
import { ApolloLink } from "../core/index.js";
export interface ErrorResponse {
graphQLErrors?: ReadonlyArray<GraphQLFormattedError>;
networkError?: NetworkError;
response?: FormattedExecutionResult;
operation: Operation;
forward: NextLink;
}
export declare namespace ErrorLink {
/**
* Callback to be triggered when an error occurs within the link stack.
*/
interface ErrorHandler {
(error: ErrorResponse): Observable<FetchResult> | void;
}
}
export import ErrorHandler = ErrorLink.ErrorHandler;
export declare function onError(errorHandler: ErrorHandler): ApolloLink;
export declare class ErrorLink extends ApolloLink {
private link;
constructor(errorHandler: ErrorLink.ErrorHandler);
request(operation: Operation, forward: NextLink): Observable<FetchResult> | null;
}
//# sourceMappingURL=index.d.ts.map