dataloader-bundle
dataloader-bundle copied to clipboard
Allow to add a null value in the list of keys
Hello,
I'm using your excellent GraphQL bundle and so the dataloader.
In one of my type, I need to load another type using the dataloader. To do that, I use a property of my first type, but this property can be null sometimes. Of course, the result for this key would be null and this is what I'm looking for. But now, this throws an error because of the checkKey method of overblog/dataloader-php/src/DataLoader.php
Thank you a lot Jourdan
Faced the same problem
Shouldn't you do a check in the resolver
if(!$root->nullable) {
return null;
}
return $this->dataLoader->load($root->nullable);