Skip to content

Commit

Permalink
remove memoization to reduce memory pressure (#214)
Browse files Browse the repository at this point in the history
Co-authored-by: Nabeel Bukhari <[email protected]>
  • Loading branch information
nabeelbukhari and Nabeel Bukhari authored Jul 4, 2023
1 parent b559a08 commit edf3ae1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -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[],
Expand Down

0 comments on commit edf3ae1

Please sign in to comment.