-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Curious why there is an explicit null check in the toString(). Why not treat undefined the same as null and use ''? You can see a pattern that we use a lot in our code and it fails because the map at the end returns undefined.
return new RedisDataLoader(
'prefix',
new DataLoader(
async (ids) => {
const results = await pool.query(
`select * from foo where id = any($1)
`,
[ids],
)
const keyById = keyBy(results.rows, 'id')
return ids.map((id) => keyById[id])
},
{ cache: false },
),
{
ONE_HOUR,
},
)Metadata
Metadata
Assignees
Labels
No labels