-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Authorization: Fix fragment filtering (#4155)
Fix #4060 If a fragment was removed, whether because its condition cannot be fulfilled or its selections were removed, then the corresponding fragment spreads must be removed from the filtered query. This also fixes the error paths related to fragments: before, the path started at the fragment definition, while now the fragment's errors are added at the point of application
- Loading branch information
Showing
14 changed files
with
338 additions
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### Authorization: Fix fragment filtering ([Issue #4060](https://github.com/apollographql/router/issues/4060)) | ||
|
||
If a fragment was removed, whether because its condition cannot be fulfilled or its selections were removed, then the corresponding fragment spreads must be removed from the filtered query. | ||
|
||
This also fixes the error paths related to fragments: before, the path started at the fragment definition, while now the fragment's errors are added at the point of application | ||
|
||
By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4155 |
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 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 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
27 changes: 27 additions & 0 deletions
27
...apshots/apollo_router__plugins__authorization__authenticated__tests__fragment_fields.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
source: apollo-router/src/plugins/authorization/authenticated.rs | ||
expression: "TestResult { query: QUERY, result: doc, paths }" | ||
--- | ||
query: | ||
|
||
query { | ||
topProducts { | ||
type | ||
...F | ||
} | ||
} | ||
|
||
fragment F on Product { | ||
reviews { | ||
body | ||
} | ||
} | ||
|
||
filtered: | ||
{ | ||
topProducts { | ||
type | ||
} | ||
} | ||
|
||
paths: ["/topProducts/reviews/@"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,4 @@ filtered: | |
} | ||
} | ||
|
||
paths: ["/itf/... on User"] | ||
paths: ["/itf"] |
Oops, something went wrong.