Skip to content

Commit 92220bf

Browse files
committed
fix: explicitly set cache size
1 parent f527f17 commit 92220bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import express from 'express'
55
import cors from 'cors'
66
import * as http from 'http'
77
import bodyParser from 'body-parser'
8+
import { InMemoryLRUCache } from '@apollo/utils.keyvaluecache'
89

910
import { applyMiddleware } from 'graphql-middleware'
1011
import { graphqlSchema } from './graphql/resolvers.js'
@@ -47,7 +48,9 @@ export async function createServer (): Promise<{ app: express.Application, serve
4748
introspection: true,
4849
schema,
4950
plugins: [ApolloServerPluginDrainHttpServer({ httpServer })],
50-
cache: 'bounded'
51+
cache: new InMemoryLRUCache({
52+
max: 100
53+
})
5154
})
5255
// server must be started before applying middleware
5356
await server.start()

0 commit comments

Comments
 (0)