嵌套数据的平均聚合

average aggregate on nested data

我想得到的是列表中所有产品的平均值ScoreOverall。我已经尝试添加一些关系,但我无法在嵌套级别上获得 aggregate“端点”。

数据模型:

List
|--ListProducts (linking table, one list to many products)
   |--ProductScore (joined view)
      |--ScoreWeighted (value I want the average across all products in this List)

有什么关于最好的方法的线索吗?

如果 Hasura 公开的内置 GQL 操作不允许您获得所需的一切,您最好的选择是使用自定义扩展架构 SQL function or view