__resolveReference in Typescript Loader
timclaason opened this issue · comments
Tim Claason commented
Wondering if there is a Typescript equivalent of the Javascript example given in documentation for how to have a cached reference resolver in a loader. For some reason, I can't get it to work...
const loaders = {
User: {
async __resolveReference(queries, context) {
// This should be a bulk query to the database
return queries.map(({ obj }) => users[obj.id])
}
}
}
Matteo Collina commented
Thanks for reporting!
Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.