query followers($id: string, $offset: int, $first: int) {
me as var(func: eq(name, $id))
var(func: uid(me)) {
MF as follows {
FF as follows @filter(not uid_in(~follows, uid(me))) {
followers as ~follows @filter(uid(MF))
fwCount as count(~follows @filter(uid(MF))) # here why cant call count(followers) / count(val(followers)), how does this effect perf?
}
}
}
recommendation(func: uid(FF), orderasc: val(fwCount), offset: $offset, first: $first) {
name
score: val(fwCount)
followedBy: ~follows @filter(uid(followers)) {
name
}
}
}
Is there anyway to access predicate defined as variable in sibling property?
Also is there any better way to write this query? Which just finds my followings of followings and scores them by counting how many of my followings are following them.