hasura / hasura/graphql-engine
[REQUEST] Limit the number of rows in the "where" statement.
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
I have a table of users, a table of transactions, and a table of ralations.
Each user can follow others.
I want to query the db and return the transactions of the people that user A (with the $id) is following.
```graphql
query Myquery ($id: String!) {
transactions(limit: 20, order_by: {createdAt: desc}, where: {sender: {followers: {followerId: {_eq: $id}}}}) {
id
}
}
```
This query means: Return the transactions where the transaction's sender has a follower with an id equal to the id of User A
The issue is that if user A is following thousands of users, the query will retrieve all the transactions of the thousands of users, then sort them, and return 20.
I want to limit the number of the "followers" in the where statement. How that will be possible?
Contributor guide
Assessment
This issue has not been assessed yet.