graphql multiple types code example
Example: how to return multiple types in graphql schema
type Artist {
id: Int,
name: String,
}
type Venue {
id: Int,
name: String,
}
union Owner = Artist | Venue
type Event {
id: Int!,
owner: Owner,
}
type RootQuery {
event(id: Int): Event,
venue(id: Int): Venue,
}