22
33import graphql .Assert ;
44import graphql .PublicApi ;
5+ import graphql .execution .defer .DeferredErrorSupport ;
56import graphql .language .Field ;
67
78import java .util .List ;
@@ -22,15 +23,17 @@ public class ExecutionStrategyParameters {
2223 private final NonNullableFieldValidator nonNullableFieldValidator ;
2324 private final ExecutionPath path ;
2425 private final List <Field > currentField ;
26+ private final DeferredErrorSupport deferredErrorSupport ;
2527
26- private ExecutionStrategyParameters (ExecutionTypeInfo typeInfo , Object source , Map <String , List <Field >> fields , Map <String , Object > arguments , NonNullableFieldValidator nonNullableFieldValidator , ExecutionPath path , List <Field > currentField ) {
28+ private ExecutionStrategyParameters (ExecutionTypeInfo typeInfo , Object source , Map <String , List <Field >> fields , Map <String , Object > arguments , NonNullableFieldValidator nonNullableFieldValidator , ExecutionPath path , List <Field > currentField , DeferredErrorSupport deferredErrorSupport ) {
2729 this .typeInfo = assertNotNull (typeInfo , "typeInfo is null" );
2830 this .fields = assertNotNull (fields , "fields is null" );
2931 this .source = source ;
3032 this .arguments = arguments ;
3133 this .nonNullableFieldValidator = nonNullableFieldValidator ;
3234 this .path = path ;
3335 this .currentField = currentField ;
36+ this .deferredErrorSupport = deferredErrorSupport ;
3437 }
3538
3639 public ExecutionTypeInfo getTypeInfo () {
@@ -57,6 +60,10 @@ public ExecutionPath getPath() {
5760 return path ;
5861 }
5962
63+ public DeferredErrorSupport deferredErrorSupport () {
64+ return deferredErrorSupport ;
65+ }
66+
6067 /**
6168 * This returns the current field in its query representations. Global fragments mean that
6269 * a single named field can have multiple representations and different field subselections
@@ -96,6 +103,7 @@ public static class Builder {
96103 NonNullableFieldValidator nonNullableFieldValidator ;
97104 ExecutionPath path = ExecutionPath .rootPath ();
98105 List <Field > currentField ;
106+ DeferredErrorSupport deferredErrorSupport = new DeferredErrorSupport ();
99107
100108 /**
101109 * @see ExecutionStrategyParameters#newParameters()
@@ -112,8 +120,9 @@ private Builder(ExecutionStrategyParameters oldParameters) {
112120 this .fields = oldParameters .fields ;
113121 this .arguments = oldParameters .arguments ;
114122 this .nonNullableFieldValidator = oldParameters .nonNullableFieldValidator ;
115- this .path = oldParameters .path ;
116123 this .currentField = oldParameters .currentField ;
124+ this .deferredErrorSupport = oldParameters .deferredErrorSupport ;
125+ this .path = oldParameters .path ;
117126 }
118127
119128 public Builder typeInfo (ExecutionTypeInfo type ) {
@@ -156,8 +165,13 @@ public Builder path(ExecutionPath path) {
156165 return this ;
157166 }
158167
168+ public Builder deferredErrorSupport (DeferredErrorSupport deferredErrorSupport ) {
169+ this .deferredErrorSupport = deferredErrorSupport ;
170+ return this ;
171+ }
172+
159173 public ExecutionStrategyParameters build () {
160- return new ExecutionStrategyParameters (typeInfo , source , fields , arguments , nonNullableFieldValidator , path , currentField );
174+ return new ExecutionStrategyParameters (typeInfo , source , fields , arguments , nonNullableFieldValidator , path , currentField , deferredErrorSupport );
161175 }
162176 }
163177}
0 commit comments