Skip to content

Files

Latest commit

23eb7b5 · Mar 23, 2021

History

History
50 lines (42 loc) · 639 Bytes

File metadata and controls

50 lines (42 loc) · 639 Bytes

Streaming RPC / Subscription

How to run

cd examples/subscription
./start.sh

Then, open http://localhost:4000 in browser.

Generated GraphQL schema

Subscription example:

subscription  {
  serverStreaming(request:{
    names:["Rust","ProtoBuf","GraphQL"]
  }){
    message
  }
}

Result:

{
  "data": {
    "serverStreaming": {
      "message": "Hello Rust!"
    }
  }
}
{
  "data": {
    "serverStreaming": {
      "message": "Hello ProtoBuf!"
    }
  }
}
{
  "data": {
    "serverStreaming": {
      "message": "Hello GraphQL!"
    }
  }
}