Skip to content

Commit

Permalink
Reinstate bounded documentStore (#6548)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-scheer committed Jun 15, 2022
1 parent ac8f9bf commit 549070e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/ApolloServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ export class ApolloServerBase<
// random prefix each time we get a new schema.
documentStore:
this.config.documentStore === undefined
? new UnboundedCache()
? new InMemoryLRUCache()
: this.config.documentStore === null
? null
: new PrefixingKeyValueCache(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { DocumentNode } from 'graphql';

import { ApolloServerBase } from '../ApolloServer';
import assert from 'assert';
import { UnboundedCache } from '../utils/UnboundedCache';
import { InMemoryLRUCache } from '@apollo/utils.keyvaluecache';

const typeDefs = gql`
type Query {
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('ApolloServerBase documentStore', () => {
const options = await server.graphQLServerOptions();
const embeddedStore = options.documentStore;
assert(embeddedStore);
expect(embeddedStore).toBeInstanceOf(UnboundedCache);
expect(embeddedStore).toBeInstanceOf(InMemoryLRUCache);

await server.executeOperation(operations.simple.op);

Expand Down

0 comments on commit 549070e

Please sign in to comment.