Skip to content

Commit bb183b6

Browse files
feat: avoid calling the DFE supplier in batching instrumentations (#1797)
let the user decide if they want to call the supplier, and avoid having the library to make that choice
1 parent 0a69755 commit bb183b6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

executions/graphql-kotlin-dataloader-instrumentation/src/main/kotlin/com/expediagroup/graphql/dataloader/instrumentation/level/state/ExecutionLevelDispatchedState.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class ExecutionLevelDispatchedState(
124124
onLevelDispatched: OnLevelDispatchedCallback
125125
): InstrumentationContext<Any> {
126126
val executionInput = parameters.executionContext.executionInput
127-
val path = parameters.environment.executionStepInfo.path
127+
val path = parameters.executionStepInfo.path
128128
val level = Level(path.level)
129129

130130
return object : InstrumentationContext<Any> {

executions/graphql-kotlin-dataloader-instrumentation/src/main/kotlin/com/expediagroup/graphql/dataloader/instrumentation/syncexhaustion/state/SyncExecutionExhaustedState.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class SyncExecutionExhaustedState(
8686
/**
8787
* This is called just before a field [DataFetcher] is invoked
8888
*
89-
* @param parameters contains information of which field will starting the fetching
89+
* @param parameters contains information of which field will start the fetching
9090
* @param onSyncExecutionExhausted invoke when the sync execution fo all operations is exhausted
9191
* @return a [InstrumentationContext] object that will be called back when the [DataFetcher]
9292
* dispatches and completes
@@ -96,10 +96,9 @@ class SyncExecutionExhaustedState(
9696
onSyncExecutionExhausted: OnSyncExecutionExhaustedCallback
9797
): InstrumentationContext<Any> {
9898
val executionInput = parameters.executionContext.executionInput
99-
val executionStepInfo = parameters.executionStepInfo
10099
val field = parameters.executionStepInfo.field.singleField
101-
val fieldExecutionStrategyPath = parameters.environment.executionStepInfo.path.parent
102-
val fieldGraphQLType = executionStepInfo.unwrappedNonNullType
100+
val fieldExecutionStrategyPath = parameters.executionStepInfo.path.parent
101+
val fieldGraphQLType = parameters.executionStepInfo.unwrappedNonNullType
103102

104103
return object : InstrumentationContext<Any> {
105104
override fun onDispatched(result: CompletableFuture<Any?>) {

0 commit comments

Comments
 (0)