From 6b8011e79d2e043665c6865ebf3339dc6766f949 Mon Sep 17 00:00:00 2001 From: wolfy1339 <4595477+wolfy1339@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:40:16 -0400 Subject: [PATCH] fix: `response.data.errors` is sometimes empty (#577) Fix #536 --- src/wrap-request.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wrap-request.ts b/src/wrap-request.ts index 28cadeff..352e0b41 100644 --- a/src/wrap-request.ts +++ b/src/wrap-request.ts @@ -35,6 +35,7 @@ async function requestWithGraphqlErrorHandling( if ( response.data && response.data.errors && + response.data.errors.length > 0 && /Something went wrong while executing your query/.test( response.data.errors[0].message, )