try
.
Human
object type that has a property friends
(who are also humans). Because you could select different fields in Human
than in friends
(sub-Human
), Apollo generates two different nested structs for “each” of the humans. In TypeScript and JavaScript this is not a problem, since objects are not “locked” into definition. In Swift, however, this becomes problematic as you probably want to represent all your humans in your model with only one human type.
I ended up writing lots of boilerplate just to get it working, and would have to rewrite it in multiple places everytime backend team changed something.