mobilizon.chapril.org-mobil.../js/src/types/apollo.ts
Thomas Citharel e96dcc42b9
Move to Apollo v3
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2021-06-04 13:33:18 +02:00

11 lines
319 B
TypeScript

import { ServerParseError } from "@apollo/client/link/http";
import { ServerError } from "@apollo/client/link/utils";
function isServerError(
err: Error | ServerError | ServerParseError | undefined
): err is ServerError {
return !!err && (err as ServerError).statusCode !== undefined;
}
export { isServerError };