dustinsgoodman / serverless-microservices-graphql-template

A Serverless Framework getting started template for building microservice architectures with a public GraphQL API using nx for monorepo support.
MIT License
11 stars 0 forks source link

Enable GraphQL Subscriptions #9

Open dustinsgoodman opened 2 years ago

dustinsgoodman commented 2 years ago

Due to how Serverless interfaces with API Gateway, maintaining subscriptions for GraphQL does not work out of the box and requires some additional configuration to get it working. @reconbot created graphql-lambda-subscriptions to solve this problem, but it does require DynamoDB which not everyone is interested in doing.

This package uses Apollo Server 3, which disables subscriptions out of the box and recommends using a custom PubSub engine if you are to enable subscriptions. Given the info available, I'm going to look into either a Redis or SQS style solution for this problem.

reconbot commented 2 years ago

Most KV stores could do what I'm doing with ddb. Especially redis.

dustinsgoodman commented 2 years ago

I think the last time I explored this, we ended up forking your project and shoving redis in place of ddb. I'd be curious what you think when I get something open for this. 😄

reconbot commented 2 years ago

I'd be for making it pluggable

dustinsgoodman commented 2 years ago

👀 well the next time I pick things up, let me give that a shot 😄