php-graphql-client
php-graphql-client copied to clipboard
Trying to implement login mutation [Sorare]
Hello, I am trying to build a query for the following mutation, already spent hours but something is wrong.
This is my code
Really appreciate it if someone can help.
I am getting the following response
Pasting also my code to make it easier to help :D
$mutation = (new Mutation('signIn'))
->setOperationName('SignInMutation')
->setArguments(
[
'input' => new RawObject('{email: "[email protected]", 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);