Hi, there! I’ve wanted to test DGraph for years and finally found a good use case. I’m still prototyping the relationships I need to build, so I’ll try to be as brief as possible
What I want to do
I need to recursively find a node, which may be up to n
levels of depth.
The type is basically:
type SomeType {
value: string
next: SomeType
}
Let’s say I have the following graph: A->B->C->D->E->F
. An example would be listing all nodes from B
to E
(resulting in B->C->D->E
), without actually knowing the depth.
What I did
Following the recurse query I’ve tried the snippet below, but the filter doesn’t apply recursively.
{
query(func: eq(value, "C")) @recurse(loop: false) {
value
next @filter(eq(value, "E"))
}
}
So, is it possible to traverse the graph recursively until the filter condition is met?