Answers for "how to return multiple types in graphql schema"

0

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,
}
Posted by: Guest on August-01-2020

Code answers related to "how to return multiple types in graphql schema"

Browse Popular Code Answers by Language