protected function callMiddleware(Schema $schema, $query, $context, $params, callable $last)
    {
        // Reverse middlewares
        $next = $last;
        // Filter out any middlewares that are set to `false`, e.g. via config
        $middlewares = array_reverse(array_filter($this->getMiddlewares()));
        /** @var QueryMiddleware $middleware */
        foreach ($middlewares as $middleware) {
            $next = function ($schema, $query, $context, $params) use ($middleware, $next) {
                return $middleware->process($schema, $query, $context, $params, $next);
            };
        }
        return $next($schema, $query, $context, $params);
    }
protected function callMiddleware(Schema $schema, $query, $context, $params, callable $last)
    {
        // Reverse middlewares
        $next = $last;
        // Filter out any middlewares that are set to `false`, e.g. via config
        $middlewares = array_reverse(array_filter($this->getMiddlewares()));
        /** @var QueryMiddleware $middleware */
        foreach ($middlewares as $middleware) {
            $next = function ($schema, $query, $context, $params) use ($middleware, $next) {
                return $middleware->process($schema, $query, $context, $params, $next);
            };
        }
        return $next($schema, $query, $context, $params);
    }
protected function callMiddleware ( Schema $ schema , $ query , $ context , $ params , callable $ last ) { // Reverse middlewares $ next = $ last ; // Filter out any middlewares that are set to `false`, e.g. via config $ middlewares = array_reverse ( array_filter ( $ this -> getMiddlewares ( ) ) ) ; /** @var QueryMiddleware $middleware */ foreach ( $ middlewares as $ middleware ) { $ next = function ( $ schema , $ query , $ context , $ params ) use ( $ middleware , $ next ) { return $ middleware -> process ( $ schema , $ query , $ context , $ params , $ next ) ; } ; } return $ next ( $ schema , $ query , $ context , $ params ) ; }
Call middleware to evaluate a graphql query

@param Schema $schema
@param string $query Query to invoke
@param array $context
@param array $params Variables passed to this query
@param callable $last The callback to call after all middlewares
@return ExecutionResult|array
Call middleware to evaluate a graphql query