src/Executor/ReferenceExecutor.php
private function executeOperation(OperationDefinitionNode $operation, $rootValue)
    {
        $type   = $this->getOperationRootType($this->exeContext->schema, $operation);
        $fields = $this->collectFields($type, $operation->selectionSet, new ArrayObject(), new ArrayObject());
        $path   = [];
        // Errors from sub-fields of a NonNull type may propagate to the top level,
        // at which point we still log the error and null the parent field, which
        // in this case is the entire response.
        //
        // Similar to completeValueCatchingError.
        try {
            $result = $operation->operation === 'mutation' ?
                $this->executeFieldsSerially($type, $rootValue, $path, $fields) :
                $this->executeFields($type, $rootValue, $path, $fields);
            if ($this->isPromise($result)) {
                return $result->then(
                    null,
                    function ($error) {
                        $this->exeContext->addError($error);

                        return $this->exeContext->promises->createFulfilled(null);
                    }
                );
            }

            return $result;
        } catch (Error $error) {
            $this->exeContext->addError($error);

            return null;
        }
    }
private function executeOperation(OperationDefinitionNode $operation, $rootValue)
    {
        $type   = $this->getOperationRootType($this->exeContext->schema, $operation);
        $fields = $this->collectFields($type, $operation->selectionSet, new ArrayObject(), new ArrayObject());
        $path   = [];
        // Errors from sub-fields of a NonNull type may propagate to the top level,
        // at which point we still log the error and null the parent field, which
        // in this case is the entire response.
        //
        // Similar to completeValueCatchingError.
        try {
            $result = $operation->operation === 'mutation' ?
                $this->executeFieldsSerially($type, $rootValue, $path, $fields) :
                $this->executeFields($type, $rootValue, $path, $fields);
            if ($this->isPromise($result)) {
                return $result->then(
                    null,
                    function ($error) {
                        $this->exeContext->addError($error);

                        return $this->exeContext->promises->createFulfilled(null);
                    }
                );
            }

            return $result;
        } catch (Error $error) {
            $this->exeContext->addError($error);

            return null;
        }
    }
private function executeOperation ( OperationDefinitionNode $ operation , $ rootValue ) { $ type = $ this -> getOperationRootType ( $ this -> exeContext -> schema , $ operation ) ; $ fields = $ this -> collectFields ( $ type , $ operation -> selectionSet , new ArrayObject ( ) , new ArrayObject ( ) ) ; $ path = [ ] ; // Errors from sub-fields of a NonNull type may propagate to the top level, // at which point we still log the error and null the parent field, which // in this case is the entire response. // // Similar to completeValueCatchingError. try { $ result = $ operation -> operation === 'mutation' ? $ this -> executeFieldsSerially ( $ type , $ rootValue , $ path , $ fields ) : $ this -> executeFields ( $ type , $ rootValue , $ path , $ fields ) ; if ( $ this -> isPromise ( $ result ) ) { return $ result -> then ( null , function ( $ error ) { $ this -> exeContext -> addError ( $ error ) ; return $ this -> exeContext -> promises -> createFulfilled ( null ) ; } ) ; } return $ result ; } catch ( Error $ error ) { $ this -> exeContext -> addError ( $ error ) ; return null ; } }
Implements the "Evaluating operations" section of the spec.

@param  mixed[] $rootValue

@return Promise|stdClass|mixed[]
Implements the Evaluating operations section of the spec .