@@ -195,7 +195,7 @@ function executeImpl(
195
195
196
196
// If a valid context cannot be created due to incorrect arguments,
197
197
// a "Response" with only errors is returned.
198
- const context = buildExecutionContext (
198
+ const exeContext = buildExecutionContext (
199
199
schema ,
200
200
document ,
201
201
rootValue ,
@@ -206,8 +206,8 @@ function executeImpl(
206
206
) ;
207
207
208
208
// Return early errors if execution context failed.
209
- if ( Array . isArray ( context ) ) {
210
- return { errors : context } ;
209
+ if ( Array . isArray ( exeContext ) ) {
210
+ return { errors : exeContext } ;
211
211
}
212
212
213
213
// Return a Promise that will eventually resolve to the data described by
@@ -217,24 +217,24 @@ function executeImpl(
217
217
// field and its descendants will be omitted, and sibling fields will still
218
218
// be executed. An execution which encounters errors will still result in a
219
219
// resolved Promise.
220
- const data = executeOperation(context, context.operation , rootValue);
221
- return buildResponse(context , data);
220
+ const data = executeOperation(exeContext , rootValue);
221
+ return buildResponse(exeContext , data);
222
222
}
223
223
224
224
/**
225
225
* Given a completed execution context and data, build the { errors, data }
226
226
* response defined by the "Response" section of the GraphQL specification.
227
227
*/
228
228
function buildResponse (
229
- context : ExecutionContext ,
229
+ exeContext : ExecutionContext ,
230
230
data : MaybePromise < ObjMap < mixed > | null> ,
231
231
) {
232
232
if ( isPromise ( data ) ) {
233
- return data . then ( resolved => buildResponse ( context , resolved ) ) ;
233
+ return data . then ( resolved => buildResponse ( exeContext , resolved ) ) ;
234
234
}
235
- return context .errors.length === 0
235
+ return exeContext .errors.length === 0
236
236
? { data }
237
- : { errors : context . errors , data } ;
237
+ : { errors : exeContext . errors , data } ;
238
238
}
239
239
240
240
/**
@@ -378,9 +378,9 @@ export function buildExecutionContext(
378
378
*/
379
379
function executeOperation (
380
380
exeContext : ExecutionContext ,
381
- operation : OperationDefinitionNode ,
382
381
rootValue : mixed ,
383
382
) : MaybePromise < ObjMap < mixed > | null> {
383
+ const operation = exeContext . operation ;
384
384
const type = getOperationRootType ( exeContext . schema , operation ) ;
385
385
const fields = collectFields (
386
386
exeContext ,
0 commit comments