From e7db98724c7d81381331c44c1aca370bb5e947b4 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 04:48:58 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20[Code=20Health]=20Refactor=20gra?= =?UTF-8?q?phql=20utility=20to=20use=20handleResponse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com> --- src/lib/github.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/lib/github.ts b/src/lib/github.ts index 86ec3b4..6dec86f 100644 --- a/src/lib/github.ts +++ b/src/lib/github.ts @@ -64,16 +64,8 @@ async function graphql(query: string, token?: string, variables?: Record "Unknown error"); - throw new GitHubApiError(body, res.status); - } - const json = (await res.json()) as { data?: T; errors?: { message: string }[] }; + + const json = await handleResponse<{ data?: T; errors?: { message: string }[] }>(res); if (json.errors && json.errors.length > 0) { throw new GitHubApiError(json.errors[0].message, 422); }