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.

Getting Started

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.

Example Read-only Queries

Familiarize yourself with some of the most used queries by introducing the queries provided in the examples below.

Get all assets in a given universe

The following query returns the assetId, the owner's web3 address, the properties, and the creation time, of all assets in universeId = 0:

query {
    allAssets(condition: {universeId: 0}) {
        nodes {
            id
            ownerId
            props
            createdAt
        }
    }
}

Get all assets owned by a user, and their properties

The following query returns the assetId and the properties of all assets owned by a given owner.

query {
    allAssets(
        condition: { ownerId: "0x291081e5a1bF0b9dF6633e4868C88e1FA48900e7" }
    ) {
        nodes {
            id
            props
        }
    }
}

Get all assets and associated BuyNow trades

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:

query {
    allAssets(condition: { universeId: 0 }) {
        totalCount
        nodes {
            id
            buynowsByAssetId {
                nodes {
                id
                assetId
                currencyId
                price
                validUntil
                signature
                state
                sellerId
                buynowPaymentId
                txId
                universeId
                }
            }
        }
    }
}

Last updated

freeverse.io