Zend Expressive + graphql

How can I integrate Zend expressive with graphql, I’m using the basic example and it does not work.
what is wrong?

The url is localhost:7070/api/ping via GraphIQL Feen!

But it does not return anything

namespace App\Action;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface as ServerMiddlewareInterface;
use Zend\Diactoros\Response\JsonResponse;
use Psr\Http\Message\ServerRequestInterface;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;
use GraphQL\Schema;
use GraphQL\GraphQL;
class PingAction implements ServerMiddlewareInterface
    public function process(ServerRequestInterface $request, DelegateInterface $delegate)
        try {
            $queryType = new ObjectType([
                'name'   => 'Query',
                'fields' => [
                    'echo' => [
                        'type'    => Type::string(),
                        'args'    => [
                            'message' => ['type' => Type::string()],
                        'resolve' => function ($root, $args) {
                            return $root['prefix'] . $args['message'];
            $mutationType = new ObjectType([
                'name'   => 'Calc',
                'fields' => [
                    'sum' => [
                        'type'    => Type::int(),
                        'args'    => [
                            'x' => ['type' => Type::int()],
                            'y' => ['type' => Type::int()],
                        'resolve' => function ($root, $args) {
                            return $args['x'] + $args['y'];
            $schema = new Schema([
                'query'    => $queryType,
                'mutation' => $mutationType,
            $rawInput       = file_get_contents('php://input');
            $input          = json_decode($rawInput, true);
            $query          = $input['query'];
            $variableValues = isset($input['variables']) ? $input['variables'] : null;
            $rootValue = ['prefix' => 'You said: '];
            $result    = GraphQL::execute($schema, $query, $rootValue, null, $variableValues);
        } catch (\Exception $e) {
            $result = [
                'error' => [
                    'message' => 'hola',
        return new JsonResponse($result);

This doesn’t feel like a Zend Expressive problem to me, it feels like a Graphql problem - it’s hard to tell from your question as the phrase doesn’t work is very undescriptive.

Can you give us more information please? Does this action get dispatched at the correct url (e.g. is it a routing problem)? Does the GraphQL::execute method get run and throw an exception? Because if it does your catching it and doing nothing which would result in no error.

I think he is not doing nothing after catching the error, but instead returning it in the json reponse…

If nothing is being returned, most likely a PHP error is occurring, or a Throwable is being raised; alternately, $result is not a structure that JsonResponse can serialize, which is leading to an error.

What is GraphQL::execute supposed to return, exactly?