/graphql_subscription_actioncable

a sample repo of how to use subscription with graphql-ruby + apollo2

Primary LanguageRuby

HOW TO USE GRAPHQL SUBSCRIPTION

This repo is using

JUST TRY IT OUT

git clone https://github.com/github0013/graphql_subscription_actioncable.git
cd graphql_subscription_actioncable
rails s

then open http://localhost:3000/. You should only see this.

Open another terminal and run

rails c

> GraphqlSubscriptionActioncableSchema.subscriptions.trigger('testSub', {}, Time.now.to_i)

then you should see a timestamp number on the page.

THINGS TO CHECK WHEN YOU IMPLEMENT GRAPHQL SUBSCRIPTION

check the git log

I kept commands I ran in the log. It should self-explanatory.