-
Notifications
You must be signed in to change notification settings - Fork 517
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
[Feature request] Remove same length check or auto full fill #233
Comments
A simple map function would do, like in the example https://github.com/graphql/dataloader/blob/master/examples/Redis.md
|
Thanks, I'm using a custom mapping function to deals with the problem temporarily, but still want to discuss this issue. besides, the behaviors from redis mget and mongodb $in are totally different. mget return a same length array with nil inside, Actually this does not fit the situation discussed in this post. but with mongodb, no matter using $in or mapreducer, can not ensure a equal length return |
agree, redis is a bad example because it return null for non existent key. however the sql example is still applied here https://github.com/graphql/dataloader/blob/master/examples/SQL.md |
Yes, the sql example is similar what i did now, that's why I think this feature is over coupled |
@ash0080 if you do not return an array of the same length, how will Dataloader know which input corresponds with which output? e.g. if Dataloader gives you the array |
What problem are you trying to solve?
“DataLoader must be constructed with function which accepts Array and returns Promise>, but the function did not return a Promise of an Array of the same length as the Array of keys”
Describe the solution you'd like
In practice using a NoSql database like mongodb, some referenced document missing is not a serious problem, but this length check make things terrible, for example
Describe alternatives you've considered
My questions are:
The text was updated successfully, but these errors were encountered: