-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update gateway to build & use new Query Plan format #4410
Merged
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
* ts errors gone
JakeDawkins
force-pushed
the
jake/planner-executor-updates
branch
from
August 4, 2020 20:51
9400fc2
to
51da4c6
Compare
4 tasks
* move new getResponseName to be type safe with qp builder * update query planner to produce new fetchNodes * replace query plan types entirely * swap over build/execute qp to new types * update snapshots for manual checking * update QP serializer so we can pretty print * update qp serializer to remove _entities printing * adjust function name to make more sense * fix imports/exports for QP types * fix cucumber & other serialization for tests * fix whitespace diffs in snapshots * remove old qp transform in tests * remove unused serializer function * address reviews, add comments - add new flattenEntitiesfield in place of old function which did a fuzzy check of a query's signature to eliminate the _entities field from a pretty-printed query plan. - this new function should be much safer, and harder to fool by accident - the rename also makes more sense for what it's doing -- it flattens an _entities operation two levels—getting rid of the `query {` and `_entities` and flattens other query definitions just to remove `query {` - fix added newlines from the pretty-printed query plan serializer - format files - add plenty of comments and descriptions around utility functions * update variable declaration to use const
JakeDawkins
changed the title
Update query plan executor to use new Query Plan format
Update gateway to build & use new Query Plan format
Aug 25, 2020
JakeDawkins
commented
Aug 25, 2020
JakeDawkins
commented
Aug 25, 2020
JakeDawkins
commented
Aug 25, 2020
abernix
approved these changes
Aug 25, 2020
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.
Nice!
Co-authored-by: Jesse Rosenberger <[email protected]>
trevor-scheer
approved these changes
Aug 26, 2020
packages/apollo-gateway/src/snapshotSerializers/astSerializer.ts
Outdated
Show resolved
Hide resolved
packages/apollo-gateway/src/snapshotSerializers/astSerializer.ts
Outdated
Show resolved
Hide resolved
packages/apollo-gateway/src/snapshotSerializers/astSerializer.ts
Outdated
Show resolved
Hide resolved
packages/apollo-gateway/src/snapshotSerializers/astSerializer.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Trevor Scheer <[email protected]>
…hql/apollo-server into jake/planner-executor-updates
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
resolves #4265
This PR aims to rebuild the query planner and executor for apollo-gateway to use the new query plan format, as defined in #4265
#4448 was merged into this PR and were already reviewed, so I'm going to leave some comments on this PR as to what files actually are unreviewed and need reviewing.
It's probably best not to review this PR by commit. Since these changes were made prior to the query plan builder, there was some translation work that had to be put in place to actually produce the new query plans for tests of the executor. Those changes were ripped out in #4448.
Changes:
selections
instead ofselectionSet.selections
since we flattened that structure.operation
instead ofsource
on fetchNodes