GraphQL subscriptions on AWS Lambda using API Gateway WebSockets and DynamoDB, compatible with the graphql-ws protocol. Version 6.0.0 is stable with no recent changes. It provides a serverless alternative to graphql-ws, eliminating the need for a persistent WebSocket server. Key differentiators: uses only DynamoDB, API Gateway, and Lambda; supports optional step functions for ping/pong; offers lifecycle hooks for subscriptions; and is TypeScript-compatible. Release cadence is irregular, with the last release over a year ago.
npm install graphql-lambda-subscriptionsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a GraphQL subscription server on AWS Lambda with DynamoDB persistence and exports the WebSocket handler.
Use ES module imports (import { makeServer } from 'graphql-lambda-subscriptions') or stay on v5.x.Install aws-sdk v2 (npm install aws-sdk@2) and use v2 DynamoDB DocumentClient.
Review the migration guide in the docs folder for v5 changes.
Create DynamoDB tables named 'Connection' and 'Subscription' (or configured names) with a TTL attribute before deployment.
Ensure your API Gateway has $connect, $disconnect, and $default routes all pointing to the same Lambda function that exports the webSocketHandler.
Run npm install graphql-lambda-subscriptions, and use ES import syntax (import { makeServer } from 'graphql-lambda-subscriptions').Ensure you call makeServer({ dynamodb, schema }) and export result.webSocketHandler as your Lambda handler.Create the tables with a primary key 'id' (String) and a TTL attribute. Default table names: 'Connection' and 'Subscription'.
Install aws-sdk v2 (npm install aws-sdk@2) and import DynamoDB from 'aws-sdk'.