-
Notifications
You must be signed in to change notification settings - Fork 38
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
fix: display correct name for operations with fragments #411
fix: display correct name for operations with fragments #411
Conversation
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.
One simplification is possible, but otherwise it looks good
Co-authored-by: Benedikt Franke <[email protected]>
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.
Good change
bump? |
## [3.0.3](v3.0.2...v3.0.3) (2022-02-27) ### Bug Fixes * display correct name for operations with fragments ([#411](#411)) ([6b759b9](6b759b9)) * include errors in breadcrumbs starting with the first ([0d272ce](0d272ce)) * include partial GraphQL errors in breadcrumbs ([#410](#410)) ([a3d929d](a3d929d)) ### Performance Improvements * avoid repeated property accesses in SentryLink.ts ([#422](#422)) ([b32e4f5](b32e4f5))
🎉 This PR is included in version 3.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Currently when fetching the operation we take the first operation found. This can include fragments defined at the top of the query string which ends up with the wrong operation name and query
Approach
Find the first
OperationDefinition
and return that (this filters out fragment types but keeps mutations and queries which are still validated as a single definition in one operation string)Example of the fragment returned instead of the query