Skip to content

Commit 9cb1c71

Browse files
committed
Merge remote-tracking branch 'origin/master' into cancel-support-attempt-2
# Conflicts: # src/test/groovy/graphql/execution/SubscriptionExecutionStrategyTest.groovy
2 parents 869ee3c + f8171cf commit 9cb1c71

25 files changed

+9221
-135
lines changed

performance-results/2025-06-05T08:39:29Z-fa22b821dd44aa991c3746f36b49661aa97db913-jdk17.json

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

performance-results/2025-06-05T08:40:24Z-fa22b821dd44aa991c3746f36b49661aa97db913-jdk17.json

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

performance-results/2025-06-05T10:10:46Z-9c358d367dc60598589a88ac1e6ef3b1260f16b8-jdk17.json

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

performance-results/2025-06-06T01:04:20Z-b96a9ea7c55ef11c8aa72b3f71f2348f3f234d9d-jdk17.json

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

performance-results/2025-06-06T04:49:08Z-52eefcdcd13f09c48da85fa4590755e4cba6a5cc-jdk17.json

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

performance-results/2025-06-08T03:25:28Z-8950aa312751869089a0302484955777babbf1a3-jdk17.json

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

performance-results/2025-06-12T04:49:15Z-4dc7965b406a690fedb0abde79f925db1c7a9249-jdk17.json

Lines changed: 1279 additions & 0 deletions
Large diffs are not rendered by default.

src/main/java/graphql/execution/DataLoaderDispatchStrategy.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package graphql.execution;
22

33
import graphql.Internal;
4+
import graphql.execution.incremental.AlternativeCallContext;
45
import graphql.schema.DataFetcher;
56
import graphql.schema.DataFetchingEnvironment;
67

@@ -59,4 +60,8 @@ default void fieldFetched(ExecutionContext executionContext,
5960
default DataFetcher<?> modifyDataFetcher(DataFetcher<?> dataFetcher) {
6061
return dataFetcher;
6162
}
63+
64+
default void newSubscriptionExecution(FieldValueInfo fieldValueInfo, AlternativeCallContext alternativeCallContext) {
65+
66+
}
6267
}

src/main/java/graphql/execution/Execution.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import graphql.execution.instrumentation.Instrumentation;
1515
import graphql.execution.instrumentation.InstrumentationContext;
1616
import graphql.execution.instrumentation.InstrumentationState;
17-
import graphql.execution.instrumentation.dataloader.FallbackDataLoaderDispatchStrategy;
1817
import graphql.execution.instrumentation.dataloader.PerLevelDataLoaderDispatchStrategy;
1918
import graphql.execution.instrumentation.parameters.InstrumentationExecuteOperationParameters;
2019
import graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters;
@@ -261,11 +260,7 @@ private DataLoaderDispatchStrategy createDataLoaderDispatchStrategy(ExecutionCon
261260
if (executionContext.getDataLoaderRegistry() == EMPTY_DATALOADER_REGISTRY || doNotAutomaticallyDispatchDataLoader) {
262261
return DataLoaderDispatchStrategy.NO_OP;
263262
}
264-
if (!executionContext.isSubscriptionOperation()) {
265-
return new PerLevelDataLoaderDispatchStrategy(executionContext);
266-
} else {
267-
return new FallbackDataLoaderDispatchStrategy(executionContext);
268-
}
263+
return new PerLevelDataLoaderDispatchStrategy(executionContext);
269264
}
270265

271266

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import graphql.Internal;
44
import graphql.PublicApi;
5-
import graphql.execution.incremental.DeferredCallContext;
5+
import graphql.execution.incremental.AlternativeCallContext;
66
import org.jspecify.annotations.Nullable;
77

88
import java.util.function.Consumer;
@@ -22,7 +22,7 @@ public class ExecutionStrategyParameters {
2222
private final ResultPath path;
2323
private final MergedField currentField;
2424
private final ExecutionStrategyParameters parent;
25-
private final DeferredCallContext deferredCallContext;
25+
private final AlternativeCallContext alternativeCallContext;
2626

2727
private ExecutionStrategyParameters(ExecutionStepInfo executionStepInfo,
2828
Object source,
@@ -32,7 +32,7 @@ private ExecutionStrategyParameters(ExecutionStepInfo executionStepInfo,
3232
ResultPath path,
3333
MergedField currentField,
3434
ExecutionStrategyParameters parent,
35-
DeferredCallContext deferredCallContext) {
35+
AlternativeCallContext alternativeCallContext) {
3636

3737
this.executionStepInfo = assertNotNull(executionStepInfo, () -> "executionStepInfo is null");
3838
this.localContext = localContext;
@@ -42,7 +42,7 @@ private ExecutionStrategyParameters(ExecutionStepInfo executionStepInfo,
4242
this.path = path;
4343
this.currentField = currentField;
4444
this.parent = parent;
45-
this.deferredCallContext = deferredCallContext;
45+
this.alternativeCallContext = alternativeCallContext;
4646
}
4747

4848
public ExecutionStepInfo getExecutionStepInfo() {
@@ -95,8 +95,8 @@ public ExecutionStrategyParameters getParent() {
9595
*/
9696
@Nullable
9797
@Internal
98-
public DeferredCallContext getDeferredCallContext() {
99-
return deferredCallContext;
98+
public AlternativeCallContext getDeferredCallContext() {
99+
return alternativeCallContext;
100100
}
101101

102102
/**
@@ -105,7 +105,7 @@ public DeferredCallContext getDeferredCallContext() {
105105
* @return true if we're in the scope of a deferred call
106106
*/
107107
public boolean isInDeferredContext() {
108-
return deferredCallContext != null;
108+
return alternativeCallContext != null;
109109
}
110110

111111
/**
@@ -128,7 +128,7 @@ ExecutionStrategyParameters transform(MergedField currentField,
128128
path,
129129
currentField,
130130
parent,
131-
deferredCallContext);
131+
alternativeCallContext);
132132
}
133133

134134
@Internal
@@ -143,7 +143,7 @@ ExecutionStrategyParameters transform(ExecutionStepInfo executionStepInfo,
143143
path,
144144
currentField,
145145
parent,
146-
deferredCallContext);
146+
alternativeCallContext);
147147
}
148148

149149
@Internal
@@ -159,7 +159,7 @@ ExecutionStrategyParameters transform(ExecutionStepInfo executionStepInfo,
159159
path,
160160
currentField,
161161
parent,
162-
deferredCallContext);
162+
alternativeCallContext);
163163
}
164164

165165
@Internal
@@ -174,7 +174,7 @@ ExecutionStrategyParameters transform(ExecutionStepInfo executionStepInfo,
174174
path,
175175
currentField,
176176
parent,
177-
deferredCallContext);
177+
alternativeCallContext);
178178
}
179179

180180
@Internal
@@ -189,7 +189,7 @@ ExecutionStrategyParameters transform(MergedField currentField,
189189
path,
190190
currentField,
191191
parent,
192-
deferredCallContext);
192+
alternativeCallContext);
193193
}
194194

195195
public ExecutionStrategyParameters transform(Consumer<Builder> builderConsumer) {
@@ -221,7 +221,7 @@ public static class Builder {
221221
ResultPath path = ResultPath.rootPath();
222222
MergedField currentField;
223223
ExecutionStrategyParameters parent;
224-
DeferredCallContext deferredCallContext;
224+
AlternativeCallContext alternativeCallContext;
225225

226226
/**
227227
* @see ExecutionStrategyParameters#newParameters()
@@ -239,7 +239,7 @@ private Builder(ExecutionStrategyParameters oldParameters) {
239239
this.fields = oldParameters.fields;
240240
this.nonNullableFieldValidator = oldParameters.nonNullableFieldValidator;
241241
this.currentField = oldParameters.currentField;
242-
this.deferredCallContext = oldParameters.deferredCallContext;
242+
this.alternativeCallContext = oldParameters.alternativeCallContext;
243243
this.path = oldParameters.path;
244244
this.parent = oldParameters.parent;
245245
}
@@ -289,13 +289,13 @@ public Builder parent(ExecutionStrategyParameters parent) {
289289
return this;
290290
}
291291

292-
public Builder deferredCallContext(DeferredCallContext deferredCallContext) {
293-
this.deferredCallContext = deferredCallContext;
292+
public Builder deferredCallContext(AlternativeCallContext alternativeCallContext) {
293+
this.alternativeCallContext = alternativeCallContext;
294294
return this;
295295
}
296296

297297
public ExecutionStrategyParameters build() {
298-
return new ExecutionStrategyParameters(executionStepInfo, source, localContext, fields, nonNullableFieldValidator, path, currentField, parent, deferredCallContext);
298+
return new ExecutionStrategyParameters(executionStepInfo, source, localContext, fields, nonNullableFieldValidator, path, currentField, parent, alternativeCallContext);
299299
}
300300
}
301301
}

0 commit comments

Comments
 (0)