Args array is empty in GraphQLType fields() function #786
Replies: 2 comments
-
You need to show your actual query. I suspect you are not passing an argument to your …
yourType {
user_check(check:_id: …
} But this also requires defining the $fields['user_check'] = [
'type' => CheckType::type(),
'args' => [
'check_id' => [
'type' => …
],
],
'resolve' => function (Tariff $tariff, array $args) {
dd($args);
return $tariff->checks()->find($args['check_id']);
}
]; In the (distant) past, this library used to populate the query/mutation args into the field args, but that was just a plain bug and that functionality was removed. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer, it is help me. In my TariffType And it is work! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I have a problem with empty args array into GraphQLType fields() function, although it's correct in query resolve().
In this case array
$args
is empty. Please, tell me what is wrong with it.Thank you!
Beta Was this translation helpful? Give feedback.
All reactions