Minor bugfix in wakaValueText

This is the same user-facing behavior, but stops logging errors for items that are _expected_ to not have Waka data
This commit is contained in:
Emi Matchu 2021-04-03 14:32:12 -07:00
parent a73427af1e
commit d918162a2f

View file

@ -255,14 +255,16 @@ const resolvers = {
return item.createdAt && item.createdAt.toISOString();
},
wakaValueText: async ({ id }, _, { itemWakaValueLoader }) => {
let wakaValue;
try {
const wakaValue = await itemWakaValueLoader.load(id);
return wakaValue.value;
wakaValue = await itemWakaValueLoader.load(id);
} catch (e) {
console.error(`Error loading wakaValueText for item ${id}, skipping:`);
console.error(e);
return null;
wakaValue = null;
}
return wakaValue ? wakaValue.value : null;
},
currentUserOwnsThis: async (