Skip to content

Commit 2362ffd

Browse files
authored
Merge pull request #3484 from graphql-java/deffered-callcontext-better-allocation
Does not allocate a default deferred context that is thrown away on transform
2 parents 09738ea + bf75d08 commit 2362ffd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/main/java/graphql/execution/ExecutionStrategyParameters.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static class Builder {
114114
ResultPath path = ResultPath.rootPath();
115115
MergedField currentField;
116116
ExecutionStrategyParameters parent;
117-
DeferredCallContext deferredCallContext = new DeferredCallContext();
117+
DeferredCallContext deferredCallContext;
118118

119119
/**
120120
* @see ExecutionStrategyParameters#newParameters()
@@ -188,6 +188,9 @@ public Builder deferredCallContext(DeferredCallContext deferredCallContext) {
188188
}
189189

190190
public ExecutionStrategyParameters build() {
191+
if (deferredCallContext == null) {
192+
deferredCallContext = new DeferredCallContext();
193+
}
191194
return new ExecutionStrategyParameters(executionStepInfo, source, localContext, fields, nonNullableFieldValidator, path, currentField, parent, deferredCallContext);
192195
}
193196
}

0 commit comments

Comments
 (0)