Skip to content

Commit dc2a3eb

Browse files
authored
execute: Rename resolveField function and update comments (#3159)
1 parent 6d71a1b commit dc2a3eb

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/execution/execute.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export interface ExecutionArgs {
142142
}
143143

144144
/**
145-
* Implements the "Evaluating requests" section of the GraphQL specification.
145+
* Implements the "Executing requests" section of the GraphQL specification.
146146
*
147147
* Returns either a synchronous ExecutionResult (if all encountered resolvers
148148
* are synchronous), or a Promise of an ExecutionResult that will eventually be
@@ -196,7 +196,7 @@ export function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult> {
196196
}
197197

198198
/**
199-
* Also implements the "Evaluating requests" section of the GraphQL specification.
199+
* Also implements the "Executing requests" section of the GraphQL specification.
200200
* However, it guarantees to complete synchronously (or throw an error) assuming
201201
* that all field resolvers are also synchronous.
202202
*/
@@ -327,7 +327,7 @@ export function buildExecutionContext(
327327
}
328328

329329
/**
330-
* Implements the "Evaluating operations" section of the spec.
330+
* Implements the "Executing operations" section of the spec.
331331
*/
332332
function executeOperation(
333333
exeContext: ExecutionContext,
@@ -367,8 +367,8 @@ function executeOperation(
367367
}
368368

369369
/**
370-
* Implements the "Evaluating selection sets" section of the spec
371-
* for "write" mode.
370+
* Implements the "Executing selection sets" section of the spec
371+
* for fields that must be executed serially.
372372
*/
373373
function executeFieldsSerially(
374374
exeContext: ExecutionContext,
@@ -381,7 +381,7 @@ function executeFieldsSerially(
381381
fields.entries(),
382382
(results, [responseName, fieldNodes]) => {
383383
const fieldPath = addPath(path, responseName, parentType.name);
384-
const result = resolveField(
384+
const result = executeField(
385385
exeContext,
386386
parentType,
387387
sourceValue,
@@ -405,8 +405,8 @@ function executeFieldsSerially(
405405
}
406406

407407
/**
408-
* Implements the "Evaluating selection sets" section of the spec
409-
* for "read" mode.
408+
* Implements the "Executing selection sets" section of the spec
409+
* for fields that may be executed in parallel.
410410
*/
411411
function executeFields(
412412
exeContext: ExecutionContext,
@@ -420,7 +420,7 @@ function executeFields(
420420

421421
for (const [responseName, fieldNodes] of fields.entries()) {
422422
const fieldPath = addPath(path, responseName, parentType.name);
423-
const result = resolveField(
423+
const result = executeField(
424424
exeContext,
425425
parentType,
426426
sourceValue,
@@ -583,12 +583,12 @@ function getFieldEntryKey(node: FieldNode): string {
583583
}
584584

585585
/**
586-
* Resolves the field on the given source object. In particular, this
587-
* figures out the value that the field returns by calling its resolve function,
588-
* then calls completeValue to complete promises, serialize scalars, or execute
589-
* the sub-selection-set for objects.
586+
* Implements the "Executing field" section of the spec
587+
* In particular, this function figures out the value that the field returns by
588+
* calling its resolve function, then calls completeValue to complete promises,
589+
* serialize scalars, or execute the sub-selection-set for objects.
590590
*/
591-
function resolveField(
591+
function executeField(
592592
exeContext: ExecutionContext,
593593
parentType: GraphQLObjectType,
594594
source: unknown,
@@ -722,7 +722,7 @@ function handleFieldError(
722722
* and then complete based on that type
723723
*
724724
* Otherwise, the field type expects a sub-selection set, and will complete the
725-
* value by evaluating all sub-selections.
725+
* value by executing all sub-selections.
726726
*/
727727
function completeValue(
728728
exeContext: ExecutionContext,

0 commit comments

Comments
 (0)