[BUG] Dgraph is limiting query results that use "order" to 1000

Using Dgraph:

Dgraph version   : v21.03.1
Dgraph codename  : rocket-1
Dgraph SHA-256   : a00b73d583a720aa787171e43b4cb4dbbf75b38e522f66c9943ab2f0263007fe
Commit SHA-1     : ea1cb5f35
Commit timestamp : 2021-06-17 20:38:11 +0530
Branch           : HEAD
Go version       : go1.16.2
jemalloc enabled : true

Seems like that iwhen you have more than 1000 entries of a type in your database, order limits the returned list to 1000 entries.

Example 1: returns exactly 1000 Foos

query {
  queryFoo(order: {asc: id}) {
    id
  }
}

Example 2: Returns actual amount of Foos

query {
  queryFoo {
    id
  }
}
1 Like

Looks like it is a… feature not a bug :grimacing:

2 Likes

lol, okay…
So I have to do always two queries. One aggregateFoo {count } query, followed by my actual query. I must admit, that I don’t like this at all.

Maybe this “feature” should be documented? @MichelDiz

It’s not really a feature, it’s a brake for the user not to abuse the Cluster too much, unthinkingly. But yes, it should have a mention in the Docs. If you are willing to add a PR feel free to send me the link and I’ll accept it.

1 Like