Description
As originally discussed in graphql/graphql-js#45, it would be useful to be able to declare a field type to be a combination of interfaces.
As an example use-case, let's say I have an interface
interface Image {
src: String
}
which represents an image I can display. Some images are stand-alone and I can link to them as a page, but other things share that capability (videos for instance). So I have another interface
interface Linkable {
url: String
}
Now let's say that all users have profile pictures which are linkable. I'd like to be able to declare something like this
type User {
profilePicture: Image + Linkable
}
When resolving such type, the only requirement is for the interfaces not to contain the same attributes. From there it should be possible to find the defining interface for each attribute and then the implementing type based on interface type resolution.