Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: retry "Something went wrong" GraphQL error #396

Merged
merged 4 commits into from
Jan 25, 2023

Conversation

gr2m
Copy link
Contributor

@gr2m gr2m commented Jan 24, 2023

closes #395

@gr2m gr2m force-pushed the 395-feat-retry-on-graphql-something-went-wrong-error branch from aae870c to 6c21892 Compare January 25, 2023 01:15
Comment on lines +32 to +44
if (
response.data.errors &&
/Something went wrong while executing your query/.test(
response.data.errors[0].message
)
) {
// simulate 500 request error for retry handling
const error = new RequestError(response.data.errors[0].message, 500, {
request: options,
response,
});
throw error;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there is a more elegant solution to this, but I couldn't think of any. This is a very specific handling of basically the 500 error status version of GraphQL queries.

@gr2m gr2m merged commit f10aa37 into main Jan 25, 2023
@gr2m gr2m deleted the 395-feat-retry-on-graphql-something-went-wrong-error branch January 25, 2023 19:34
@github-actions
Copy link

🎉 This PR is included in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
released Type: Feature New feature or request
Projects
Archived in project
4 participants