Dgraph: Pagination is not applied as the last step by default

Created on 27 Apr 2017  路  2Comments  路  Source: dgraph-io/dgraph

I have an issue with combining filtering, ordering and pagination. For a dataset where a person is connected to a number of events, where each event has a type and a timestamp I can do this:

{
  persons(id:person.1234) {
    person.event (first: 2) @filter(eq(event.type,"BIRTHDAY")) {
      event.title
    }
  } 
}

and get 2 results, but if I do this:

{
  persons(id:person.1234) {
    person.event (first: 2, orderdesc:event.timestamp) @filter(eq(event.type,"BIRTHDAY")) {
      event.title
    }
  } 
}

I receive 0 results. If I increase the first to 100, I get 2 results (which is all the dataset contains). It seems the filters, ordering and pagination are applied in the wrong order. What is the use case of pagination not being applied as the last step?

kinbug

Most helpful comment

Wow! 18 hours from report to merge? Impressive.

All 2 comments

Thanks, for finding the issue. The fix has been merged to master and would be part of the upcoming release.

Wow! 18 hours from report to merge? Impressive.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShawnMilo picture ShawnMilo  路  4Comments

KadoBOT picture KadoBOT  路  5Comments

djdoeslinux picture djdoeslinux  路  4Comments

marvin-hansen picture marvin-hansen  路  4Comments

captain-me0w picture captain-me0w  路  4Comments