cloudflare / workers-graphql-server

🔥Lightning-fast, globally distributed Apollo GraphQL server, deployed at the edge using Cloudflare Workers
https://graphql-on-workers.signalnerve.com/___graphql
708 stars 519 forks source link

Question: Realtime Updates supported #8

Closed g3rd closed 3 weeks ago

g3rd commented 5 years ago

Does Cloudflare Workers' GraphQL Server allow for subscription / realtime updates?

kristianfreeman commented 5 years ago

Hey @g3rd - we don't currently support it as the Workers platform doesn't have Websockets or anything along those lines.

You should be able to use the Apollo client's polling/refetching capabilities, I haven't tested it personally yet, but planning on trying it out at some point in the future. Let me know if you end up trying it!

g3rd commented 5 years ago

I'll be giving is a shot soon, and keep you posted!

Niko-La commented 5 years ago

@g3rd please keep us updated. iot needs real time and subscriptions

@signalnerve is there a delay initially which is typical for serverless functions at the initial bootup? Usually cloud function vendors tell you to run a hack to preserve the function indefinitely.

lewisl9029 commented 3 years ago

Seems like subscriptions might be possible now with the introduction of durable objects? https://blog.cloudflare.com/introducing-workers-durable-objects/

Would love to see this starter extended with subscriptions, or at least some guidelines on best practices.

kristianfreeman commented 3 years ago

Seems like subscriptions might be possible now with the introduction of durable objects? https://blog.cloudflare.com/introducing-workers-durable-objects/

Would love to see this starter extended with subscriptions, or at least some guidelines on best practices.

Indeed! Since this issue was created Durable Objects have been birthed into existence :) I'm going to take some time this year to look at Durable Objects and if it will allow us to do subscriptions, that would be amazing! No updates at the moment but when we open DO up for public beta, I'd love to have someone else tackle it too if they're interested 👍

AlaaZorkane commented 3 years ago

Hey @signalnerve ! Any updates on this? Especially regarding the latest websocket update?