-
-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
questionRequest for support or clarificationRequest for support or clarification
Description
I have asked this in stackoverflow and got some workaround as an answer https://stackoverflow.com/questions/75375487/laravel-lighthouse-pass-data-from-parent-to-child/75379321#75379321, but were thinking maybe there is a cleaner way maybe via using ResolveInfo .
So just wanted to make sure if the best way to send data to child is do that extra data from parent and get it as the first argument of child (the parent data) or is there a better way.
public function parent(
$_,
array $args,
GraphQLContext $context,
ResolveInfo $resolveInfo
) {
return [
"extra_data_for_child" => true,
"real_data" => [
"real_stuff" => [
"real" => "1",
],
],
];
}
/**
* @param null $_
* @param array{} $args
*/
public function child(
$parent,
array $args,
GraphQLContext $context,
ResolveInfo $resolveInfo
) {
dd($parent['extra_data_for_child']); // true
}Metadata
Metadata
Assignees
Labels
questionRequest for support or clarificationRequest for support or clarification