Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to add a null value in the list of keys #25

Open
jourdan-qe opened this issue Mar 27, 2020 · 2 comments
Open

Allow to add a null value in the list of keys #25

jourdan-qe opened this issue Mar 27, 2020 · 2 comments

Comments

@jourdan-qe
Copy link

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

@pvlg
Copy link

pvlg commented Jul 7, 2021

Faced the same problem

@Warxcell
Copy link

Shouldn't you do a check in the resolver

if(!$root->nullable) {
   return null;
}
return $this->dataLoader->load($root->nullable);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants