-
-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
needs reproductionFailing test case neededFailing test case needed
Description
Describe the bug
I struggle for two days trying to figure out why my query with the relationships @hasOne @belongsTo wasn't working for me, and after looking into the source code I found THIS function buildKey() in the BatchLoader.php file that has the description: Build a key out of one or more given keys, supporting composite keys. which receives the parameter $key, so the problem (in my case) is that this $key variable is always NULL so I change it to:
Edited:
protected function buildKey($key): string
{
return true;
}
Original:
protected function buildKey($key): string
{
return is_array($key) ? implode('___', $key) : $key;
}
and Voilà, now my query works perfectly :D
The question is why?
because it's still not entirely clear to me how that actually works, could you please explain? maybe I'm doing it wrong and haven't noticed. Thank you ♥
Lighthouse Version
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"firebase/php-jwt": "^5.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"mll-lab/graphql-php-scalars": "^3.1",
"mll-lab/laravel-graphql-playground": "^2.1",
"nuwave/lighthouse": "^4.14"
}
Metadata
Metadata
Assignees
Labels
needs reproductionFailing test case neededFailing test case needed