-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug/graphql querying #5712
Bug/graphql querying #5712
Conversation
Pull Request Test Coverage Report for Build 689602295
💛 - Coveralls |
Pull Request Test Coverage Report for Build 689689687Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
💙 vsf-next-demo successfully deployed at https://2285ea644fabad3c70f2be2dabea498071b34715.vsf-next-demo.preview.storefrontcloud.io |
}); | ||
return request; | ||
} catch (error) { | ||
throw error.graphQLErrors?.[0] || error.networkError?.result || error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this try...catch it give us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whole try catch allows us to catch an error that is thrown by GraphQL in the terminal but is not handled on the client side. This strange looking throw catches different parts of the error for different problems. The problem with GrapQL query limit is thrown in the NetworkError object of error, while bug with product id lives in GraphQLErrors. Normally it would only throw an error property or the whole error object, but here, with one change two problems can be fixed as they relate to each other.
Related Issues
closes #5692
closes #5693
Short Description of the PR
Correctly throw error when GraphQL query is over the complexity limit. Error is thrown in integration (Commercetools) and can be handled/displayed to the user later if needed.
Screenshots of Visual Changes before/after (if There Are Any)
5692
5693
Pull Request Checklist