const userId = "60ae9885ac03cad607488434" const getUserCosmetic = await fetch(`https://7tv.io/v3/gql`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ operationName: 'GetUserCosmetics', variables: { id: userId, }, query: ` query GetUserCosmetics($id: ObjectID!) { user(id: $id) { id cosmetics { id kind selected } } } `, }), }).then(response => response.json()); const paintId = getUserCosmetic.data.user.cosmetics.filter(cosmetic => cosmetic.kind == "PAINT" && cosmetic.selected == true)[0]?.id; const getPaint = await fetch(`https://7tv.io/v3/gql`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ operationName: 'GetCosmestics', variables: { list: [paintId] }, query: ` query GetCosmestics($list: [ObjectID!]) { cosmetics(list: $list) { paints { id kind name function color angle shape image_url repeat stops { at color } shadows { x_offset y_offset radius color } } } } `, }), }).then(response => response.json()); return getPaint.data.cosmetics.paints[0]