From dc2a3eb4e7ee81b85dd14d2910f355a8b7844c5f Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Tue, 8 Jun 2021 12:29:08 +0300 Subject: [PATCH] execute: Rename resolveField function and update comments (#3159) --- src/execution/execute.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/execution/execute.ts b/src/execution/execute.ts index 5d7f25e722..4b30409f98 100644 --- a/src/execution/execute.ts +++ b/src/execution/execute.ts @@ -142,7 +142,7 @@ export interface ExecutionArgs { } /** - * Implements the "Evaluating requests" section of the GraphQL specification. + * Implements the "Executing requests" section of the GraphQL specification. * * Returns either a synchronous ExecutionResult (if all encountered resolvers * are synchronous), or a Promise of an ExecutionResult that will eventually be @@ -196,7 +196,7 @@ export function execute(args: ExecutionArgs): PromiseOrValue { } /** - * Also implements the "Evaluating requests" section of the GraphQL specification. + * Also implements the "Executing requests" section of the GraphQL specification. * However, it guarantees to complete synchronously (or throw an error) assuming * that all field resolvers are also synchronous. */ @@ -327,7 +327,7 @@ export function buildExecutionContext( } /** - * Implements the "Evaluating operations" section of the spec. + * Implements the "Executing operations" section of the spec. */ function executeOperation( exeContext: ExecutionContext, @@ -367,8 +367,8 @@ function executeOperation( } /** - * Implements the "Evaluating selection sets" section of the spec - * for "write" mode. + * Implements the "Executing selection sets" section of the spec + * for fields that must be executed serially. */ function executeFieldsSerially( exeContext: ExecutionContext, @@ -381,7 +381,7 @@ function executeFieldsSerially( fields.entries(), (results, [responseName, fieldNodes]) => { const fieldPath = addPath(path, responseName, parentType.name); - const result = resolveField( + const result = executeField( exeContext, parentType, sourceValue, @@ -405,8 +405,8 @@ function executeFieldsSerially( } /** - * Implements the "Evaluating selection sets" section of the spec - * for "read" mode. + * Implements the "Executing selection sets" section of the spec + * for fields that may be executed in parallel. */ function executeFields( exeContext: ExecutionContext, @@ -420,7 +420,7 @@ function executeFields( for (const [responseName, fieldNodes] of fields.entries()) { const fieldPath = addPath(path, responseName, parentType.name); - const result = resolveField( + const result = executeField( exeContext, parentType, sourceValue, @@ -583,12 +583,12 @@ function getFieldEntryKey(node: FieldNode): string { } /** - * Resolves the field on the given source object. In particular, this - * figures out the value that the field returns by calling its resolve function, - * then calls completeValue to complete promises, serialize scalars, or execute - * the sub-selection-set for objects. + * Implements the "Executing field" section of the spec + * In particular, this function figures out the value that the field returns by + * calling its resolve function, then calls completeValue to complete promises, + * serialize scalars, or execute the sub-selection-set for objects. */ -function resolveField( +function executeField( exeContext: ExecutionContext, parentType: GraphQLObjectType, source: unknown, @@ -722,7 +722,7 @@ function handleFieldError( * and then complete based on that type * * Otherwise, the field type expects a sub-selection set, and will complete the - * value by evaluating all sub-selections. + * value by executing all sub-selections. */ function completeValue( exeContext: ExecutionContext,