Carol
0
Q:

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,
}
0

New to Communities?

Join the community