mattecapu / dataloader-sequelize-wrapper

wrap your Sequelize objects in a dataloader caching layer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when loading keys that don't exist in the db

mattecapu opened this issue · comments

// if no `mymodel` object has ID=404 this throws
cache.from('mymodel').loadMany([ 1, 2, 404 ])

This causes fetched objects to be less than the required keys, throwing the following exception:

DataLoader must be constructed with a function which accepts Array and returns Promise<Array>, but the function did not return a Promise of an Array of the same length as the Array of keys