# Define Types
type Person {
name
age
friend
owns_pet
}
type Animal {
name
}
# Define Directives and index
name: string @index(term) @lang .
age: int @index(int) .
friend: [uid] @count .
owns_pet: [uid] .
I want to check whether there is a edge ‘friend’ between A and c
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
}
}
}