From 927f6a5aab9458f1ec022b4d28660cbffed0add8 Mon Sep 17 00:00:00 2001 From: Razzmatazz Date: Sat, 2 Apr 2022 12:15:17 -0500 Subject: [PATCH] initial implementation of item attributes --- datasources/barters.js | 2 ++ datasources/crafts.js | 2 ++ datasources/items.js | 1 + schema.js | 6 ++++++ 4 files changed, 11 insertions(+) diff --git a/datasources/barters.js b/datasources/barters.js index 88a24f04..fb23dff5 100644 --- a/datasources/barters.js +++ b/datasources/barters.js @@ -21,6 +21,7 @@ class BartersAPI { item: itemsAPI.getItem(itemData.id), count: itemData.count, quantity: itemData.count, + attributes: itemData.attributes }; }), rewardItems: barter.rewardItems.map((itemData) => { @@ -28,6 +29,7 @@ class BartersAPI { item: itemsAPI.getItem(itemData.id), count: itemData.count, quantity: itemData.count, + attributes: [] }; }) }); diff --git a/datasources/crafts.js b/datasources/crafts.js index 4a927766..b5ed0e3e 100644 --- a/datasources/crafts.js +++ b/datasources/crafts.js @@ -22,6 +22,7 @@ class CraftsAPI { item: itemsAPI.getItem(itemData.id), count: itemData.count, quantity: itemData.count, + attributes: [] }; }), rewardItems: craft.rewardItems.map((itemData) => { @@ -29,6 +30,7 @@ class CraftsAPI { item: itemsAPI.getItem(itemData.id), count: itemData.count, quantity: itemData.count, + attributes: [] }; }) }); diff --git a/datasources/items.js b/datasources/items.js index 3b778ee2..9f3fee9b 100644 --- a/datasources/items.js +++ b/datasources/items.js @@ -150,6 +150,7 @@ class ItemsAPI { item: this.formatItem(this.itemCache[containedItem.itemId]), count: containedItem.count, quantity: containedItem.count, + attributes: [] }; }); } diff --git a/schema.js b/schema.js index 70c3204e..6ad336c0 100644 --- a/schema.js +++ b/schema.js @@ -140,10 +140,16 @@ module.exports = ` value: Int } + type ItemAttribute { + type: String! + value: String + } + type ContainedItem { item: Item! count: Float! quantity: Float! + attributes: [ItemAttribute] } type Barter {