Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Graphql query does not honour first: when sorting #9239

Open
miko opened this issue Dec 10, 2024 · 0 comments
Open

[BUG]: Graphql query does not honour first: when sorting #9239

miko opened this issue Dec 10, 2024 · 0 comments
Labels
kind/bug Something is broken.

Comments

@miko
Copy link

miko commented Dec 10, 2024

What version of Dgraph are you using?

Dgraph version : v24.0.5
Dgraph codename : dgraph
Dgraph SHA-256 : 7139a5b0cf1faaf766e3ca9b6966f2893bbddf6a8261efebf4208dfb239b7a45
Commit SHA-1 : 27450c1
Commit timestamp : 2024-11-05 23:22:41 +0530
Branch : HEAD
Go version : go1.22.8
jemalloc enabled : true

Tell us a little more about your go-environment?

Not relevant

Have you tried reproducing the issue with the latest release?

Yes

What is the hardware spec (RAM, CPU, OS)?

Not relevant

What steps will reproduce the bug?

Create graphql schema with:
type User {
login: String!
}

Insert more than 1000 records (like 30000)
Execute graphql queries:

 Users1: queryUser(first:30000,order: { asc: login }) {
      login
  }
  Users2: queryUser(first:30000) {
      login
  }

Execute DQL queries:

query {
Users3(func:type(User),  first:30000) {
  login: User.login
}
Users4(func:type(User),orderasc:User.login, first:30000) {
  login: User.login
}
}  ```

### Expected behavior and actual result.

As mentioned at https://dgraph.io/docs/query-language/sorting/ "Sorted queries retrieve up to 1000 results by default. This can be changed with first." This works for DQL queries, but not for graphql queries - Users1 returns only 1000 records instead of expected 3000 records without a warning.
The 1000 items limit is not even mentioned for GraphQL API (as it should be): https://dgraph.io/docs/graphql/queries/order-page/

### Additional information

The issue was mentioned before:
https://discuss.dgraph.io/t/bug-dgraph-is-limiting-query-results-that-use-order-to-1000/16160
@miko miko added the kind/bug Something is broken. label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken.
Development

No branches or pull requests

1 participant