I have the following types and:
union U = B|C|D
type A = { childs: U }
that I use with this fragment which works fine and apollo client is able to resolve child objects correctly
fragment A on A {
childs {
...B
...C
...D
}
}
when I convert this into
fragment A on A {
childs {
U
}
}
fragment U on U {
...B
...C
...D
}
the apollo client is not able to resolve the childs anymore, all objects are empty without any fields. Is there any way to merge the fragments?
First I think there might be a typo in your conversion? The U has missing
...
I think you should also try to use conditional fragments