Skip to content

Commit 2356dc5

Browse files
authored
Merge pull request #82 from the-hideout/add-item-categories
Add item categories
2 parents 2ecd3a9 + 017cc4b commit 2356dc5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

resolvers/itemResolver.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ module.exports = {
108108
if (data.bsgCategoryId) return context.data.item.getTopCategory(data.bsgCategoryId);
109109
return null;
110110
},
111+
categories(data, args, context) {
112+
return data.categories.map(id => {
113+
return context.data.item.getCategory(id);
114+
});
115+
},
111116
usedInTasks(data, args, context) {
112117
return context.data.task.getTasksRequiringItem(data.id);
113118
},

schema.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ type Item {
216216
containsItems: [ContainedItem]
217217
category: ItemCategory
218218
categoryTop: ItemCategory
219+
categories: [ItemCategory]!
219220
bsgCategoryId: String
220221
weight: Float
221222
velocity: Float

0 commit comments

Comments
 (0)