packages/realtime/README.md
The real-time solution for RedwoodJS is initially for GraphQL.
In GraphQL, there are two options for real-time updates: live queries and subscriptions. Subscriptions are part of the GraphQL specification, whereas live queries are not.
There are times where subscriptions are well-suited for a realtime problem — and in some cases live queries may be a better fit. Later we’ll explore the pros and cons of each approach and how best to decide that to use and when.
RedwoodJS Realtime handles the hard parts of a GraphQL Realtime implementation by automatically:
@requireAuth directives already protecting other queries and mutations (or you can implement your own validator directive)@live query directive to your GraphQL schema and setting up the useLiveQuery envelop plugin to handle requests, invalidation, and managing the storage mechanism neededIt provides a first-class developer experience for real-time updates with GraphQL so you can easily
and have the latest data reflected in your app.
Lastly, the Redwood CLI has commands to
Regardless of the implementation chosen, a stateful server and store are needed to track changes, invalidation, or who wants to be informed about the change.
The useRedwoodRealtime plugin adds support for Redwood Realtime in GraphQL Yoga Server.
Note: Since a stateful server and store are needed, this plugin cannot be used this RedwoodJS applications deployed to serverless.
<!-- ## Package size | Version | Publish | Install | | :--------------------------------------------------------------------------------- | :------ | :------ | | [v5.2.1](https://packagephobia.com/result?p=%40redwoodjs%2Fproject-config%405.2.1) | 96.6 kB | 809 kB | ## Dependency graphs ### src  ### dist  -->Warning
This is a new internal package. There are still changes we want to make, so we're marking it as experimental for now. Don't depend on this directly in a Redwood project.