matiasanaya / go-graphql-subscription-example

go-graphql subscription example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL subscription example

Build Status

This application uses:

Pre-requisites

Requires Go 1.11.x or above, which support Go modules. Read more about them here.

Remember to set GO111MODULE=on

How to use

Run the application:

go run main.go

Navigate to 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
  }
}

About

go-graphql subscription example


Languages

Language:Go 100.0%