-
Notifications
You must be signed in to change notification settings - Fork 336
fix: Return root when parts of a query with deferred fragment #2188
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
Closed
Closed
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
8b8c8b9
split queries between primary and deferred parts
994dac2
handle named fragments
84e9d83
cleanup
5f993b9
do nnot add the defer directive to the generated query
597fbc8
logs
62a3fb7
Merge branch 'dev' into geal/split-queries
73c24fb
update router-bridge and apollo-encoder
405803c
handle queryPath in deferred nodes
02bdb78
split arrays
0364c60
Merge branch 'dev' into geal/split-queries
0563c78
missing snapshots
f903ee5
missing snapshot
ecb2dcb
lint
93a7ec2
handle arrays
9b222bf
remove unused code
606dcbd
add comments
cdf1b03
Merge branch 'dev' into geal/split-queries
3a1bc19
update router-bridge to fix CI builds
e794955
update router-bridge
223bc97
Merge branch 'dev' into geal/split-queries
20eeefe
Merge branch 'dev' into geal/split-queries
b545775
fix: Return root when parts of a query with deferred fragment
bnjjj 643b547
move code in the right method
bnjjj 7160516
tests: fix test for root typename with defer
bnjjj ad1d075
tests: only keep the test
bnjjj 0d0d385
fix: root typename with defer
bnjjj 2cd855c
Merge branch 'dev' into bnjjj/fix_1677
1b679ee
tests: add test with typename and defer
bnjjj ba258f9
tests: add test with typename and defer
bnjjj 6f928aa
Merge branch 'dev' of github.com:apollographql/router into bnjjj/fix_…
bnjjj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
42 changes: 42 additions & 0 deletions
42
...shots/apollo_router__services__supergraph_service__tests__root_typename_with_defer-2.snap
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| source: apollo-router/src/services/supergraph_service.rs | ||
| expression: stream.next_response().await.unwrap() | ||
| --- | ||
| { | ||
| "hasNext": false, | ||
| "incremental": [ | ||
| { | ||
| "data": { | ||
| "name": null | ||
| }, | ||
| "path": [ | ||
| "currentUser", | ||
| "activeOrganization", | ||
| "suborga", | ||
| 0 | ||
| ] | ||
| }, | ||
| { | ||
| "data": { | ||
| "name": "A" | ||
| }, | ||
| "path": [ | ||
| "currentUser", | ||
| "activeOrganization", | ||
| "suborga", | ||
| 1 | ||
| ] | ||
| }, | ||
| { | ||
| "data": { | ||
| "name": null | ||
| }, | ||
| "path": [ | ||
| "currentUser", | ||
| "activeOrganization", | ||
| "suborga", | ||
| 2 | ||
| ] | ||
| } | ||
| ] | ||
| } |
26 changes: 26 additions & 0 deletions
26
...apshots/apollo_router__services__supergraph_service__tests__root_typename_with_defer.snap
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| source: apollo-router/src/services/supergraph_service.rs | ||
| expression: res | ||
| --- | ||
| { | ||
| "data": { | ||
| "currentUser": { | ||
| "activeOrganization": { | ||
| "id": "0", | ||
| "suborga": [ | ||
| { | ||
| "id": "1" | ||
| }, | ||
| { | ||
| "id": "2" | ||
| }, | ||
| { | ||
| "id": "3" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "__typename": "Query" | ||
| }, | ||
| "hasNext": true | ||
| } |
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
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.
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.
could this be moved (again, sorry 🙏) under the match branch on
Selection::Field?The current operation is already selected at line 670 (and it might not be the first one in the list)
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.
I think it could be fixed for the
InlineFragmentandFragmentSpreadas well, by going through the selection set before callingapply_selection_set. That would not work with nested fragments though