davidyaha / graphql-redis-subscriptions

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

Fail to startup with IOREDIS v5.0.5 #520

Open geyang opened 2 years ago

geyang commented 2 years ago

This is related to #508. When ran encounters the following error:

import {PrismaClient} from "@prisma/client";
import {RedisPubSub} from 'graphql-redis-subscriptions';
import Redis from 'ioredis';

const options = {
  host: process.env.REDIS_HOST,
  port: Number.parseInt(process.env.REDIS_PORT),
  db: process.env.REDIS_DB,
  username: process.env.REDIS_USERNAME,
  password: process.env.REDIS_PASSWORD,
  retryStrategy: times => Math.min(times * 50, 2000)
};
console.log(options)

const pubsub = new RedisPubSub({
  publisher: new Redis(options),
  subscriber: new Redis(options)
});
node_modules/redis-parser/lib/parser.js:179
    return new ReplyError(string)
           ^

ReplyError: ERR value is not an integer or out of range
    at parseError (node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (node_modules/redis-parser/lib/parser.js:302:14) {
  command: { name: 'select', args: [ 'NaN' ] }
}
simplenotezy commented 2 years ago

In general I think it would be great to have ioredis bumped to version 5, so that it works with typeorm, which depends on ioredis 5