Is it possible to run an Apollo GraphQL Lambda backend with subscriptions? As I understand, GraphQL subscriptions use websockets, so I suppose it won't be possible unless you use Redis as message broker but I want to validate it this as it's not stated in any part of Apollo Docs.
Yes.
AWS lambdas now have websocket support via API Gateway. The serverless framework also now supports websockets without a plugin, making it really easy to implement.
GraphQL subscriptions are not supported with Lambda, Google Cloud functions, or Azure functions or most other serverless vendors. This is because the instance is shutdown when traffic is low, which kills the websocket connection. There are a few experimental setups that have gotten it to work, but I have not tried any of them myself.
You can find more information about this here.
I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With