Tutorial for learnign about GraphQL unions. You can find the blog link here
# install dependencies
$ yarn install
# start server
$ yarn start
query {
candy(id: $id) {
... on Candy {
name
price
}
... on OutOfStock {
restockDate
}
... on RegionUnavailability {
availableRegions
}
}
}