[BUGFIX] getQuery should respect orderBy