Comment on page
Information queries
Information, read-only, queries are open to everyone. These queries do not require any signature. Examples of such queries include: inquiring about the assets of a given owner, retrieving the current properties of an NFT, etc.
One of the features of GraphQL is introspection, which easily allows to find out about the underlying schema, and get documentation about every single method available.
So, go ahead, visit a Living Assets test network endpoint, and click on the right-most tabs (
DOCS
, SCHEMA
) to learn about the entities that live in the platform, and the means to access them.Familiarize yourself with some of the most used queries by introducing the queries provided in the examples below.
The following query returns the assetId, the owner's web3 address, the properties, and the creation time, of all assets in
universeId = 0
:GraphQL
query {
allAssets(condition: {universeId: 0}) {
nodes {
id
ownerId
props
createdAt
}
}
}
The following query returns the assetId and the properties of all assets owned by a given owner.
GraphQL
query {
allAssets(
condition: { ownerId: "0x291081e5a1bF0b9dF6633e4868C88e1FA48900e7" }
) {
nodes {
id
props
}
}
}
The following query runs through all assets in
universeId = 0
, and returns number of assets found (totalCount
) as well as the main data associated to every trade that each of those assets has been involved in:GraphQL
query {
allAssets(condition: { universeId: 0 }) {
totalCount
nodes {
id
buynowsByAssetId {
nodes {
id
assetId
currencyId
price
validUntil
signature
state
sellerId
buynowPaymentId
txId
universeId
}
}
}
}
}
Last modified 4mo ago