# GraphQL-AnyCable

> GraphQL subscriptions for AnyCable.

- URL: https://evilmartians.com/opensource/graphql-anycable
- GitHub: https://github.com/anycable/graphql-anycable
- Authors: Andrey Novikov, Vladimir Dementyev

---

A (mostly) drop-in replacement for default ActionCable subscriptions adapter shipped with graphql gem—but works with AnyCable!

[AnyCable](https://evilmartians.com/products/anycable) is fast because it does not execute any Ruby code. But the default subscription implementation shipped with [graphql gem] requires to do exactly that: re-evaluate GraphQL queries in ActionCable process. AnyCable doesn't support this (it's possible but hard to implement).

### Differences
- Subscription information is stored in the Redis database configured to be used by AnyCable. Expiration or data cleanup should be configured separately (see below).
- GraphQL queries for all subscriptions are re-executed in the process that triggers the event (it may be a web server, async jobs, rake tasks).

### Compatibility
- Should work with ActionCable in the development environment.
- Should work without Rails via [LiteCable].

[graphql gem]: https://github.com/rmosolgo/graphql-ruby
[AnyCable]: https://evilmartians.com/products/anycable
[LiteCable]: https://github.com/palkan/litecable
