A sample GraphQL Server built using graphql-yoga.
The sample shows how to implement queries, mutations, subscrptions as well as accessing headers.
git clone https://github.com/MarkNjunge/graphql-yoga-sample.git
yarn
yarn start
GraphQL Playground will be avaiable at localhost:3000/playground
.
The GraphQL endpoint will be localhost:3000/graphql
query {
hello(name:"Mark")
}
# Returns data from a header
query {
header(headerName:"Authorization")
}
mutation {
changeCount(value:10)
}
subscription {
helloSub{
total
greeting
}
}