In theory it would be something like this, but it isn’t supported Multiple sorting via value variable.
{
Y as var(func:eq(name,"Some Repository C")) {
active_memberships (orderasc: roleLevel){
T as roleLevel
of_user {
GetName as name
}
GTNM as min(val(GetName))
}
}
q2(func: uid(Y)) {
name
members: active_memberships (orderasc: val(T), orderasc: val(GTNM)){
role
roleLevel
of_user {
uid
name
}
}
}
}
Result
{
"name": "t",
"url": "http://localhost:8080/query?timeout=20s",
"errors": [
{
"message": "line 17 column 60: Multiple sorting only allowed by predicates. Got: Stars",
"extensions": {
"code": "ErrorInvalidRequest"
}
}
]
}
My dataset
{
"set": [
{
"name": "Some Repository C",
"dgraph.type": "Repository",
"active_memberships": [
{
"role": "Admin",
"roleLevel": "1",
"dgraph.type": "Membership",
"of_user": {
"name": "A",
"dgraph.type": "User"
}
},
{
"role": "Admin",
"roleLevel": "1",
"dgraph.type": "Membership",
"of_user": {
"name": "B",
"dgraph.type": "User"
}
},
{
"role": "Admin",
"roleLevel": "1",
"dgraph.type": "Membership",
"of_user": {
"name": "C",
"dgraph.type": "User"
}
},
{
"role": "Admin",
"roleLevel": "1",
"dgraph.type": "Membership",
"of_user": {
"name": "M",
"dgraph.type": "User"
}
},
{
"role": "Viewer",
"roleLevel": "3",
"dgraph.type": "Membership",
"of_user": {
"name": "A",
"dgraph.type": "User"
}
},{
"role": "Viewer",
"roleLevel": "3",
"dgraph.type": "Membership",
"of_user": {
"name": "B",
"dgraph.type": "User"
}
},{
"role": "Viewer",
"roleLevel": "3",
"dgraph.type": "Membership",
"of_user": {
"name": "C",
"dgraph.type": "User"
}
},{
"role": "Viewer",
"roleLevel": "3",
"dgraph.type": "Membership",
"of_user": {
"name": "J",
"dgraph.type": "User"
}
},
{
"role": "Editor",
"roleLevel": "2",
"dgraph.type": "Membership",
"of_user": {
"name": "A",
"dgraph.type": "User"
}
},
{
"role": "Editor",
"roleLevel": "2",
"dgraph.type": "Membership",
"of_user": {
"name": "B",
"dgraph.type": "User"
}
},
{
"role": "Editor",
"roleLevel": "2",
"dgraph.type": "Membership",
"of_user": {
"name": "C",
"dgraph.type": "User"
}
},
{
"role": "Editor",
"roleLevel": "2",
"dgraph.type": "Membership",
"of_user": {
"name": "Z",
"dgraph.type": "User"
}
}
]
}
]
}
BTW, if you need help and want fast answers. Please, next time try to make the same sample I did above based on your request. And examples of desire results. Cuz it is hard to get in the loop of your request. We have to go through several questions here and there and also cover other things. To be short - Help us to help you
Happy holidays.
Cheers.