Assuming this mutation:
{
set{
_:a <name> "A" .
_:b <name> "B" .
_:c <name> "C" .
_:a <friend> _:b .
}
}
If you get empty response in qry_ac, it can be concluded that there is no edge between a and c.
{
a as var(func: eq(name, "A"))
c as var(func: eq(name, "C"))
b as var(func: eq(name, "B"))
#get a to b linl
qry_ab(func: uid(a)) @cascade{
uid
friend @filter(uid(b)){
uid
}
}
#get a to c link
qry_ac(func: uid(a)) @cascade{
uid
friend @filter(uid(c)){
uid
}
}
}
The response is as below.
{
"data": {
"qry_ab": [
{
"uid": "0x1",
"friend": [
{
"uid": "0x2"
}
]
}
],
"qry_ac": []
}
}