-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
It's possible for a type within a subgraph to be only "reachable" through a provides. Consider: ```graphql type Query { t: T @provides(fields: "a { ... on A { x }}") } type T @key(fields: "id") { id: ID! a: A @external } type A { x: Int } ``` In that case, type `A` is only mentioned by external field `T.a`, and as he code was completely ignoring external fields, that type `A` was not added to the underlying "query graph". But that type _is_ reachable through the `@provides` on `Query.t`, and as we were trying to handle that `@provides`, we were running into an assertion error due to `A` not existing in the "query graph". This patch ensures that when we have an external field, even if we don't add any edges, we at least add the target type to the "query graph", ensuring it exists later as we handle `@provides`.
- Loading branch information
Sylvain Lebresne
authored
Aug 23, 2022
1 parent
efadf8e
commit b7e788e
Showing
4 changed files
with
206 additions
and
17 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