GraphQL subscriptions implementation using PostgreSQL's LISTEN/NOTIFY and apollo's graphql-subscriptions. Stable version 1.0.5, not actively maintained (last release 2019). Supports multiple subscription manager instances by leveraging Postgres pub/sub mechanism. Implements PubSubEngine and AsyncIterator interfaces. Compared to graphql-redis-subscriptions, it uses no additional infrastructure beyond Postgres. Limited to single-node Postgres; does not support horizontal scaling natively. Peer dependency graphql supports ^0.10.5 to ^14.0.0. Node >=6 required.
npm install graphql-postgres-subscriptionsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a PostgresPubSub instance with a pg.Client, then publishes and subscribes to events using LISTEN/NOTIFY.
Create a dedicated pg.Client (not from Pool) and pass that to PostgresPubSub.
Keep published payloads under 8000 bytes, or use a separate mechanism for large payloads.
Always await client.connect() before creating PostgresPubSub.
Upgrade to graphql-subscriptions v2 and check for API changes.
Reduce payload size below 8000 bytes, or split message into multiple publishes.
Create a new Client instance and connect it: const client = new Client(); await client.connect();
Install graphql-subscriptions: npm install graphql-subscriptions