apollo-link
apollo-link copied to clipboard
Removed Error type since it blocks the rest from showing up
While going over the apollo link example in https://www.apollographql.com/docs/link/links/context/,
if (networkError && networkError.name ==='ServerError' && networkError.statusCode === 401) {
// remove cached token on 401 from the server
token = null;
}
the statusCode
property wasn't recognized in my editor:
I believe since both ServerError
and ServerParseError
already include Error
with &
operator:
export declare type ServerError = Error & {
response: Response;
result: Record<string, any>;
statusCode: number;
};
export declare type ServerParseError = Error & {
response: Response;
statusCode: number;
bodyText: string;
};
it should make sense to remove it. The TS lint error disappears and allows me to see the valid contents of the error.
- [x] Make sure all of new logic is covered by tests and passes linting
- [x] Update CHANGELOG.md with your change
@DalerAsrorov: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/