Skip to content

chaincodechd/collections-graph

 
 

Repository files navigation

Decentraland collections graph

Install

npm run install

Deploy

npm run deploy:{network}

Queries

The collection's id is the smart contract address of the collection. The item's id is {collection_contract_address}-{item_blochain_id}. The item_blockchain_id is the index of the item in the collection. E.g: if you have a collection with 2 items, the first is 0 and the second one is 1. Therefore, the id of the first item will be: {contract_address}-0

Ethereum addresses should be passed lowercased:

  • 0xB549B2442b2BD0a53795BC5cDcBFE0cAF7ACA9f8
  • 0xb549b2442b2bd0a53795bc5cdcbfe0caf7aca9f8

Get first 5 collections and items balances

{
  collections(first: 5) {
    id
    items {
      id
    }
    owner
    creator
  }

  items(first: 5) {
    id
    collection {
      id
    }
    blockchainId
    itemType
  }
}

Get Item Metadata

{
  items(first: 1) {
    id
    rawMetadata
    metadata {
      itemType
      wearable {
        description
        bodyShapes
        rarity
        category
      }
    }
  }
}

Get first 5 Collection NFTs

Owner's id is the owner's Ethereum address

{
  nfts(first: 5) {
    id
    tokenId
    owner {
      id
    }
  }
}

Get first 5 Collection NFTs Orders

{
  orders(first: 5) {
    id
    nftAddress
    price
    buyer
    status
    nft {
      id
    }
  }
}

Get totals

{
  counts {
    collectionTotal
    itemTotal
    nftTotal
    orderTotal
  }
}

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%