-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve composition hints around types that are strictly
@external
(#…
…2951) Note: 1st commit highlights the issue with a test case, 2nd commit proposes the change + test update. No existing tests are affected. Composition currently gives unhelpful hints around inconsistent value types which are only defined for the sake of referencing (all fields or type is marked `@external`). In the example test case, the `Permissions` type is only _referenced_ in the `account` (2nd) subgraph due to the `@requires`, so a partial definition seems reasonable here. The hint suggests adding the missing field in order to make the type consistent across subgraphs. However, if we take the actionable step recommended by that hint and add the missing field (and mark it `@external`, by necessity), we end up with a composition error instead: > [Subgraph2] Field "Permissions.canEdit" is marked @external but is not used in any federation directive (@key, @provides, @requires) or to satisfy an interface; the field declaration has no use and should be removed (or the field should not be @external).
- Loading branch information
1 parent
d7189a8
commit 33506be
Showing
3 changed files
with
94 additions
and
3 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,5 @@ | ||
--- | ||
"@apollo/composition": patch | ||
--- | ||
|
||
Stop emitting "inconsistent value type" hints against definitions where the type is marked `@external` or all fields are marked `@external`. |
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