Skip to content

Commit

Permalink
fix inventory query
Browse files Browse the repository at this point in the history
  • Loading branch information
boscohyun committed May 30, 2024
1 parent 6a5e1d6 commit 17b4bcf
Showing 1 changed file with 52 additions and 43 deletions.
95 changes: 52 additions & 43 deletions utils/mimirGraphQLClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,54 +42,63 @@ export function getSdk(networkType: NetworkType, nodeType: NodeType) {
client,
inventory: (avatarAddress: string) => {
const query = `
query {
inventory(planetName: ${planetName}, avatarAddress: "${avatarAddress}") {
consumables {
itemSheetId
grade
itemType
itemSubType
elementalType
count
requiredBlockIndex
nonFungibleId
}
costumes {
itemSheetId
grade
itemType
itemSubType
elementalType
count
requiredBlockIndex
nonFungibleId
}
equipments {
itemSheetId
grade
itemType
itemSubType
elementalType
count
requiredBlockIndex
nonFungibleId
}
materials {
itemSheetId
grade
itemType
itemSubType
elementalType
count
requiredBlockIndex
nonFungibleId
}
query
{
avatar(planetName: ${planetName}, address: "${avatarAddress}")
{
inventory
{
consumables
{
itemSheetId
grade
itemType
itemSubType
elementalType
count
requiredBlockIndex
nonFungibleId
}
costumes
{
itemSheetId
grade
itemType
itemSubType
elementalType
count
requiredBlockIndex
nonFungibleId
}
equipments
{
itemSheetId
grade
itemType
itemSubType
elementalType
count
requiredBlockIndex
nonFungibleId
}
materials
{
itemSheetId
grade
itemType
itemSubType
elementalType
count
requiredBlockIndex
nonFungibleId
}
}
}
}
`;
return client
.request(query, undefined, { accept: "application/json" })
.then((data) => data.inventory);
.then((data) => data.avatar?.inventory);
},
sheetNames: () => {
const query = `
Expand Down

0 comments on commit 17b4bcf

Please sign in to comment.