Staking Data
Queries

Filter Query Results

Learn how to filter query results using where clauses.

Filter Query Results

This is an example that utilizes a filter to retrieve assets based on specific conditions.

Example Query

{
  assets(where: {symbols: ["ETH"]}, limit: 1) {
    id
    name
    slug
    symbol
    metrics(where: {metricKeys: ["price", "staking_marketcap"]}, limit: 2) {
      metricKey
      unit
      defaultValue
      changePercentages
    }
  }
}

Explanation

The filter specifies the symbol of the asset to be "ETH" and limits the number of results to 1. The query also filters the metrics being retrieved by specifying the metric keys and limiting the number of metrics to 2.

On this page