File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,22 +11,22 @@ import {
1111import type { FetchResult , NextLink , Operation } from "@apollo/client/link" ;
1212import { ApolloLink } from "@apollo/client/link" ;
1313
14- export interface ErrorResponse {
15- /**
16- * Error that caused the callback to be triggered.
17- */
18- error : ErrorLike ;
19- response ?: FetchResult ;
20- operation : Operation ;
21- forward : NextLink ;
22- }
23-
2414export namespace ErrorLink {
2515 /**
2616 * Callback to be triggered when an error occurs within the link stack.
2717 */
2818 export interface ErrorHandler {
29- ( error : ErrorResponse ) : Observable < FetchResult > | void ;
19+ ( error : ErrorHandlerOptions ) : Observable < FetchResult > | void ;
20+ }
21+
22+ export interface ErrorHandlerOptions {
23+ /**
24+ * Error that caused the callback to be triggered.
25+ */
26+ error : ErrorLike ;
27+ result ?: FetchResult ;
28+ operation : Operation ;
29+ forward : NextLink ;
3030 }
3131}
3232
@@ -51,14 +51,14 @@ export function onError(errorHandler: ErrorHandler): ApolloLink {
5151 if ( errors ) {
5252 retriedResult = errorHandler ( {
5353 error : new CombinedGraphQLErrors ( result , errors ) ,
54- response : result ,
54+ result,
5555 operation,
5656 forward,
5757 } ) ;
5858 } else if ( graphQLResultHasProtocolErrors ( result ) ) {
5959 retriedResult = errorHandler ( {
6060 error : result . extensions [ PROTOCOL_ERRORS_SYMBOL ] ,
61- response : result ,
61+ result,
6262 operation,
6363 forward,
6464 } ) ;
You can’t perform that action at this time.
0 commit comments