Replies: 1 comment
-
Hey @LukasDeco Apologies for replying late. I read your use case and the SQL query you used for comparison. For this use case, it seems like you can leverage Hasura's Native Query feature. Assume you just copy that SQL and define it as Native Query. Set Logical Model for it, which will act as schema for GraphQL API essentially exposing the native query to your GraphQL API (schema). I am not aware if you have already tried Hasura's Native Query feature but please let me know in case. After this, native query would be automatically be part of your GraphQL API. This would unblock you atleast so you can move forward with your development. Let me know if you have questions regarding this approach. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I'm working on a GraphQL query that's not behaving as expected. I'm trying to aggregate data and order by the aggregate result. Here's an equivalent SQL query that works as intended:
I'm trying to achieve the same result with this GraphQL query:
With these variables:
The issue is that this GraphQL query isn't producing the same results as the SQL query. Specifically, I'm having trouble replicating the grouping and ordering by the sum of the numeric value.
How can I modify my GraphQL query to achieve the same result as the SQL query, including the grouping and ordering by the aggregate sum?
Any help or insights would be greatly appreciated. Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions