In GraphQL, is there any way to alias the returned value using an input argument?
e.g. here:
query GetCurrencyRevenueAggregate(
$currency: String!
$startDate: timestamptz!
$endDate: timestamptz!
) {
DailyCurrencyRevenue_aggregate(
where: {
currency: { _eq: $currency }
dateTimestamp: { _gte: $startDate, _lt: $endDate }
}
) {
aggregate {
sum {
amountETH: amount # <--- see this
}
}
}
}
I would like to alias amountETH to amount_{$currency}
Is this possible in GraphQL?
amountparameter?amount(code: CURRENCY_CODE): Int?