Serverless GraphQL

Hello,

I recently read the posts about running GraphQL with Serverless on AWS Lambda and I got it working well. However I would like to utilize GraphQL subscriptions in my app and don’t know how to go about it with this structure. I know that AWS Lambda doesn’t support web sockets since the connection is only opened for a small period of time.

Has anyone here used serverless to deploy GraphQL and found a way to also use GraphQL subscriptions maybe with another AWS service?

Looking forward to reading any responses.

Thanks!

I’m quite new to GraphQL, I’d never even heard of subscriptions before! :smile:

After having now read a little about it, it seems like GraphQL uses a PubSub service to update clients. AWS has SNS for this purpose, so I’d imagine you could use that.

Looking around, seems there’s an older project that might be a good base (although outdated): https://github.com/jonsharratt/graphql-aws.

Please do let us know how it goes :smiley:

Interesting, I haven’t considered using AWS SNS but will look into it. After researching some more, people have been suggesting AWS IoT as well to maintain a websocket connection. If I can find a way to integrate that with GraphQL Subscriptions that may be a good solution as well.