Generate a Bitquery GraphQL metric snippet with conditional logic using the 'if:' attribute. This tool builds metric aggregation snippets (count, sum, avg, min, max) that can be embedded in Bitquery GraphQL queries. The 'if:' filter allows applying conditions directly to metric…
ifRequiredobjectConditional filter to apply to the metric via the 'if:' attribute. Uses nested object structure matching Bitquery GraphQL filter syntax. Example: {'Block': {'GasUsed': {'gt': '0'}}} or {'Transaction': {'Success': true}}.
aliasstringGraphQL alias to prefix the metric output. Example: 'totalGas' produces 'totalGas: sum(...)'.
fieldRequiredstringThe field to aggregate using 'of:' in GraphQL. Required for 'sum', 'avg', 'min', 'max' operations. For 'count' operation, this field is ignored unless using distinct_field. Example: 'Block_GasUsed', 'Transaction_Value'.
operationRequiredstringType of metric operation to apply. Options: 'count' (count rows), 'sum' (sum values), 'avg' (average), 'min' (minimum), 'max' (maximum).
select_whereobjectHAVING-style filter applied after aggregation via 'selectWhere:'. Useful for filtering aggregated results. Example: {'ge': '1000000'} to only include results >= 1000000.
distinct_fieldstringField name for counting distinct values (only valid for 'count' operation). When provided, generates 'distinct: <field>' in the output. Example: 'Block_Number' to count distinct blocks.
dataRequiredData from the action execution
errorstringError if any occurred during the execution of the action
successfulRequiredbooleanWhether or not the action execution was successful or not
API key connection. Risk level 2 of 5.
Free Action
No published Skills explicitly reference this Action yet.