https://github.com/marknjunge/graphql-yoga-sample
A sample GraphQL Server built using graphql-yoga.
https://github.com/marknjunge/graphql-yoga-sample
graphql graphql-server graphql-yoga
Last synced: over 1 year ago
JSON representation
A sample GraphQL Server built using graphql-yoga.
- Host: GitHub
- URL: https://github.com/marknjunge/graphql-yoga-sample
- Owner: MarkNjunge
- License: mit
- Created: 2018-05-04T19:51:01.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-06T17:22:02.000Z (about 8 years ago)
- Last Synced: 2025-02-15T07:29:01.410Z (over 1 year ago)
- Topics: graphql, graphql-server, graphql-yoga
- Language: JavaScript
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# graphql-yoga sample
A sample GraphQL Server built using [graphql-yoga](https://github.com/graphcool/graphql-yoga).
The sample shows how to implement queries, mutations, subscrptions as well as accessing headers.
[**Live version**](https://secret-castle-94933.herokuapp.com/playground)
## Installation
```
git clone https://github.com/MarkNjunge/graphql-yoga-sample.git
yarn
yarn start
```
GraphQL Playground will be avaiable at [`localhost:3000/playground`](http://localhost:3000/playground).
The GraphQL endpoint will be `localhost:3000/graphql`
## Sample queries
### Query
``` graphql
query {
hello(name:"Mark")
}
# Returns data from a header
query {
header(headerName:"Authorization")
}
```
### Mutation
``` graphql
mutation {
changeCount(value:10)
}
```
### Subscrption
``` graphql
subscription {
helloSub{
total
greeting
}
}
```