federation
federation copied to clipboard
Composition Failure due to INCONSISTENT_INPUT_OBJECT_FIELD lists unrelated subgraphs in message
Issue Description
If I have subgraphs defined as follows:
[
{
"name": "cat",
"sdl": "extend schema @link(url: \"https://specs.apollo.dev/link/v1.0\") @link(url: \"https://specs.apollo.dev/federation/v2.0\") input FoodInput { scoopsDryFood: Int, scoopsWetFood: Int }"
},
{
"name": "dog",
"sdl": "extend schema @link(url: \"https://specs.apollo.dev/link/v1.0\") @link(url: \"https://specs.apollo.dev/federation/v2.0\") input FoodInput { scoopsDryFood: Int }"
},
{
"name": "racoon",
"sdl": "type Query { eat: String }"
},
{
"name": "chicken",
"sdl": "type Chicken { name: String }"
},
{
"name": "cow",
"sdl": "extend schema @link(url: \"https://specs.apollo.dev/link/v1.0\") @link(url: \"https://specs.apollo.dev/federation/v2.0\") type Cow { name: String }"
}
]
composition fails with message:
[INCONSISTENT_INPUT_OBJECT_FIELD]: Input object field "scoopsWetFood" will not be added to "FoodInput" in the supergraph as it does not appear in all subgraphs: it is defined in subgraph "cat" but not in subgraphs "chicken", "cow", "dog" and "racoon".
The message lists all subgraphs, even those without the type FoodInput so it makes it hard to know which subgraphs I need to look into. I would expect the message to be:
[INCONSISTENT_INPUT_OBJECT_FIELD]: Input object field "scoopsWetFood" will not be added to "FoodInput" in the supergraph as it does not appear in all subgraphs: it is defined in subgraph "cat" but not in subgraphs "dog".
Link to Reproduction
https://github.com/dusty2020/rover-testing
Reproduction Steps
git clone https://github.com/dusty2020/rover-testing.git
cd rover-testing
rover supergraph compose --config supergraph.json > supergraph.graphql
Experiencing the same issue. The message is confusing.
Same here with federation v2.7.2 and rover v0.23.0