I have a data loader that resolves the different 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 want to filter items with a particular name. Initially, I only have ids of the items. But, I am not able to figure out how can i filter out items after dataloader has loaded the names of the items.