This repo is using
- rails
- graphql-ruby
- apollo2
- ActionCable
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.
- check ActionCable's allowed origins
- check cable.yml
be sure to use anything other than
adapter: async
- don't just copy GraphqlChannel sample as is. It needs some changes.
I kept commands I ran in the log. It should self-explanatory.