Queries for Assets

asset

Returns a single asset. It can be retrieved by either the id or the game slug, collection slug, and token id.

asset(id, ex_asset_id, game_slug, collection_slug) {
  /* Asset fields */
}

Arguments

collection_slug String

The slug of the collection to which the asset belongs. This must be used in conjunction with game_slug and ex_asset_id.

game_slug String

The slug of the game to which the asset belongs. This must be used in conjunction with collection_slug and ex_asset_id.

ex_asset_id String

The on-chain token id of the asset. This must be used in conjunction with game_slug and collection_slug.

id Int

The ID of the Asset to return.

Response

Asset.* AssetType

Any requested field from the AssetType object.

Example

Request

query {
  asset(id: 1001) {
    id
    ex_asset_id
    game {
      name
    }
    media {
      media_type_id
      url
    }
  }
}
query {
  asset(ex_asset_id: "10889035741470030830827987437816582766526", game_slug: "decentraland", collection_slug: "land") {
    id
    ex_asset_id
    game {
      name
    }
    media {
      media_type_id
      url
    }
  }
}

Response

{
  "data": {
    "asset": {
      "id": 1001,
      "ex_asset_id": "10889035741470030830827987437816582766526",
      "game": {
        "name": "Decentraland"
      },
      "media": {
        "media_type_id": 1,
        "url": "https://lh3.googleusercontent.com/5BVpydeMT2NkjuFYPZSrZSvgaor_9wCeWfJYvHd1156O0IvUqbz3P2l8laJrlLvoLxHcFFtkzZ8U7Nh-qQFFVgveE7lR-V_9odBqtg"
      }
    }
  }
}