3 ms·
Huh, I've been thinking about a very similar service that does not require a dependency on GraphQL — https://poll2hook.com/ https://poll2hook.com/ You can defi
by vlaaad 4y ago
Huh, I've been thinking about a very similar service that does not require a dependency on GraphQL — https://poll2hook.com/ https://poll2hook.com/
You can define a query on any API, be it GraphQL or REST, and a jq query to extract events, and you are good to go. I wonder if this @live directive is implemented with polling?
- notrab 4y agoThis `@live` directive implementation uses server-sent events to send messages to the client with any changes that happen on the server in the format of https://jsonpatch.com https://jsonpatch.com This means users don't need to poll to fetch all the data again but only get the data that changes. Poll2Hook looks great though, certainly a great solution if the service you're using doesn't have something native built-in.
- n1ru4l 4y agoYou could also implement live queries using polling and the E-Tag, If-None-Match header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If...). We experimented with something similar on a customer project where having a long-lived HTTP connection was not possible.