From 35f989a26bc8bca9747990eb910a51566c60c4f4 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Thu, 19 Dec 2024 11:22:05 +0100 Subject: [PATCH] Request is optional on error object --- src/utils/graphQLClient.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/graphQLClient.tsx b/src/utils/graphQLClient.tsx index 7811c047..590bc3cb 100644 --- a/src/utils/graphQLClient.tsx +++ b/src/utils/graphQLClient.tsx @@ -75,7 +75,7 @@ export const createClient = (options?: Partial) => // Determine if the current error is an authentication error. didAuthError: (error) => - error.response.status === 401 || + error.response?.status === 401 || error.graphQLErrors.some((e) => e.message.includes("Must login")), // If didAuthError returns true, clear the token. Ideally we should refresh the token here.