I am fairly new to DGraph, however I had quite some experience in other Graph databases like Neo4j.
While in Neo4j I can write queries like below to get a node based on related nodes at arbitrary depth, I couldn’t find a way to write similar kind of query in GraphQL or DQL.
MATCH (p)-[:Child*]->(q) WHERE q.name CONTAINS 'boss' RETURN p
I went through docs and various discussion threads, but couldn’t find one that can solve my use case.
It would be really helpful, if anyone can provide a solution or an approach to proceed.
I wonder if you could do this in reverse using expand? Just an idea/theory though. Can you use a expand edges as a var?
{
var(func: eq(name,"boss")) {
A as expand(_all_) {
B as expand(_all_) {
C as expand(_all_) #more depth as needed??
}
}
}
p(func: uid(A,B,C)) {
expand(_all_)
}
}