Ordered queries

In this section, you'll see how to order queries:

You can try this directly in our alphanet indexer's playground or our mainnet indexer's playground

Each field generates a sort option that you can apply on any request. For example:

Query NFTs ordered by creation timestamp

query {
  nftEntities(
    first: 10
    offset: 0
    orderBy: TIMESTAMP_CREATE_DESC
  ) {
    totalCount
    nodes {
      nftId
      owner
      collectionId
      offchainData
      timestampCreate
    }
  }
}

You can put as many sort fields as you need:

Query NFTs ordered by creation timestamp and price

query {
  nftEntities(
    first: 10
    offset: 0
    orderBy: [TIMESTAMP_CREATE_DESC, PRICE_ASC]
  ) {
    totalCount
    nodes {
      nftId
      owner
      price
      priceRounded
      timestampCreate
    }
  }
}

Last updated