Skip to content

Commit c9d1333

Browse files
committed
use memoizer correctly for normalized tree
1 parent a12f84b commit c9d1333

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/graphql/execution/ExecutionContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class ExecutionContext {
5454
private final Locale locale;
5555
private final ValueUnboxer valueUnboxer;
5656
private final ExecutionInput executionInput;
57+
private final Supplier<NormalizedQueryTree> queryTree;
5758

5859
ExecutionContext(ExecutionContextBuilder builder) {
5960
this.graphQLSchema = builder.graphQLSchema;
@@ -76,6 +77,7 @@ public class ExecutionContext {
7677
this.errors.addAll(builder.errors);
7778
this.localContext = builder.localContext;
7879
this.executionInput = builder.executionInput;
80+
queryTree = FpKit.interThreadMemoize(() -> NormalizedQueryTreeFactory.createNormalizedQuery(graphQLSchema, operationDefinition, fragmentsByName, variables));
7981
}
8082

8183

@@ -204,7 +206,7 @@ public ExecutionStrategy getSubscriptionStrategy() {
204206
}
205207

206208
public Supplier<NormalizedQueryTree> getNormalizedQueryTree() {
207-
return FpKit.interThreadMemoize(() -> NormalizedQueryTreeFactory.createNormalizedQuery(graphQLSchema, operationDefinition, fragmentsByName, variables));
209+
return queryTree;
208210
}
209211

210212
/**

0 commit comments

Comments
 (0)