From c21ace4451e8605dd048712da275d8908196c318 Mon Sep 17 00:00:00 2001 From: "Gudmundur D. Haraldsson" Date: Mon, 16 Dec 2024 17:44:34 +0000 Subject: [PATCH] Improve typing --- src/lib/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index d199ee3a0..79602fbaf 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -87,14 +87,14 @@ export function getAbsolutePath( filePath: string ): string { export function parseApiError( err: { networkError?: { message?: string }; message?: string; - graphQLErrors: unknown[]; + graphQLErrors?: { message?: string }[]; } ): string | null { if ( err?.networkError?.message ) { return err?.networkError?.message; } if ( err?.graphQLErrors && err?.graphQLErrors?.length > 0 && err?.graphQLErrors[ 0 ]?.message ) { - return err?.graphQLErrors[ 0 ]?.message; + return err?.graphQLErrors[ 0 ]?.message; } if ( err?.message ) {