Skip to main content

Multiple Queries in a Request

info

If you want to be as efficient as possible, you can combine multiple queries into one request.

{
assets(order: {name: asc}, limit: 10) {
name
symbol
slug
}
metrics(where: {asset: null, provider: null, rewardOption: null, validator: null, metricKeys: ["marketcap"]}, limit: 1) {
defaultValue
changeAbsolutes
changePercentages
createdAt
}
}

This is a request with two queries:

  • The first query is for assets, and it fetches data for 10 assets sorted in ascending order by their names.
  • The second query is for global metrics.

The data returned by each query will be the response to this request.