Sorting with @cascade returns empty results

A paginated query with order and @cascade returns no results even though there are no nulls

I have simple query that I can run with pagination, filtering, sorting and @cascade, which returns data when order is not specified. When I run I run the same query with order it returns no results. Note that I do not have any null values

What I did

This query (with order commented out), works. When order is not commented out, it returns empty data

query {
  slides: queryClinicalStudy(
    offset: 0
    first: 10
    filter: { hasStudyName: { gt: "" } }
    # order: { asc: hasStudyName }
  ) @cascade {
    hasStudyName
  }
}

Here is a truncated schema

interface Process {
   # Nothing interesting here
}
type ClinicalStudy implements Process {
   hasStudyName: String @search(by: [exact]) @dgraph(pred: "ClinicalStudy.hasStudyName")
}

Removing the @cascde works, but I don’t understand why, since we have no null values. We are using @cascade for more complicated queries and filtering. For simplicity, I have not shown it in this query

Dgraph metadata

dgraph version

v21.03.0

I should also note that we do have empty strings in hasStudyName, which may affect this.

For clarity, the empty strings are “” and not null

@MichelDiz, thanks for tagging this. Is this something you are looking in to? Thanks

Hi, nope, I’ve just accepted it so an engineer can take a look.

Cheers.