question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Support aggregate(count, max, min...) in where clause

See original GitHub issue

Currently, there’s no support for aggregate fields in where and order_by clause, which means it’s impossible to do filtering on aggregation.

Suggestion: Support aggregated fields on where and order_by clause when we query from a table_aggregate.

Example:

query {
users_aggregate {
aggregate(where: {count: {_gt: 0} }) 
  { 
    count 
  }
}
}

or

query {
users_aggregate(where: {aggregate {count: {_gt: 0} }})  {
aggregate
  { 
    count 
  }
}
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:131
  • Comments:45 (8 by maintainers)

github_iconTop GitHub Comments

14reactions
sasselacommented, Aug 25, 2022

hey folks, thanks for your interest and patience with this! The team’s actively working on this feature and a demo of WIP will be available in August’s community call recording.

11reactions
groksrccommented, Jul 14, 2020

+1 here

I need this feature please.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL MIN and MAX Functions Explained in 6 Examples
Like MIN() , MAX() is an aggregate function that returns a numeric value from a set. The difference is that it returns the...
Read more >
Aggregate function in SQL WHERE-Clause - Stack Overflow
firstname , ( SELECT MIN( o.amount ) FROM orders o WHERE a.customerid = o.customerid AND COUNT( a.customerid ) > ...
Read more >
SQL Server MAX() aggregate function
SQL MAX() aggregate function is used to return the maximum value from the provided numerical expression or the highest value in the collating ......
Read more >
Aggregation, grouping, and summarizing (Concepts) - Prisma
Use Prisma Client to aggregate, group by, count, and select distinct. ... having filters entire groups and supports filtering on an aggregate field...
Read more >
Aggregate Functions | SOQL and SOSL Reference
Use aggregate functions in a GROUP BY clause in SOQL queries to generate reports for analysis. Aggregate functions include AVG() , COUNT() ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found