public function getInstanceAndValidate(string $argType, $data, ResolveInfo $info, string $argName)
    {
        $isRequired = '!' === $argType[\strlen($argType) - 1];
        $isMultiple = '[' === $argType[0];
        $endIndex = ($isRequired ? 1 : 0) + ($isMultiple ? 1 : 0);
        $type = \substr($argType, $isMultiple ? 1 : 0, $endIndex > 0 ? -$endIndex : \strlen($argType));

        $result = $this->populateObject($this->getType($type, $info), $data, $isMultiple, $info);
        $errors = [];
        if (\is_object($result) && $this->validator) {
            $errors = $this->validator->validate($result);
        }

        if (\count($errors) > 0) {
            throw new InvalidArgumentError($argName, $errors);
        } else {
            return $result;
        }
    }
public function getInstanceAndValidate(string $argType, $data, ResolveInfo $info, string $argName)
    {
        $isRequired = '!' === $argType[\strlen($argType) - 1];
        $isMultiple = '[' === $argType[0];
        $endIndex = ($isRequired ? 1 : 0) + ($isMultiple ? 1 : 0);
        $type = \substr($argType, $isMultiple ? 1 : 0, $endIndex > 0 ? -$endIndex : \strlen($argType));

        $result = $this->populateObject($this->getType($type, $info), $data, $isMultiple, $info);
        $errors = [];
        if (\is_object($result) && $this->validator) {
            $errors = $this->validator->validate($result);
        }

        if (\count($errors) > 0) {
            throw new InvalidArgumentError($argName, $errors);
        } else {
            return $result;
        }
    }
public function getInstanceAndValidate ( string $ argType , $ data , ResolveInfo $ info , string $ argName ) { $ isRequired = '!' === $ argType [ \ strlen ( $ argType ) - 1 ] ; $ isMultiple = '[' === $ argType [ 0 ] ; $ endIndex = ( $ isRequired ? 1 : 0 ) + ( $ isMultiple ? 1 : 0 ) ; $ type = \ substr ( $ argType , $ isMultiple ? 1 : 0 , $ endIndex > 0 ? - $ endIndex : \ strlen ( $ argType ) ) ; $ result = $ this -> populateObject ( $ this -> getType ( $ type , $ info ) , $ data , $ isMultiple , $ info ) ; $ errors = [ ] ; if ( \ is_object ( $ result ) && $ this -> validator ) { $ errors = $ this -> validator -> validate ( $ result ) ; } if ( \ count ( $ errors ) > 0 ) { throw new InvalidArgumentError ( $ argName , $ errors ) ; } else { return $ result ; } }
Given a GraphQL type and an array of data, populate corresponding object recursively
using annoted classes.

@param string      $argType
@param mixed       $data
@param ResolveInfo $info

@return mixed
Given a GraphQL type and an array of data populate corresponding object recursively using annoted classes .