mghoneimy/php-graphql-client

Trying to implement login mutation [Sorare]

Opened this issue · 2 comments

Hello, I am trying to build a query for the following mutation, already spent hours but something is wrong.

image

This is my code

image

Really appreciate it if someone can help.

I am getting the following response

image

Pasting also my code to make it easier to help :D

        $mutation = (new Mutation('signIn'))
            ->setOperationName('SignInMutation')
            ->setArguments(
                [
                    'input' => new RawObject('{email: "faridmovsumov@gmail.com", password: "'.$hashedPassword.'"}'),
                ])
            ->setSelectionSet([
                (new Query('currentUser'))
                    ->setSelectionSet(
                        [
                            'slug',
                            'id',
                            (new Query('jwtToken'))->setSelectionSet([
                                'token',
                                'expiredAt'
                            ])->setArguments(['aud' => 'farid'])
                        ]
                    ),
                (new Query('errors'))
                    ->setSelectionSet(
                        [
                            'message',
                        ]
                    ),
                ],

            );
        $results = $client->runQuery($mutation);

        dd($results);