Skip to content

Latest commit

 

History

History

subscription

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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!"
    }
  }
}