https://github.com/matiasanaya/go-graphql-subscription-example
go-graphql subscription example
https://github.com/matiasanaya/go-graphql-subscription-example
Last synced: 26 days ago
JSON representation
go-graphql subscription example
- Host: GitHub
- URL: https://github.com/matiasanaya/go-graphql-subscription-example
- Owner: matiasanaya
- Created: 2018-04-21T07:57:09.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-29T05:24:12.000Z (over 6 years ago)
- Last Synced: 2024-11-04T17:46:19.638Z (6 months ago)
- Language: Go
- Size: 15.6 KB
- Stars: 27
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ccamel - matiasanaya/go-graphql-subscription-example - go-graphql subscription example (Go)
README
# GraphQL subscription example
[](https://travis-ci.org/matiasanaya/go-graphql-subscription-example)This application uses:
* [github.com/graph-gophers/graphql-go](https://github.com/graph-gophers/graphql-go)
* [github.com/graph-gophers/graphql-transport-ws](https://github.com/graph-gophers/graphql-transport-ws)## Pre-requisites
**Requires Go 1.11.x** or above, which support Go modules. Read more about them [here](https://github.com/golang/go/wiki/Modules).
Remember to set ```GO111MODULE=on```
## How to use
Run the application:
```
go run main.go
```Navigate to [localhost:8080](http://localhost:8080) and use GraphiQL to subscribe using the following example:
```
subscription onHelloSaid {
helloSaid {
id
msg
}
}
```On a separate tab run:
```
mutation SayHello{
sayHello(msg: "Hello world!") {
id
msg
}
}
```