public function queryAndReturnResult($query, $params = [])
    {
        $schema = $this->schema();
        $context = $this->getContext();

        $last = function ($schema, $query, $context, $params) {
            return GraphQL::executeQuery($schema, $query, null, $context, $params);
        };

        return $this->callMiddleware($schema, $query, $context, $params, $last);
    }
public function queryAndReturnResult($query, $params = [])
    {
        $schema = $this->schema();
        $context = $this->getContext();

        $last = function ($schema, $query, $context, $params) {
            return GraphQL::executeQuery($schema, $query, null, $context, $params);
        };

        return $this->callMiddleware($schema, $query, $context, $params, $last);
    }
public function queryAndReturnResult ( $ query , $ params = [ ] ) { $ schema = $ this -> schema ( ) ; $ context = $ this -> getContext ( ) ; $ last = function ( $ schema , $ query , $ context , $ params ) { return GraphQL :: executeQuery ( $ schema , $ query , null , $ context , $ params ) ; } ; return $ this -> callMiddleware ( $ schema , $ query , $ context , $ params , $ last ) ; }
Evaluate query via middleware

@param string $query
@param array $params
@return ExecutionResult|array Result as either source object result, or serialised as array.
Evaluate query via middleware