subql icon indicating copy to clipboard operation
subql copied to clipboard

orderBy with SUM return a wrong order if the type is BigInt.

Open HuberTRoy opened this issue 8 months ago • 1 comments

https://explorer.subquery.network/subquery/subquery/subquery-mainnet

{
  projects(orderBy: DEPLOYMENT_BOOSTER_SUMMARIES_SUM_TOTAL_AMOUNT_DESC) {
    nodes {
      id
      deploymentBoosterSummaries {
        aggregates {
          sum {
            totalAmount
          }
        }
      }
    }
  }
}

It compare with string rule:

'800' > '7000'

The type of totalAmount is BitInt in schema.

HuberTRoy avatar Apr 14 '25 03:04 HuberTRoy

This is a known bug without a concrete solution. https://github.com/subquery/subql/pull/2703

stwiname avatar Apr 14 '25 03:04 stwiname