From 92220bfc79f9e560bea963637342b6f935c072aa Mon Sep 17 00:00:00 2001 From: Viet Nguyen <3805254+vnugent@users.noreply.github.com> Date: Sun, 8 Dec 2024 10:37:43 -0800 Subject: [PATCH] fix: explicitly set cache size --- src/server.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server.ts b/src/server.ts index 64ce12e..6eab999 100644 --- a/src/server.ts +++ b/src/server.ts @@ -5,6 +5,7 @@ import express from 'express' import cors from 'cors' import * as http from 'http' import bodyParser from 'body-parser' +import { InMemoryLRUCache } from '@apollo/utils.keyvaluecache' import { applyMiddleware } from 'graphql-middleware' import { graphqlSchema } from './graphql/resolvers.js' @@ -47,7 +48,9 @@ export async function createServer (): Promise<{ app: express.Application, serve introspection: true, schema, plugins: [ApolloServerPluginDrainHttpServer({ httpServer })], - cache: 'bounded' + cache: new InMemoryLRUCache({ + max: 100 + }) }) // server must be started before applying middleware await server.start()