-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue when using a type condition on an inaccessible type in @req…
…uire (#1873) The `@require(fields:)` argument can use some type conditions to require data specific to a subtype. And those condition can even be on an `@inaccessible` type since "inaccessibility is about the federated API schema, not about subgraphs. However, this wasn't properly working because when the execution code was extracting the "requirements" data to pass it to the subgraph having the `@require`, the (federated) API schema we used, and consequently when the code tried to get the definition for the type condition in the `@require`, it didn't find any definition (since the type in question is `@inaccessible` and so not in said API schema) and as a result the corresponding fields were not included in the subgraph query. This commit fixes this issue, ensuring we pass the full supergraph (which _has_ the `@inaccessible` elements) to the execution code so that supergraph can be used when extracting required data. There was also another place within query planning (in `graphPath.ts` more precisely) where the code was looking up the possible implementation types, in the supergraph, of the required `@inaccessible` type, and was using the supergraph API to do so, which was incorrect for the same reason. This commit fix that problem as well, passing the full supergraph instead. Fixes #1866, #1863
- Loading branch information
Sylvain Lebresne
authored
Jun 29, 2022
1 parent
9d1dc82
commit d3734ef
Showing
8 changed files
with
372 additions
and
30 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
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
Oops, something went wrong.