Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sarathsr opened this issue May 18, 2023 · 1 comment

Comments

@Sarathsr
Copy link

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
Copy link

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");
}
},
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants