Skip to content

rohinivsenthil/graphql-unions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL Unions with Apollo Server

Tutorial for learnign about GraphQL unions. You can find the blog link here

Running application

# install dependencies
$ yarn install
# start server
$ yarn start

Querying for a GraphQL union

query {
  candy(id: $id) {
    ... on Candy {
      name
      price
    }
    ... on OutOfStock {
      restockDate
    }
    ... on RegionUnavailability {
      availableRegions
    }
  }
}