-
Notifications
You must be signed in to change notification settings - Fork 275
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(dual-query-planner): updated semantic diff to handle fragment name differences #6158
Conversation
✅ Docs Preview ReadyNo new or changed pages found. |
@duckki, please consider creating a changeset entry in |
CI performance tests
|
#6173 should be merged before this PR to avoid false mismatches. |
3e92696
to
67bae6f
Compare
// Thus, we can build the fragment name mapping in a single pass and compare | ||
// fragment definitions using the mapping at the same time, since earlier fragments | ||
// will never reference later fragments. | ||
x_frags.iter().try_fold((), |_, x_frag| { |
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.
Not important, but I think you're looking for .try_for_each
rather than .try_fold
using a unit.
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.
Well, I wanted to something like try_all
(rust-lang/rfcs#3233) or FallibleIterator
(but it's private). We should make FallibleIterator
more accessible :)
…e differences (apollographql#6158) - `same_ast_document` now creates a fragment mapping from the JS fragment name to matching Rust fragment name based on their definition body, not their places or names. - Fragment spreads in selection sets are compared after mapping JS fragment names to Rust fragment names.
Fragment definitions and their names could be slightly reordered/switched. This PR updates semantic diff to handle those differences.
same_ast_document
creates a fragment mapping from the JS fragment name to matching Rust fragment name based on their definition body, not their places or names.Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.