GraphQL\Executor\Executor::resolveOrError PHP Метод

resolveOrError() приватный статический Метод

Isolates the "ReturnOrAbrupt" behavior to not de-opt the resolveField function. Returns the result of resolveFn or the abrupt-return Error object.
private static resolveOrError ( ExecutionContext $exeContext, FieldDefinition $fieldDef, FieldNode $fieldNode, callable $resolveFn, mixed $source, mixed $context, ResolveInfo $info ) : Exception | mixed
$exeContext ExecutionContext
$fieldDef GraphQL\Type\Definition\FieldDefinition
$fieldNode GraphQL\Language\AST\FieldNode
$resolveFn callable
$source mixed
$context mixed
$info GraphQL\Type\Definition\ResolveInfo
Результат Exception | mixed
    private static function resolveOrError($exeContext, $fieldDef, $fieldNode, $resolveFn, $source, $context, $info)
    {
        try {
            // Build hash of arguments from the field.arguments AST, using the
            // variables scope to fulfill any variable references.
            $args = Values::getArgumentValues($fieldDef, $fieldNode, $exeContext->variableValues);
            return call_user_func($resolveFn, $source, $args, $context, $info);
        } catch (\Exception $error) {
            return $error;
        }
    }