Re:GraphQL Live Queries with live directive
by notrab on Monday January 16, 2023 @03:41PM
(#34405234)
I should add that using regular queries with Apollo, URQL, etc. is perfectly fine. If you're building an app that requires realtime data then `@live` queries can be really useful. The data can update in realtime without refreshing and there's no need for WebSockets!
There are limitations to server-sent events, but `@live` queries is a perfect fit imo.
There are many implementations of Live Queries (some that just use polling under the hood) but we really like the concept of using JSON Patch with SSE.