-
Notifications
You must be signed in to change notification settings - Fork 273
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
reconstruct deferred queries with knowledge about fragments #2109
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
the deferred node's path now contains fragments to help in query reconstruction, and the flatten elements are not present anymore
Geal
changed the title
split queries between primary and deferred parts
reconstruct deferred queries with knowledge about fragments
Dec 9, 2022
Geal
requested review from
a team,
SimonSapin and
BrynCooke
and removed request for
a team
December 9, 2022 08:43
asking for a review on this before it is done, because the code is finished but it's waiting for a query planner and router-bridge release |
bnjjj
approved these changes
Dec 12, 2022
BrynCooke
approved these changes
Dec 12, 2022
Geal
pushed a commit
that referenced
this pull request
Dec 12, 2022
Fix #1818 Fix #2185 Blocked by #2109 (waiting for the router-bridge update) When errors are generated during the primary execution, some of them can be affected to deferred responses. To handle that, we need to: - transmit errors from the primary query to deferred node execution along with the primary fetches - be able to check if an error path belongs to a deferred query Since the error path may belong to a part of the response that was nullified, we need to follow the error path through the primary or deferred queries Co-authored-by: Jeremy Lempereur <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #2105
Fix #2099
When we are using
@defer
, response formatting must apply on a subset of the query (primary or deferred), that is reconstructed from information provided by the query planner: a path into the response and a subselection. Previously, the query planner did not add fragments to that path, which resulted in reconstruction issues for queries like:we would get a deferred part with the path
/me/memberships/account
and the subselection{ name }
. The path does not give enough information to reconstruct the query whenme
returns an interface: we cannot know which type is used.The query planner 2.2.2 introduces a fragment in the path to solve that, like
/me/... on User/memberships/account
. It also removes the 'flatten' element from deferred nodes paths, so the code has to be adapted a bit.