I have the following model
type Duck {
category: Baz
}
type Foo {
size: FooSize
}
type Bar {
size: BarSize
}
union Baz = Foo | Bar
The following query throws an error Validation error of type FieldsConflict: size: they return differing types FooSize and BarSize @ 'duck/category' (it's an intended behaviour as stated here : https://github.com/graphql/graphql-js/issues/53)
{
duck {
category {
... on Foo {
size
}
... on Bar {
size
}
}
}
}
Aliases on size would make the query work, but I can't use them here, because the query results will be passed back to another API which expect Duck.category to have a key named exactly size.
Is there any workaround, or schema refactoring I could use here to get this working ?