@@ -117,7 +117,7 @@ export function delegateRequest({
117117 targetFieldName = fieldName ;
118118 }
119119
120- const { targetSchema, targetRootValue, subschemaConfig, endpoint , allTransforms } = collectTargetParameters (
120+ const { targetSchema, targetRootValue, subschemaConfig, allTransforms } = collectTargetParameters (
121121 subschemaOrSubschemaConfig ,
122122 rootValue ,
123123 info ,
@@ -149,14 +149,15 @@ export function delegateRequest({
149149
150150 if ( targetOperation === 'query' || targetOperation === 'mutation' ) {
151151 let executor : Executor =
152- endpoint ?. executor || createDefaultExecutor ( targetSchema , subschemaConfig ?. rootValue || targetRootValue ) ;
152+ subschemaConfig ?. executor || createDefaultExecutor ( targetSchema , subschemaConfig ?. rootValue || targetRootValue ) ;
153153
154- if ( endpoint ?. batch ) {
154+ if ( subschemaConfig ?. batch ) {
155+ const batchingOptions = subschemaConfig ?. batchingOptions ;
155156 executor = getBatchingExecutor (
156157 context ,
157158 executor ,
158- endpoint ?. batchingOptions ?. dataLoaderOptions ,
159- endpoint ?. batchingOptions ?. extensionsReducer
159+ batchingOptions ?. dataLoaderOptions ,
160+ batchingOptions ?. extensionsReducer
160161 ) ;
161162 }
162163
@@ -175,7 +176,7 @@ export function delegateRequest({
175176 }
176177
177178 const subscriber =
178- endpoint ?. subscriber || createDefaultSubscriber ( targetSchema , subschemaConfig ?. rootValue || targetRootValue ) ;
179+ subschemaConfig ?. subscriber || createDefaultSubscriber ( targetSchema , subschemaConfig ?. rootValue || targetRootValue ) ;
179180
180181 return subscriber ( {
181182 ...processedRequest ,
@@ -218,7 +219,6 @@ function collectTargetParameters(
218219 targetSchema : subschemaOrSubschemaConfig . schema ,
219220 targetRootValue : rootValue ?? subschemaOrSubschemaConfig ?. rootValue ?? info ?. rootValue ?? emptyObject ,
220221 subschemaConfig : subschemaOrSubschemaConfig ,
221- endpoint : subschemaOrSubschemaConfig . endpoint ?? subschemaOrSubschemaConfig ,
222222 allTransforms :
223223 subschemaOrSubschemaConfig . transforms != null
224224 ? subschemaOrSubschemaConfig . transforms . concat ( transforms )
0 commit comments