I changed it to this:
import { RedisPubSub } from "graphql-redis-subscriptions";
import Redis from 'ioredis';
const options = {
host: 'localhost',
port: 6379,
retryStrategy: times => {
// reconnect after
return Math.min(times * 50, 2000);
}
};
const pubsub = new RedisPubSub({
publisher: new Redis(options),
subscriber: new Redis(options)
});
…and now I’m getting:
connect ECONNREFUSED 127.0.0.1:6379
…which is the same error I got with:
export const pubsub = new RedisPubSub({
});