Skip to content

Commit

Permalink
fix: improve graphql error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasLohoff committed Nov 5, 2024
1 parent d4bb47a commit 611f453
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/GraphQLService/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class GraphQLService extends GenericService {
const {data, errors } = await response.json() as GraphQLResponse<T>;

if (errors?.length > 0) {
throw new Error(`Error response: ${errors}`);
throw new Error(`GraphQL error: ${JSON.stringify(errors, null, "\t")}`);

Check warning on line 45 in src/service/GraphQLService/index.ts

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote

Check warning on line 45 in src/service/GraphQLService/index.ts

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
}

return data;
Expand Down

0 comments on commit 611f453

Please sign in to comment.