davidyaha / graphql-redis-subscriptions

A graphql subscriptions implementation using redis and apollo's graphql-subscriptions
MIT License
1.11k stars 125 forks source link

graphql-redis-subscriptions version 2.6.0 is not working with Node 16.0.0 #603

Open Sarathsr opened 1 year ago

Sarathsr commented 1 year ago

Updated my node version from node 14.16.0 to node 16.0.0.

const { RedisPubSub } = require('graphql-redis-subscriptions/dist/redis-pubsub'); export const pubSub = new RedisPubSub({ publisher: new Redis(readOptions), subscriber: new Redis(readOptions), })

The pubSub.publish stopped working. Working fine with Node 14.16.0

gulshan-dev123789 commented 11 months ago

any correction in below code ?? my node vr. is 18.16.1 graphql-redis-subscriptions version 2.6.0

const subs = new Redis({ host: "127.0.0.1", port: 6379, retryStrategy: (times) => { // reconnect after return Math.min(times 50, 2000); }, // db: 0, // password: process.env.REDIS_PASS, }); const pubs = new Redis({ host: "127.0.0.1", port: 6379, retryStrategy: (times) => { // reconnect after return Math.min(times 50, 2000); }, // db: 0, // password: process.env.REDIS_PASS, }); const redisIns = process.env.NODE_ENVIRONMENT === "production" ? { publisher: subs, subscriber: pubs, } : {}; const pubsub = new RedisPubSub({ ...redisIns, connectionListener: (err) => { if (err) { console.log("err", err); } else { console.log("Pubsub: Succefuly connected to redis"); } }, });