Skip to content

Commit dc622ed

Browse files
authored
Merge pull request #16 from the-hideout/add-item-attributes
Initial implementation of item attributes
2 parents 0932d49 + 927f6a5 commit dc622ed

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

datasources/barters.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ class BartersAPI {
2121
item: itemsAPI.getItem(itemData.id),
2222
count: itemData.count,
2323
quantity: itemData.count,
24+
attributes: itemData.attributes
2425
};
2526
}),
2627
rewardItems: barter.rewardItems.map((itemData) => {
2728
return {
2829
item: itemsAPI.getItem(itemData.id),
2930
count: itemData.count,
3031
quantity: itemData.count,
32+
attributes: []
3133
};
3234
})
3335
});

datasources/crafts.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ class CraftsAPI {
2222
item: itemsAPI.getItem(itemData.id),
2323
count: itemData.count,
2424
quantity: itemData.count,
25+
attributes: []
2526
};
2627
}),
2728
rewardItems: craft.rewardItems.map((itemData) => {
2829
return {
2930
item: itemsAPI.getItem(itemData.id),
3031
count: itemData.count,
3132
quantity: itemData.count,
33+
attributes: []
3234
};
3335
})
3436
});

datasources/items.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class ItemsAPI {
150150
item: this.formatItem(this.itemCache[containedItem.itemId]),
151151
count: containedItem.count,
152152
quantity: containedItem.count,
153+
attributes: []
153154
};
154155
});
155156
}

schema.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,16 @@ module.exports = `
140140
value: Int
141141
}
142142
143+
type ItemAttribute {
144+
type: String!
145+
value: String
146+
}
147+
143148
type ContainedItem {
144149
item: Item!
145150
count: Float!
146151
quantity: Float!
152+
attributes: [ItemAttribute]
147153
}
148154
149155
type Barter {

0 commit comments

Comments
 (0)