title: apollo graphql's subscription on rails + actioncable + redis pubsub
body: <p>I am trying to archive graphql subscription using <a href="http://dev.apollodata.com/" rel="noreferrer">apollo</a> + Rails actioncable (redis pubsub backend).  </p>
  
  <h1>problem</h1>
  
  <p>Currently, I am using <a href="https://github.com/rmosolgo/graphql-ruby" rel="noreferrer">graphql-ruby</a> and doing <code>query</code> and <code>mutation</code> fine, but the gem doesn't support <code>subscription</code>.   </p>
  
  <h1>thoughts</h1>
  
  <p>I only have a minor knowledge about graphql and redis, and so this may sound foolish but I am thinking if I set up a separated graphql server (only for <code>subscription</code>) that is connected to the same redis database that the rails is using, broadcasting from rails' actioncable to the redis should be picked up by the graphql server?</p>
  
  <p><a href="https://i.stack.imgur.com/KtxOJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KtxOJ.png" alt="enter image description here"></a></p>
  
  <h2>rails</h2>
  
  <p>sends a hash data through <code>broadcast</code> as usual, no changes.</p>
  
  <pre class="lang-rb prettyprint-override"><code>ActionCable.server.broadcast(...)
  </code></pre>
  
  <h2>separated graphql server</h2>
  
  <p>setup a graphql server using <a href="https://dev-blog.apollodata.com/graphql-subscriptions-with-redis-pub-sub-f636fc84a0c4#.a3wrjxbfu" rel="noreferrer">GraphQL subscriptions with Redis Pub Sub</a> somehow, and wait for the rails' broadcastings through redis.</p>
  
  <h1>is this all workable?</h1>
  
  <p>or are there other possible ways to impliment graphql subscription in rails?</p>