add isPb to item GQL

This commit is contained in:
Emi Matchu 2020-11-03 19:46:18 -08:00
parent e47bec0abc
commit 3171d8095a
3 changed files with 116 additions and 499 deletions

View file

@ -13,13 +13,16 @@ describe("Item", () => {
const res = await query({ const res = await query({
query: gql` query: gql`
query { query {
items(ids: ["38913", "38911", "38912", "55788", "77530", "78104"]) { items(
ids: ["38913", "38911", "38912", "55788", "60671", "77530", "78104"]
) {
id id
name name
description description
thumbnailUrl thumbnailUrl
rarityIndex rarityIndex
isNc isNc
isPb
createdAt createdAt
manualSpecialColor { manualSpecialColor {
id id
@ -39,23 +42,25 @@ describe("Item", () => {
expect(getDbCalls()).toMatchInlineSnapshot(` expect(getDbCalls()).toMatchInlineSnapshot(`
Array [ Array [
Array [ Array [
"SELECT * FROM item_translations WHERE item_id IN (?,?,?,?,?,?) AND locale = \\"en\\"", "SELECT * FROM item_translations WHERE item_id IN (?,?,?,?,?,?,?) AND locale = \\"en\\"",
Array [ Array [
"38913", "38913",
"38911", "38911",
"38912", "38912",
"55788", "55788",
"60671",
"77530", "77530",
"78104", "78104",
], ],
], ],
Array [ Array [
"SELECT * FROM items WHERE id IN (?,?,?,?,?,?)", "SELECT * FROM items WHERE id IN (?,?,?,?,?,?,?)",
Array [ Array [
"38913", "38913",
"38911", "38911",
"38912", "38912",
"55788", "55788",
"60671",
"77530", "77530",
"78104", "78104",
], ],
@ -65,13 +70,14 @@ describe("Item", () => {
INNER JOIN parents_swf_assets psa INNER JOIN parents_swf_assets psa
ON psa.parent_type = \\"Item\\" AND psa.parent_id = items.id ON psa.parent_type = \\"Item\\" AND psa.parent_id = items.id
INNER JOIN swf_assets sa ON sa.id = psa.swf_asset_id INNER JOIN swf_assets sa ON sa.id = psa.swf_asset_id
WHERE items.id IN (?, ?, ?, ?, ?, ?) WHERE items.id IN (?, ?, ?, ?, ?, ?, ?)
GROUP BY items.id;", GROUP BY items.id;",
Array [ Array [
"38913", "38913",
"38911", "38911",
"38912", "38912",
"55788", "55788",
"60671",
"77530", "77530",
"78104", "78104",
], ],

View file

@ -851,10 +851,6 @@ Object {
"id": "81777", "id": "81777",
"name": "Dyeworks Cream: Cosy Baby Onesie", "name": "Dyeworks Cream: Cosy Baby Onesie",
"speciesThatNeedModels": Array [ "speciesThatNeedModels": Array [
Object {
"id": "4",
"name": "Bori",
},
Object { Object {
"id": "7", "id": "7",
"name": "Chia", "name": "Chia",
@ -867,10 +863,6 @@ Object {
"id": "11", "id": "11",
"name": "Elephante", "name": "Elephante",
}, },
Object {
"id": "13",
"name": "Flotsam",
},
Object { Object {
"id": "15", "id": "15",
"name": "Gnorbu", "name": "Gnorbu",
@ -957,10 +949,6 @@ Object {
"id": "81778", "id": "81778",
"name": "Dyeworks Pink: Cosy Baby Onesie", "name": "Dyeworks Pink: Cosy Baby Onesie",
"speciesThatNeedModels": Array [ "speciesThatNeedModels": Array [
Object {
"id": "4",
"name": "Bori",
},
Object { Object {
"id": "7", "id": "7",
"name": "Chia", "name": "Chia",
@ -973,10 +961,6 @@ Object {
"id": "12", "id": "12",
"name": "Eyrie", "name": "Eyrie",
}, },
Object {
"id": "13",
"name": "Flotsam",
},
Object { Object {
"id": "16", "id": "16",
"name": "Grarrl", "name": "Grarrl",
@ -997,10 +981,6 @@ Object {
"id": "23", "id": "23",
"name": "Kau", "name": "Kau",
}, },
Object {
"id": "24",
"name": "Kiko",
},
Object { Object {
"id": "25", "id": "25",
"name": "Koi", "name": "Koi",
@ -1075,14 +1055,6 @@ Object {
"id": "81779", "id": "81779",
"name": "Dyeworks Black: Cosy Baby Onesie", "name": "Dyeworks Black: Cosy Baby Onesie",
"speciesThatNeedModels": Array [ "speciesThatNeedModels": Array [
Object {
"id": "4",
"name": "Bori",
},
Object {
"id": "7",
"name": "Chia",
},
Object { Object {
"id": "8", "id": "8",
"name": "Chomby", "name": "Chomby",
@ -1099,10 +1071,6 @@ Object {
"id": "12", "id": "12",
"name": "Eyrie", "name": "Eyrie",
}, },
Object {
"id": "13",
"name": "Flotsam",
},
Object { Object {
"id": "15", "id": "15",
"name": "Gnorbu", "name": "Gnorbu",
@ -1363,10 +1331,6 @@ Object {
"id": "48", "id": "48",
"name": "Tuskaninny", "name": "Tuskaninny",
}, },
Object {
"id": "51",
"name": "Wocky",
},
Object { Object {
"id": "52", "id": "52",
"name": "Xweetok", "name": "Xweetok",
@ -1599,10 +1563,6 @@ Object {
"id": "5", "id": "5",
"name": "Bruce", "name": "Bruce",
}, },
Object {
"id": "6",
"name": "Buzz",
},
Object { Object {
"id": "7", "id": "7",
"name": "Chia", "name": "Chia",
@ -1659,10 +1619,6 @@ Object {
"id": "30", "id": "30",
"name": "Lenny", "name": "Lenny",
}, },
Object {
"id": "34",
"name": "Moehog",
},
Object { Object {
"id": "36", "id": "36",
"name": "Nimmo", "name": "Nimmo",
@ -1687,10 +1643,6 @@ Object {
"id": "48", "id": "48",
"name": "Tuskaninny", "name": "Tuskaninny",
}, },
Object {
"id": "51",
"name": "Wocky",
},
Object { Object {
"id": "52", "id": "52",
"name": "Xweetok", "name": "Xweetok",
@ -1713,10 +1665,6 @@ Object {
"id": "5", "id": "5",
"name": "Bruce", "name": "Bruce",
}, },
Object {
"id": "6",
"name": "Buzz",
},
Object { Object {
"id": "7", "id": "7",
"name": "Chia", "name": "Chia",
@ -1749,10 +1697,6 @@ Object {
"id": "20", "id": "20",
"name": "Jetsam", "name": "Jetsam",
}, },
Object {
"id": "21",
"name": "Jubjub",
},
Object { Object {
"id": "23", "id": "23",
"name": "Kau", "name": "Kau",
@ -1773,14 +1717,6 @@ Object {
"id": "30", "id": "30",
"name": "Lenny", "name": "Lenny",
}, },
Object {
"id": "32",
"name": "Lutari",
},
Object {
"id": "34",
"name": "Moehog",
},
Object { Object {
"id": "36", "id": "36",
"name": "Nimmo", "name": "Nimmo",
@ -1789,10 +1725,6 @@ Object {
"id": "38", "id": "38",
"name": "Peophin", "name": "Peophin",
}, },
Object {
"id": "40",
"name": "Pteri",
},
Object { Object {
"id": "41", "id": "41",
"name": "Quiggle", "name": "Quiggle",
@ -1809,10 +1741,6 @@ Object {
"id": "48", "id": "48",
"name": "Tuskaninny", "name": "Tuskaninny",
}, },
Object {
"id": "51",
"name": "Wocky",
},
Object { Object {
"id": "52", "id": "52",
"name": "Xweetok", "name": "Xweetok",
@ -1839,10 +1767,6 @@ Object {
"id": "5", "id": "5",
"name": "Bruce", "name": "Bruce",
}, },
Object {
"id": "6",
"name": "Buzz",
},
Object { Object {
"id": "7", "id": "7",
"name": "Chia", "name": "Chia",
@ -1895,10 +1819,6 @@ Object {
"id": "30", "id": "30",
"name": "Lenny", "name": "Lenny",
}, },
Object {
"id": "34",
"name": "Moehog",
},
Object { Object {
"id": "36", "id": "36",
"name": "Nimmo", "name": "Nimmo",
@ -1927,10 +1847,6 @@ Object {
"id": "48", "id": "48",
"name": "Tuskaninny", "name": "Tuskaninny",
}, },
Object {
"id": "51",
"name": "Wocky",
},
Object { Object {
"id": "52", "id": "52",
"name": "Xweetok", "name": "Xweetok",
@ -1959,14 +1875,6 @@ Object {
"id": "1", "id": "1",
"name": "Acara", "name": "Acara",
}, },
Object {
"id": "2",
"name": "Aisha",
},
Object {
"id": "8",
"name": "Chomby",
},
Object { Object {
"id": "15", "id": "15",
"name": "Gnorbu", "name": "Gnorbu",
@ -1979,10 +1887,6 @@ Object {
"id": "21", "id": "21",
"name": "Jubjub", "name": "Jubjub",
}, },
Object {
"id": "22",
"name": "Kacheek",
},
Object { Object {
"id": "24", "id": "24",
"name": "Kiko", "name": "Kiko",
@ -1991,26 +1895,10 @@ Object {
"id": "28", "id": "28",
"name": "Krawk", "name": "Krawk",
}, },
Object {
"id": "29",
"name": "Kyrii",
},
Object { Object {
"id": "33", "id": "33",
"name": "Meerca", "name": "Meerca",
}, },
Object {
"id": "34",
"name": "Moehog",
},
Object {
"id": "36",
"name": "Nimmo",
},
Object {
"id": "39",
"name": "Poogle",
},
Object { Object {
"id": "40", "id": "40",
"name": "Pteri", "name": "Pteri",
@ -2023,10 +1911,6 @@ Object {
"id": "45", "id": "45",
"name": "Skeith", "name": "Skeith",
}, },
Object {
"id": "47",
"name": "Tonu",
},
Object { Object {
"id": "49", "id": "49",
"name": "Uni", "name": "Uni",
@ -2035,10 +1919,6 @@ Object {
"id": "50", "id": "50",
"name": "Usul", "name": "Usul",
}, },
Object {
"id": "51",
"name": "Wocky",
},
Object { Object {
"id": "54", "id": "54",
"name": "Zafara", "name": "Zafara",
@ -2053,18 +1933,6 @@ Object {
"id": "1", "id": "1",
"name": "Acara", "name": "Acara",
}, },
Object {
"id": "2",
"name": "Aisha",
},
Object {
"id": "4",
"name": "Bori",
},
Object {
"id": "8",
"name": "Chomby",
},
Object { Object {
"id": "15", "id": "15",
"name": "Gnorbu", "name": "Gnorbu",
@ -2077,10 +1945,6 @@ Object {
"id": "21", "id": "21",
"name": "Jubjub", "name": "Jubjub",
}, },
Object {
"id": "22",
"name": "Kacheek",
},
Object { Object {
"id": "24", "id": "24",
"name": "Kiko", "name": "Kiko",
@ -2089,10 +1953,6 @@ Object {
"id": "28", "id": "28",
"name": "Krawk", "name": "Krawk",
}, },
Object {
"id": "29",
"name": "Kyrii",
},
Object { Object {
"id": "32", "id": "32",
"name": "Lutari", "name": "Lutari",
@ -2101,14 +1961,6 @@ Object {
"id": "33", "id": "33",
"name": "Meerca", "name": "Meerca",
}, },
Object {
"id": "34",
"name": "Moehog",
},
Object {
"id": "36",
"name": "Nimmo",
},
Object { Object {
"id": "40", "id": "40",
"name": "Pteri", "name": "Pteri",
@ -2117,22 +1969,10 @@ Object {
"id": "41", "id": "41",
"name": "Quiggle", "name": "Quiggle",
}, },
Object {
"id": "43",
"name": "Scorchio",
},
Object {
"id": "47",
"name": "Tonu",
},
Object { Object {
"id": "49", "id": "49",
"name": "Uni", "name": "Uni",
}, },
Object {
"id": "50",
"name": "Usul",
},
Object { Object {
"id": "51", "id": "51",
"name": "Wocky", "name": "Wocky",
@ -2151,18 +1991,6 @@ Object {
"id": "1", "id": "1",
"name": "Acara", "name": "Acara",
}, },
Object {
"id": "2",
"name": "Aisha",
},
Object {
"id": "4",
"name": "Bori",
},
Object {
"id": "8",
"name": "Chomby",
},
Object { Object {
"id": "15", "id": "15",
"name": "Gnorbu", "name": "Gnorbu",
@ -2175,10 +2003,6 @@ Object {
"id": "21", "id": "21",
"name": "Jubjub", "name": "Jubjub",
}, },
Object {
"id": "22",
"name": "Kacheek",
},
Object { Object {
"id": "24", "id": "24",
"name": "Kiko", "name": "Kiko",
@ -2187,10 +2011,6 @@ Object {
"id": "28", "id": "28",
"name": "Krawk", "name": "Krawk",
}, },
Object {
"id": "29",
"name": "Kyrii",
},
Object { Object {
"id": "32", "id": "32",
"name": "Lutari", "name": "Lutari",
@ -2199,18 +2019,6 @@ Object {
"id": "33", "id": "33",
"name": "Meerca", "name": "Meerca",
}, },
Object {
"id": "34",
"name": "Moehog",
},
Object {
"id": "36",
"name": "Nimmo",
},
Object {
"id": "39",
"name": "Poogle",
},
Object { Object {
"id": "40", "id": "40",
"name": "Pteri", "name": "Pteri",
@ -2223,10 +2031,6 @@ Object {
"id": "43", "id": "43",
"name": "Scorchio", "name": "Scorchio",
}, },
Object {
"id": "47",
"name": "Tonu",
},
Object { Object {
"id": "49", "id": "49",
"name": "Uni", "name": "Uni",
@ -2657,132 +2461,6 @@ Object {
}, },
], ],
}, },
Object {
"id": "42546",
"name": "Blue Scorchio Star Balloon With Screen",
"speciesThatNeedModels": Array [
Object {
"id": "4",
"name": "Bori",
},
Object {
"id": "5",
"name": "Bruce",
},
Object {
"id": "6",
"name": "Buzz",
},
Object {
"id": "11",
"name": "Elephante",
},
Object {
"id": "13",
"name": "Flotsam",
},
Object {
"id": "14",
"name": "Gelert",
},
Object {
"id": "15",
"name": "Gnorbu",
},
Object {
"id": "16",
"name": "Grarrl",
},
Object {
"id": "19",
"name": "Ixi",
},
Object {
"id": "20",
"name": "Jetsam",
},
Object {
"id": "21",
"name": "Jubjub",
},
Object {
"id": "23",
"name": "Kau",
},
Object {
"id": "25",
"name": "Koi",
},
Object {
"id": "26",
"name": "Korbat",
},
Object {
"id": "27",
"name": "Kougra",
},
Object {
"id": "30",
"name": "Lenny",
},
Object {
"id": "32",
"name": "Lutari",
},
Object {
"id": "34",
"name": "Moehog",
},
Object {
"id": "36",
"name": "Nimmo",
},
Object {
"id": "40",
"name": "Pteri",
},
Object {
"id": "41",
"name": "Quiggle",
},
Object {
"id": "42",
"name": "Ruki",
},
Object {
"id": "44",
"name": "Shoyru",
},
Object {
"id": "45",
"name": "Skeith",
},
Object {
"id": "46",
"name": "Techo",
},
Object {
"id": "47",
"name": "Tonu",
},
Object {
"id": "48",
"name": "Tuskaninny",
},
Object {
"id": "49",
"name": "Uni",
},
Object {
"id": "52",
"name": "Xweetok",
},
Object {
"id": "53",
"name": "Yurble",
},
],
},
Object { Object {
"id": "47830", "id": "47830",
"name": "Y12 Celebration Glasses", "name": "Y12 Celebration Glasses",
@ -6413,6 +6091,10 @@ Object {
"id": "32", "id": "32",
"name": "Lutari", "name": "Lutari",
}, },
Object {
"id": "36",
"name": "Nimmo",
},
Object { Object {
"id": "37", "id": "37",
"name": "Ogrin", "name": "Ogrin",
@ -6725,10 +6407,18 @@ Object {
"id": "81144", "id": "81144",
"name": "MME25-S5a: Storage Gear Trinket", "name": "MME25-S5a: Storage Gear Trinket",
"speciesThatNeedModels": Array [ "speciesThatNeedModels": Array [
Object {
"id": "1",
"name": "Acara",
},
Object { Object {
"id": "2", "id": "2",
"name": "Aisha", "name": "Aisha",
}, },
Object {
"id": "3",
"name": "Blumaroo",
},
Object { Object {
"id": "4", "id": "4",
"name": "Bori", "name": "Bori",
@ -6777,6 +6467,10 @@ Object {
"id": "17", "id": "17",
"name": "Grundo", "name": "Grundo",
}, },
Object {
"id": "18",
"name": "Hissi",
},
Object { Object {
"id": "19", "id": "19",
"name": "Ixi", "name": "Ixi",
@ -6837,6 +6531,10 @@ Object {
"id": "37", "id": "37",
"name": "Ogrin", "name": "Ogrin",
}, },
Object {
"id": "38",
"name": "Peophin",
},
Object { Object {
"id": "39", "id": "39",
"name": "Poogle", "name": "Poogle",
@ -6899,6 +6597,10 @@ Object {
"id": "81145", "id": "81145",
"name": "MME25-S5b: Moltaran Magma Chandelier", "name": "MME25-S5b: Moltaran Magma Chandelier",
"speciesThatNeedModels": Array [ "speciesThatNeedModels": Array [
Object {
"id": "1",
"name": "Acara",
},
Object { Object {
"id": "2", "id": "2",
"name": "Aisha", "name": "Aisha",
@ -6955,6 +6657,10 @@ Object {
"id": "17", "id": "17",
"name": "Grundo", "name": "Grundo",
}, },
Object {
"id": "18",
"name": "Hissi",
},
Object { Object {
"id": "19", "id": "19",
"name": "Ixi", "name": "Ixi",
@ -7019,6 +6725,10 @@ Object {
"id": "37", "id": "37",
"name": "Ogrin", "name": "Ogrin",
}, },
Object {
"id": "38",
"name": "Peophin",
},
Object { Object {
"id": "39", "id": "39",
"name": "Poogle", "name": "Poogle",
@ -7211,36 +6921,12 @@ Object {
"id": "1", "id": "1",
"name": "Acara", "name": "Acara",
}, },
Object {
"id": "4",
"name": "Bori",
},
Object {
"id": "7",
"name": "Chia",
},
Object {
"id": "20",
"name": "Jetsam",
},
Object {
"id": "23",
"name": "Kau",
},
Object {
"id": "24",
"name": "Kiko",
},
], ],
}, },
Object { Object {
"id": "81708", "id": "81708",
"name": "Constellation Dress", "name": "Constellation Dress",
"speciesThatNeedModels": Array [ "speciesThatNeedModels": Array [
Object {
"id": "1",
"name": "Acara",
},
Object { Object {
"id": "4", "id": "4",
"name": "Bori", "name": "Bori",
@ -7249,50 +6935,10 @@ Object {
"id": "12", "id": "12",
"name": "Eyrie", "name": "Eyrie",
}, },
Object {
"id": "13",
"name": "Flotsam",
},
Object {
"id": "18",
"name": "Hissi",
},
Object {
"id": "21",
"name": "Jubjub",
},
Object {
"id": "25",
"name": "Koi",
},
Object {
"id": "34",
"name": "Moehog",
},
Object {
"id": "36",
"name": "Nimmo",
},
Object {
"id": "40",
"name": "Pteri",
},
Object {
"id": "43",
"name": "Scorchio",
},
Object {
"id": "47",
"name": "Tonu",
},
Object { Object {
"id": "48", "id": "48",
"name": "Tuskaninny", "name": "Tuskaninny",
}, },
Object {
"id": "53",
"name": "Yurble",
},
], ],
}, },
Object { Object {
@ -7307,10 +6953,6 @@ Object {
"id": "4", "id": "4",
"name": "Bori", "name": "Bori",
}, },
Object {
"id": "5",
"name": "Bruce",
},
Object { Object {
"id": "7", "id": "7",
"name": "Chia", "name": "Chia",
@ -7335,10 +6977,6 @@ Object {
"id": "24", "id": "24",
"name": "Kiko", "name": "Kiko",
}, },
Object {
"id": "27",
"name": "Kougra",
},
Object { Object {
"id": "33", "id": "33",
"name": "Meerca", "name": "Meerca",
@ -7349,28 +6987,6 @@ Object {
}, },
], ],
}, },
Object {
"id": "81710",
"name": "Spear of Radiance",
"speciesThatNeedModels": Array [
Object {
"id": "1",
"name": "Acara",
},
Object {
"id": "24",
"name": "Kiko",
},
Object {
"id": "41",
"name": "Quiggle",
},
Object {
"id": "42",
"name": "Ruki",
},
],
},
Object { Object {
"id": "81736", "id": "81736",
"name": "Purple & Black Ponytails Wig", "name": "Purple & Black Ponytails Wig",
@ -7385,68 +7001,6 @@ Object {
}, },
], ],
}, },
Object {
"id": "81753",
"name": "Staff of the Dead",
"speciesThatNeedModels": Array [
Object {
"id": "4",
"name": "Bori",
},
Object {
"id": "5",
"name": "Bruce",
},
Object {
"id": "7",
"name": "Chia",
},
Object {
"id": "8",
"name": "Chomby",
},
Object {
"id": "17",
"name": "Grundo",
},
Object {
"id": "21",
"name": "Jubjub",
},
Object {
"id": "25",
"name": "Koi",
},
Object {
"id": "34",
"name": "Moehog",
},
Object {
"id": "37",
"name": "Ogrin",
},
Object {
"id": "40",
"name": "Pteri",
},
Object {
"id": "41",
"name": "Quiggle",
},
Object {
"id": "43",
"name": "Scorchio",
},
Object {
"id": "53",
"name": "Yurble",
},
Object {
"id": "54",
"name": "Zafara",
},
],
},
Object { Object {
"id": "81783", "id": "81783",
"name": "Dyeworks Blue: Decorated Witch Hat and Wig", "name": "Dyeworks Blue: Decorated Witch Hat and Wig",
@ -7455,14 +7009,6 @@ Object {
"id": "7", "id": "7",
"name": "Chia", "name": "Chia",
}, },
Object {
"id": "20",
"name": "Jetsam",
},
Object {
"id": "24",
"name": "Kiko",
},
Object { Object {
"id": "26", "id": "26",
"name": "Korbat", "name": "Korbat",
@ -7492,12 +7038,40 @@ Object {
], ],
}, },
Object { Object {
"id": "81805", "id": "81792",
"name": "Dyeworks Orange: Playful Scarecrow Makeup", "name": "Dyeworks Blue & Purple: MiniMME18-S2a: Galactic Traveller Wig",
"speciesThatNeedModels": Array [ "speciesThatNeedModels": Array [
Object { Object {
"id": "15", "id": "6",
"name": "Gnorbu", "name": "Buzz",
},
Object {
"id": "11",
"name": "Elephante",
},
Object {
"id": "28",
"name": "Krawk",
},
Object {
"id": "46",
"name": "Techo",
},
Object {
"id": "48",
"name": "Tuskaninny",
},
Object {
"id": "49",
"name": "Uni",
},
Object {
"id": "52",
"name": "Xweetok",
},
Object {
"id": "54",
"name": "Zafara",
}, },
], ],
}, },
@ -7508,12 +7082,11 @@ Object {
exports[`Item loads items that need models 2`] = ` exports[`Item loads items that need models 2`] = `
Array [ Array [
Array [ Array [
"SELECT * FROM item_translations WHERE item_id IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) AND locale = \\"en\\"", "SELECT * FROM item_translations WHERE item_id IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) AND locale = \\"en\\"",
Array [ Array [
"36907", "36907",
"42448", "42448",
"42544", "42544",
"42546",
"47830", "47830",
"50669", "50669",
"50670", "50670",
@ -7559,12 +7132,10 @@ Array [
"81697", "81697",
"81708", "81708",
"81709", "81709",
"81710",
"81736", "81736",
"81753",
"81783", "81783",
"81785", "81785",
"81805", "81792",
"72260", "72260",
"81136", "81136",
"81515", "81515",
@ -7666,6 +7237,7 @@ Object {
"explicitlyBodySpecific": false, "explicitlyBodySpecific": false,
"id": "38913", "id": "38913",
"isNc": false, "isNc": false,
"isPb": false,
"manualSpecialColor": null, "manualSpecialColor": null,
"name": "Zafara Agent Gloves", "name": "Zafara Agent Gloves",
"rarityIndex": 88, "rarityIndex": 88,
@ -7682,6 +7254,7 @@ Object {
"explicitlyBodySpecific": false, "explicitlyBodySpecific": false,
"id": "38911", "id": "38911",
"isNc": false, "isNc": false,
"isPb": false,
"manualSpecialColor": null, "manualSpecialColor": null,
"name": "Zafara Agent Hood", "name": "Zafara Agent Hood",
"rarityIndex": 92, "rarityIndex": 92,
@ -7698,6 +7271,7 @@ Object {
"explicitlyBodySpecific": false, "explicitlyBodySpecific": false,
"id": "38912", "id": "38912",
"isNc": false, "isNc": false,
"isPb": false,
"manualSpecialColor": null, "manualSpecialColor": null,
"name": "Zafara Agent Robe", "name": "Zafara Agent Robe",
"rarityIndex": 90, "rarityIndex": 90,
@ -7714,11 +7288,29 @@ Object {
"explicitlyBodySpecific": true, "explicitlyBodySpecific": true,
"id": "55788", "id": "55788",
"isNc": true, "isNc": true,
"isPb": false,
"manualSpecialColor": null, "manualSpecialColor": null,
"name": "Encased in Ice", "name": "Encased in Ice",
"rarityIndex": 500, "rarityIndex": 500,
"thumbnailUrl": "http://images.neopets.com/items/mall_petinice.gif", "thumbnailUrl": "http://images.neopets.com/items/mall_petinice.gif",
}, },
Object {
"allOccupiedZones": Array [
Object {
"label": "Shirt/Dress",
},
],
"createdAt": "2020-01-01T00:00:00.000Z",
"description": "This item is part of a deluxe paint brush set!",
"explicitlyBodySpecific": false,
"id": "60671",
"isNc": false,
"isPb": true,
"manualSpecialColor": null,
"name": "8-Bit Aisha Shirt",
"rarityIndex": 101,
"thumbnailUrl": "http://images.neopets.com/items/clo_8-bit_aisha_shirt.gif",
},
Object { Object {
"allOccupiedZones": Array [ "allOccupiedZones": Array [
Object { Object {
@ -7730,6 +7322,7 @@ Object {
"explicitlyBodySpecific": false, "explicitlyBodySpecific": false,
"id": "77530", "id": "77530",
"isNc": true, "isNc": true,
"isPb": false,
"manualSpecialColor": Object { "manualSpecialColor": Object {
"id": "44", "id": "44",
"name": "Maraquan", "name": "Maraquan",
@ -7749,6 +7342,7 @@ Object {
"explicitlyBodySpecific": false, "explicitlyBodySpecific": false,
"id": "78104", "id": "78104",
"isNc": true, "isNc": true,
"isPb": false,
"manualSpecialColor": null, "manualSpecialColor": null,
"name": "#1 Fan Room Background", "name": "#1 Fan Room Background",
"rarityIndex": 500, "rarityIndex": 500,

View file

@ -8,8 +8,13 @@ const typeDefs = gql`
description: String! description: String!
thumbnailUrl: String! thumbnailUrl: String!
rarityIndex: Int! rarityIndex: Int!
# Whether this item comes from the NC Mall.
isNc: Boolean! isNc: Boolean!
# Whether this item comes from a paintbrush.
isPb: Boolean!
# When this item was first added to DTI. ISO 8601 string, or null if the # When this item was first added to DTI. ISO 8601 string, or null if the
# item was added so long ago that we don't have this field! # item was added so long ago that we don't have this field!
createdAt: String createdAt: String
@ -127,6 +132,18 @@ const resolvers = {
const item = await itemLoader.load(id); const item = await itemLoader.load(id);
return item.rarityIndex === 500 || item.rarityIndex === 0; return item.rarityIndex === 500 || item.rarityIndex === 0;
}, },
isPb: async ({ id }, _, { itemTranslationLoader }) => {
const translation = await itemTranslationLoader.load(id);
if (!translation) {
console.warn(
`Item.isPb: Translation not found for item ${id}. Returning false.`
);
return false;
}
return translation.description.includes(
"This item is part of a deluxe paint brush set!"
);
},
createdAt: async ({ id }, _, { itemLoader }) => { createdAt: async ({ id }, _, { itemLoader }) => {
const item = await itemLoader.load(id); const item = await itemLoader.load(id);
return item.createdAt && item.createdAt.toISOString(); return item.createdAt && item.createdAt.toISOString();