Skip to content
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 issue with path in query plan's deferred nodes #2281

Merged
merged 2 commits into from
Dec 2, 2022

Conversation

pcmanus
Copy link
Contributor

@pcmanus pcmanus commented Nov 28, 2022

The path currently included in the query plan for deferred nodes is a "response" path, meaning that it's essentially a path in a json object. But for deferred node, the idea was that the path, alongside the subselection that the deferred node also include, could be used to rebuild the subset of the query corresponding to the deferred part it represents, but because path misses fragments, this is not always possible to do.

This patch changes the path format to include fragments so it can be used to rebuild queries more directly (the new format also do not include @ for lists: this gets in the way of rebuilding queries from the path more than it helps, and ever when using the path to walk on responses, it's easy enough to handle lists without needing this).

@pcmanus pcmanus self-assigned this Nov 28, 2022
@netlify
Copy link

netlify bot commented Nov 28, 2022

👷 Deploy request for apollo-federation-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit be6eb09

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 28, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

The `path` currently included in the query plan for deferred nodes is a
"response" path, meaning that it's essentially a path in a json object.
But for deferred node, the idea was that the path, alongside the
`subselection` that the deferred node also include, could be used to
rebuild the subset of the query corresponding to the deferred part it
represents, but because `path` misses fragments, this is not always
possible to do.

This patch changes the `path` format to include fragments so it can be
used to rebuild queries more directly (the new format also do not
include `@` for lists: this gets in the way of rebuilding queries from
the path more than it helps, and ever when using the `path` to walk
on responses, it's easy enough to handle lists without needing this).
@pcmanus pcmanus merged commit 82a279f into apollographql:main Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants