Comments (3)
Thank you, actually your answer already helped me solve my issue !
My mistake was using the foreign key from warehouses to company instead of warehouses table primary key in the filter, when trying to match my case to the solution that was suggested in graphile-contrib/postgraphile-plugin-connection-filter#152.
I used the query:
query MyQuery {
companies(
orderBy: WAREHOUSES_COUNT_DESC
filter: {warehouses: {aggregates: {distinctCount: {companyId: {greaterThan: "1"}}}}}
) {
nodes {
warehouses {
totalCount
}
}
}
}
Which returned an empty list (but worked as expected with greaterThan: "0"
, returning all totalCount
values > 0) instead of:
query MyQuery {
companies(
filter: {warehouses: {aggregates: {distinctCount: {id: {greaterThan: "1"}}}}}
) {
nodes {
warehouses {
totalCount
}
}
}
}
I'm closing the issue then, thanks for your help !
from pg-aggregates.
Please could you share the query that you attempted with distinctCount
- I'd expect a distinctCount over a unique column (such as the primary key) to give the result you're hoping for.
Further, please can you expand on "it worked only for greater than 0" - what were the other cases you tried and what happened in those cases - an error? incorrect results? Please share as much detail as you can.
A rough definition of the relevant tables/columns/constraints in your database would also be helpful.
from pg-aggregates.
Thanks for sharing 🙌
from pg-aggregates.
Related Issues (20)
- TIMESTAMP_TRUNCATED_TO_MONTH & TIMESTAMP_TRUNCATED_TO_YEAR HOT 23
- Cannot get the given example to work HOT 3
- Getting - Error: Option 'appendPlugins' should be an array of functions, found 'object' at index 0 HOT 3
- Looks like aggregate order bys get generated even when table is omitted HOT 1
- GroupBy computed columns not generated ? HOT 4
- Aggregates ignore ordering HOT 6
- Removing limitation of stringified `keys` HOT 3
- Order by totalCount with per-query custom filtering applied HOT 2
- Aggregates can return unsafe integers HOT 8
- pg-aggregates plugin doesn't work without postgraphile-plugin-connection-filter in V5 HOT 1
- Too few types are exported in V5 plugin HOT 1
- Aggregate keys should be nullable HOT 1
- This repository needs tests
- What's the best way to aggregate on duration? HOT 4
- Update docs around custom plugins for V5 HOT 5
- groupedAggregates should use their own behavior
- Supporting user-defined aggregate functions HOT 1
- Plugin prevents schema export HOT 1
- All attributes appear in aggregates, even if disabled by behaviors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg-aggregates.