From 87ff25b2df9645dcdc77ed77c85d052e57e0873c Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Thu, 22 Nov 2018 12:58:19 +0200 Subject: [PATCH] Instantiate `lru-cache` class using `new` in `InMemoryLRUCache`. (#2007) This is mandated by `lru-cache` v5 and surfaced the CircleCI failures on #2004: https://circleci.com/gh/apollographql/apollo-server/22537 Luckily, this is a private implementation detail of Apollo Server's `InMemoryLRUCache` so no additional changes should be necessary and we should be able to update to `lru-cache` 5.0.0 in a semver minor respectful way. --- packages/apollo-server-caching/src/InMemoryLRUCache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/apollo-server-caching/src/InMemoryLRUCache.ts b/packages/apollo-server-caching/src/InMemoryLRUCache.ts index 2f3470c2005..719db2ba34a 100644 --- a/packages/apollo-server-caching/src/InMemoryLRUCache.ts +++ b/packages/apollo-server-caching/src/InMemoryLRUCache.ts @@ -6,7 +6,7 @@ export class InMemoryLRUCache implements KeyValueCache { // FIXME: Define reasonable default max size of the cache constructor({ maxSize = Infinity }: { maxSize?: number } = {}) { - this.store = LRU({ + this.store = new LRU({ max: maxSize, length: item => item.length, });