dataloader-php
dataloader-php copied to clipboard
Returned data preconditions
trafficstars
– The Array of values must be the same length as the Array of keys. – Each index in the Array of values must correspond to the same index in the Array of keys.
This confused me, can you point me to part of code where I can examine this logic? Thanks!
This limitation was introduce in a first place by promise adapters like ReactPromise by example. But this limitation is maybe outdated.
Got it, thanks. Found the actual mapping here https://github.com/overblog/dataloader-php/blob/master/src/DataLoader.php#L366
There is a property key on $data. Can be probably used for value lookup when result is indexed by that key.