@@ -50,8 +50,6 @@ protected RequestStack getStack() {
5050 public ExecutionStrategyInstrumentationContext beginExecutionStrategy (InstrumentationExecutionStrategyParameters parameters ) {
5151 ExecutionId executionId = parameters .getExecutionContext ().getExecutionId ();
5252 ExecutionPath path = parameters .getExecutionStrategyParameters ().getPath ();
53- List <Selection > selectionSet = Optional .ofNullable (parameters .getExecutionStrategyParameters ().getField ())
54- .map (MergedField ::getSingleField ).map (Field ::getSelectionSet ).map (SelectionSet ::getSelections ).orElse (Collections .emptyList ());
5553 int parentLevel = path .getLevel ();
5654 int curLevel = parentLevel + 1 ;
5755 int fieldCount = parameters .getExecutionStrategyParameters ().getFields ().size ();
@@ -74,7 +72,7 @@ public void onCompleted(ExecutionResult result, Throwable t) {
7472 @ Override
7573 public void onFieldValuesInfo (List <FieldValueInfo > fieldValueInfoList ) {
7674 synchronized (stack ) {
77- stack .setStatus (executionId , handleOnFieldValuesInfo (fieldValueInfoList , stack , executionId , curLevel , selectionSet ));
75+ stack .setStatus (executionId , handleOnFieldValuesInfo (fieldValueInfoList , stack , executionId , curLevel ));
7876 if (stack .allReady ()) {
7977 dispatchWithoutLocking ();
8078 }
@@ -86,7 +84,7 @@ public void onDeferredField(MergedField field) {
8684 // fake fetch count for this field
8785 synchronized (stack ) {
8886 stack .increaseFetchCount (executionId , curLevel );
89- stack .setStatus (executionId , dispatchIfNeeded (stack , executionId , curLevel , selectionSet ));
87+ stack .setStatus (executionId , dispatchIfNeeded (stack , executionId , curLevel ));
9088 if (stack .allReady ()) {
9189 dispatchWithoutLocking ();
9290 }
@@ -98,7 +96,7 @@ public void onDeferredField(MergedField field) {
9896 //
9997 // thread safety : called with synchronised(stack)
10098 //
101- private boolean handleOnFieldValuesInfo (List <FieldValueInfo > fieldValueInfoList , RequestStack stack , ExecutionId executionId , int curLevel , List < Selection > selectionSet ) {
99+ private boolean handleOnFieldValuesInfo (List <FieldValueInfo > fieldValueInfoList , RequestStack stack , ExecutionId executionId , int curLevel ) {
102100 stack .increaseHappenedOnFieldValueCalls (executionId , curLevel );
103101 int expectedStrategyCalls = 0 ;
104102 for (FieldValueInfo fieldValueInfo : fieldValueInfoList ) {
@@ -109,7 +107,7 @@ private boolean handleOnFieldValuesInfo(List<FieldValueInfo> fieldValueInfoList,
109107 }
110108 }
111109 stack .increaseExpectedStrategyCalls (executionId , curLevel + 1 , expectedStrategyCalls );
112- return dispatchIfNeeded (stack , executionId , curLevel + 1 , selectionSet );
110+ return dispatchIfNeeded (stack , executionId , curLevel + 1 );
113111 }
114112
115113 private int getCountForList (FieldValueInfo fieldValueInfo ) {
@@ -128,8 +126,6 @@ private int getCountForList(FieldValueInfo fieldValueInfo) {
128126 public DeferredFieldInstrumentationContext beginDeferredField (InstrumentationDeferredFieldParameters parameters ) {
129127 ExecutionId executionId = parameters .getExecutionContext ().getExecutionId ();
130128 int level = parameters .getExecutionStrategyParameters ().getPath ().getLevel ();
131- List <Selection > selectionSet = Optional .ofNullable (parameters .getExecutionStrategyParameters ().getField ())
132- .map (MergedField ::getSingleField ).map (Field ::getSelectionSet ).map (SelectionSet ::getSelections ).orElse (Collections .emptyList ());
133129 synchronized (stack ) {
134130 stack .clearAndMarkCurrentLevelAsReady (executionId , level );
135131 }
@@ -147,7 +143,7 @@ public void onCompleted(ExecutionResult result, Throwable t) {
147143 @ Override
148144 public void onFieldValueInfo (FieldValueInfo fieldValueInfo ) {
149145 synchronized (stack ) {
150- stack .setStatus (executionId , handleOnFieldValuesInfo (Collections .singletonList (fieldValueInfo ), stack , executionId , level , selectionSet ));
146+ stack .setStatus (executionId , handleOnFieldValuesInfo (Collections .singletonList (fieldValueInfo ), stack , executionId , level ));
151147 if (stack .allReady ()) {
152148 dispatchWithoutLocking ();
153149 }
@@ -160,16 +156,14 @@ public void onFieldValueInfo(FieldValueInfo fieldValueInfo) {
160156 public InstrumentationContext <Object > beginFieldFetch (InstrumentationFieldFetchParameters parameters ) {
161157 ExecutionId executionId = parameters .getExecutionContext ().getExecutionId ();
162158 ExecutionPath path = parameters .getEnvironment ().getExecutionStepInfo ().getPath ();
163- List <Selection > selectionSet = Optional .ofNullable (parameters .getEnvironment ().getField ())
164- .map (Field ::getSelectionSet ).map (SelectionSet ::getSelections ).orElse (Collections .emptyList ());
165159 int level = path .getLevel ();
166160 return new InstrumentationContext <Object >() {
167161
168162 @ Override
169163 public void onDispatched (CompletableFuture result ) {
170164 synchronized (stack ) {
171165 stack .increaseFetchCount (executionId , level );
172- stack .setStatus (executionId , dispatchIfNeeded (stack , executionId , level , selectionSet ));
166+ stack .setStatus (executionId , dispatchIfNeeded (stack , executionId , level ));
173167
174168 if (stack .allReady ()) {
175169 dispatchWithoutLocking ();
@@ -197,9 +191,9 @@ public void removeTracking(ExecutionId executionId) {
197191 //
198192 // thread safety : called with synchronised(stack)
199193 //
200- private boolean dispatchIfNeeded (RequestStack stack , ExecutionId executionId , int level , List < Selection > selectionSet ) {
194+ private boolean dispatchIfNeeded (RequestStack stack , ExecutionId executionId , int level ) {
201195 if (levelReady (stack , executionId , level )) {
202- return stack .dispatchIfNotDispatchedBefore (executionId , level , selectionSet );
196+ return stack .dispatchIfNotDispatchedBefore (executionId , level );
203197 }
204198 return false ;
205199 }
0 commit comments