From edf3ae1248c9e0770a7be7e5b750fdb915ebea19 Mon Sep 17 00:00:00 2001 From: Nabeel Bukhari Date: Tue, 4 Jul 2023 12:08:06 +0200 Subject: [PATCH] remove memoization to reduce memory pressure (#214) Co-authored-by: Nabeel Bukhari --- src/ast.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ast.ts b/src/ast.ts index 632047c3..ec47b915 100644 --- a/src/ast.ts +++ b/src/ast.ts @@ -33,7 +33,6 @@ import { isAbstractType } from "graphql/type"; import { CompilationContext, GLOBAL_VARIABLES_NAME } from "./execution"; import createInspect from "./inspect"; import { getGraphQLErrorOptions, resolveFieldDef } from "./compat"; -import { memoize4 } from "./memoize"; export interface JitFieldNode extends FieldNode { /** @@ -627,14 +626,7 @@ function getFieldEntryKey(node: FieldNode): string { export { resolveFieldDef }; -/** - * A memoized collection of relevant subfields in the context of the return - * type. Memoizing ensures the subfields are not repeatedly calculated, which - * saves overhead when resolving lists of values. - */ -export const collectSubfields = memoize4(_collectSubfields); - -function _collectSubfields( +export function collectSubfields( compilationContext: CompilationContext, returnType: GraphQLObjectType, fieldNodes: FieldNode[],