Strapi v3 strapi-plugin-graphql redis

System Information
  • Strapi Version: 3.6.8
  • Operating System: MacOS BigSur
  • Database: MySQL
  • Node Version: v14.18.0
  • NPM Version: 8.3.2
  • Yarn Version: 1.22.10

How I can connect redis to ApolloServer via strapi-plugin-graphql in config/middleware.js?

const { RedisCache } = require("apollo-server-cache-redis");
const Redis = require('ioredis');

module.exports = {
  graphql: {
    amountLimit: 2000,
    apolloServer: {
      cache: new RedisCache({
        client: new Redis("redis://localhost:6379"),
      }),
    }
  },
};
1 Like

Is this post a question or an answer?

I don’t know how to make redis cache work with graphql.
so if someone can answer this form thanks.