From 57c09814728131c5b158e39a962b1db001500497 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 15 Sep 2020 03:27:41 -0700 Subject: [PATCH] ah oops, dont use syntax that prod doesn't support right, dev supports `?.` syntax, but prod builds don't. I keep forgetting that! --- src/server/types/Item.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/types/Item.js b/src/server/types/Item.js index 6c66dcd..bc43bc0 100644 --- a/src/server/types/Item.js +++ b/src/server/types/Item.js @@ -151,7 +151,8 @@ const resolvers = { const speciesIdsByColorIdAndItemId = await itemsThatNeedModelsLoader.load( "all" ); - const row = speciesIdsByColorIdAndItemId.get(colorId)?.get(id); + const speciesIdsByItemId = speciesIdsByColorIdAndItemId.get(colorId); + const row = speciesIdsByItemId && speciesIdsByItemId.get(id); if (!row) { return []; } @@ -232,7 +233,8 @@ const resolvers = { const speciesIdsByColorIdAndItemId = await itemsThatNeedModelsLoader.load( "all" ); - const itemIds = speciesIdsByColorIdAndItemId.get(colorId)?.keys() || []; + const speciesIdsByItemIds = speciesIdsByColorIdAndItemId.get(colorId); + const itemIds = (speciesIdsByItemIds && speciesIdsByItemIds.keys()) || []; return Array.from(itemIds, (id) => ({ id })); }, },