nuwave / lighthouse

A framework for serving GraphQL from Laravel
https://lighthouse-php.com
MIT License
3.36k stars 438 forks source link

artisan lighthouse:union stub appears to be incorrect #2517

Closed SlyDave closed 7 months ago

SlyDave commented 7 months ago

Describe the bug

When using artisan lighthouse:union <name> the created file imports Nuwave\Lighthouse\Execution\ResolveInfo for $resolveInfo

This results in the following error:

App\GraphQL\Unions\ServiceSettings::__invoke(): Argument #3 ($resolveInfo) must be of type Nuwave\Lighthouse\Execution\ResolveInfo, GraphQL\Type\Definition\ResolveInfo given, called in C:\www\workrest\vendor\webonyx\graphql-php\src\Type\Definition\UnionType.php on line 112

Changing the import from Nuwave\Lighthouse\Execution\ResolveInfo to GraphQL\Type\Definition\ResolveInfo appears to resolve the issue.

spawnia commented 7 months ago

Fixed with https://github.com/nuwave/lighthouse/releases/tag/v6.33.4.

Please consider sponsoring.