pg_graphql icon indicating copy to clipboard operation
pg_graphql copied to clipboard

Support for `aggregate` operations under child tables e.g. `count`

Open bossjapzz opened this issue 3 years ago • 4 comments

Describe the bug Support for aggregate operations under child tables

Expected behavior

query MyQuery {
  GroupContent_connection(order_by: {GroupContentReactions_aggregate: {count: desc}}) {
    edges {
      node {
        id
        GroupContentReactions_aggregate {
          aggregate {
            count
          }
        }
      }
    }
  }
}

Output

{
  "data": {
    "GroupContent_connection": {
      "edges": [
        {
          "node": {
            "id": "WzEsICJwdWJsaWMiLCAiR3JvdXBDb250ZW50IiwgImNrdHpld24zaTAxNjUwMTNkeHBuZjUzcTQiLCAiY2t1MDExZ2h5NzE4MDAxOHl0cHFhZmF6ZCJd",
            "GroupContentReactions_aggregate": {
              "aggregate": {
                "count": 8
              }
            }
          }
        },
      ]
    }
  }
}    

bossjapzz avatar Feb 21 '22 12:02 bossjapzz

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Mar 24 '22 02:03 github-actions[bot]

This would be huge, as it is a needed feature.

J

jdgamble555 avatar Sep 27 '22 22:09 jdgamble555

is there any roadmap on this issue

mojerro avatar Feb 05 '23 09:02 mojerro

The conversation about this feature hasn't happened internally yet but I expect it'll happen with an opt-out option for people concerned about performance.

User defined functions and any spec inconsistencies will be resolved before this gets tackled. Its not on the schedule yet but probably in the next few months

olirice avatar Feb 07 '23 14:02 olirice