protected function resolveField(ObjectType $parentType, $rootValue, array $fieldNodes, array $path)
    {
        $fieldNode = $fieldNodes[0];

        $fieldName = $fieldNode->getNameValue();
        $field     = $this->getFieldDefinition($this->context->getSchema(), $parentType, $fieldName);

        if (null === $field) {
            throw new UndefinedFieldException($fieldName);
        }

        $info = $this->createResolveInfo($fieldNodes, $fieldNode, $field, $parentType, $path, $this->context);

        $resolveCallback = $this->determineResolveCallback($field, $parentType);

        $result = $this->resolveFieldValueOrError(
            $field,
            $fieldNode,
            $resolveCallback,
            $rootValue,
            $this->context,
            $info
        );

        $result = $this->completeValueCatchingError(
            $field->getType(),
            $fieldNodes,
            $info,
            $path,
            $result
        );

        return $result;
    }
protected function resolveField(ObjectType $parentType, $rootValue, array $fieldNodes, array $path)
    {
        $fieldNode = $fieldNodes[0];

        $fieldName = $fieldNode->getNameValue();
        $field     = $this->getFieldDefinition($this->context->getSchema(), $parentType, $fieldName);

        if (null === $field) {
            throw new UndefinedFieldException($fieldName);
        }

        $info = $this->createResolveInfo($fieldNodes, $fieldNode, $field, $parentType, $path, $this->context);

        $resolveCallback = $this->determineResolveCallback($field, $parentType);

        $result = $this->resolveFieldValueOrError(
            $field,
            $fieldNode,
            $resolveCallback,
            $rootValue,
            $this->context,
            $info
        );

        $result = $this->completeValueCatchingError(
            $field->getType(),
            $fieldNodes,
            $info,
            $path,
            $result
        );

        return $result;
    }
protected function resolveField ( ObjectType $ parentType , $ rootValue , array $ fieldNodes , array $ path ) { $ fieldNode = $ fieldNodes [ 0 ] ; $ fieldName = $ fieldNode -> getNameValue ( ) ; $ field = $ this -> getFieldDefinition ( $ this -> context -> getSchema ( ) , $ parentType , $ fieldName ) ; if ( null === $ field ) { throw new UndefinedFieldException ( $ fieldName ) ; } $ info = $ this -> createResolveInfo ( $ fieldNodes , $ fieldNode , $ field , $ parentType , $ path , $ this -> context ) ; $ resolveCallback = $ this -> determineResolveCallback ( $ field , $ parentType ) ; $ result = $ this -> resolveFieldValueOrError ( $ field , $ fieldNode , $ resolveCallback , $ rootValue , $ this -> context , $ info ) ; $ result = $ this -> completeValueCatchingError ( $ field -> getType ( ) , $ fieldNodes , $ info , $ path , $ result ) ; return $ result ; }
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.

@param ObjectType  $parentType
@param mixed       $rootValue
@param FieldNode[] $fieldNodes
@param string[]    $path

@return mixed
@throws \Throwable
@throws UndefinedFieldException
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 .