|
2 | 2 |
|
3 | 3 | import graphql.ExecutionResult; |
4 | 4 | import graphql.execution.ExecutionId; |
5 | | -import graphql.execution.ExecutionPath; |
6 | 5 | import graphql.execution.FieldValueInfo; |
7 | 6 | import graphql.execution.MergedField; |
8 | | -import graphql.execution.instrumentation.DeferredFieldInstrumentationContext; |
| 7 | +import graphql.execution.ResultPath; |
9 | 8 | import graphql.execution.instrumentation.ExecutionStrategyInstrumentationContext; |
10 | 9 | import graphql.execution.instrumentation.InstrumentationContext; |
11 | | -import graphql.execution.instrumentation.parameters.InstrumentationDeferredFieldParameters; |
12 | 10 | import graphql.execution.instrumentation.parameters.InstrumentationExecutionStrategyParameters; |
13 | 11 | import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters; |
14 | 12 | import java.util.Collections; |
@@ -42,7 +40,7 @@ protected RequestStack getStack() { |
42 | 40 | public ExecutionStrategyInstrumentationContext beginExecutionStrategy( |
43 | 41 | InstrumentationExecutionStrategyParameters parameters) { |
44 | 42 | ExecutionId executionId = parameters.getExecutionContext().getExecutionId(); |
45 | | - ExecutionPath path = parameters.getExecutionStrategyParameters().getPath(); |
| 43 | + ResultPath path = parameters.getExecutionStrategyParameters().getPath(); |
46 | 44 | int parentLevel = path.getLevel(); |
47 | 45 | int curLevel = parentLevel + 1; |
48 | 46 | int fieldCount = parameters.getExecutionStrategyParameters().getFields().size(); |
@@ -72,18 +70,6 @@ public void onFieldValuesInfo(List<FieldValueInfo> fieldValueInfoList) { |
72 | 70 | } |
73 | 71 | } |
74 | 72 | } |
75 | | - |
76 | | - @Override |
77 | | - public void onDeferredField(MergedField field) { |
78 | | - // fake fetch count for this field |
79 | | - synchronized (stack) { |
80 | | - stack.increaseFetchCount(executionId, curLevel); |
81 | | - stack.setStatus(executionId, dispatchIfNeeded(stack, executionId, curLevel)); |
82 | | - if (stack.allReady()) { |
83 | | - dispatchWithoutLocking(); |
84 | | - } |
85 | | - } |
86 | | - } |
87 | 73 | }; |
88 | 74 | } |
89 | 75 |
|
@@ -118,45 +104,11 @@ private int getCountForList(FieldValueInfo fieldValueInfo) { |
118 | 104 | return result; |
119 | 105 | } |
120 | 106 |
|
121 | | - @Override |
122 | | - public DeferredFieldInstrumentationContext beginDeferredField( |
123 | | - InstrumentationDeferredFieldParameters parameters) { |
124 | | - ExecutionId executionId = parameters.getExecutionContext().getExecutionId(); |
125 | | - int level = parameters.getExecutionStrategyParameters().getPath().getLevel(); |
126 | | - synchronized (stack) { |
127 | | - stack.clearAndMarkCurrentLevelAsReady(executionId, level); |
128 | | - } |
129 | | - |
130 | | - return new DeferredFieldInstrumentationContext() { |
131 | | - @Override |
132 | | - public void onDispatched(CompletableFuture<ExecutionResult> result) { |
133 | | - // default empty implementation |
134 | | - } |
135 | | - |
136 | | - @Override |
137 | | - public void onCompleted(ExecutionResult result, Throwable t) { |
138 | | - // default empty implementation |
139 | | - } |
140 | | - |
141 | | - @Override |
142 | | - public void onFieldValueInfo(FieldValueInfo fieldValueInfo) { |
143 | | - synchronized (stack) { |
144 | | - stack.setStatus(executionId, |
145 | | - handleOnFieldValuesInfo(Collections.singletonList(fieldValueInfo), stack, executionId, |
146 | | - level)); |
147 | | - if (stack.allReady()) { |
148 | | - dispatchWithoutLocking(); |
149 | | - } |
150 | | - } |
151 | | - } |
152 | | - }; |
153 | | - } |
154 | | - |
155 | 107 | @Override |
156 | 108 | public InstrumentationContext<Object> beginFieldFetch( |
157 | 109 | InstrumentationFieldFetchParameters parameters) { |
158 | 110 | ExecutionId executionId = parameters.getExecutionContext().getExecutionId(); |
159 | | - ExecutionPath path = parameters.getEnvironment().getExecutionStepInfo().getPath(); |
| 111 | + ResultPath path = parameters.getEnvironment().getExecutionStepInfo().getPath(); |
160 | 112 | int level = path.getLevel(); |
161 | 113 | return new InstrumentationContext<Object>() { |
162 | 114 |
|
|
0 commit comments