This is a tricky one: To support union types we need type-safe, open sum types that can combine both the correct handler for an Object with the field selection from an inline fragment - i.e. only evaluate the inline fragment if the server returned a specific handler.
I have some parts of the puzzle working (the open sum type) but I'm not entirely sure yet how the end-user code will work.
I recommend starting with something that's as close to an end-to-end test as you can manage. It can help when we don't know how things are supposed to look.
This is a tricky one: To support union types we need type-safe, open sum types that can combine both the correct handler for an
Object
with the field selection from an inline fragment - i.e. only evaluate the inline fragment if the server returned a specific handler.I have some parts of the puzzle working (the open sum type) but I'm not entirely sure yet how the end-user code will work.