I've developed a data loader that can resolve various values of an item
export const Item: ItemResolvers = {
id: async (item) => item.id,
weight: async (item) => {
const finalItem = await dataLoader.Item.load(item.id);
return finalItem.weight;
},
name: async (item) => {
const finalItem = await dataLoader.Item.load(item.id);
return finalItem.name;
},
image: async (item) => {
const finalItem = await dataLoader.Item.load(item.id);
return finalItem.image;
},
};
I'm facing a challenge in filtering items by their name. Initially, I only possess the item IDs. However, I am struggling to devise a method to filter out items once the dataloader has loaded their respective names.