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.

Hi @MichelDiz Just wondering if you’ve scheduled the time in for a developer to look into this. It is causing a prod bug for us and it would be great if someone could investigate, or provide me with an expected time.

Thanks

Would be possible to share a sample of your data and the exact/similar query? So we can reproduce and tell what is happening.

Cheers.

It’s ok, we just upgraded to v21.03.1 (from v21.03.0) and it is now working

2 Likes