We’re fully exploring a node’s graph. Thus far, we’ve had reliable results - short of the count issue. We’re navigating to a node using a eq string match on an indexed predicate value and then following specific relationships (not all relationships) out of that node until the graph is fully explored. Is there a better practice to do this that’s more reliable than @recurse?
We need the count with the @filter to have the same filter as the filter we’re applying on the relationships – the query would be cleaner if this were at the top of it.
Outside of the count and @filter nothing really fancy going on… Being pretty new to DGraph, what would you consider fancy that we should stay away from?
@filter at the top of the query
For the @filter query at the top of the query… It looks like the queries we’re running are different. You’re doing an equals match on a dgraph.type, "Person" and I’m doing an equals match on name. I’d imagine that changes the starting point for the @recurse query. Could this be the difference why @filter doesn’t work at the root? – this is repeatable in the Dgraph Tours Graphs | Intro | Dgraph Tour
{
michael(func: eq(name, "Michael")) @recurse(depth:10) @filter(NOT eq(name, "Sarah")){
name
age
owns_pet
friend~
friend
count(friend)
}
}
vs.
{
q(func: eq(dgraph.type, "Person"), first:100 ) @recurse(depth:10)
@filter(NOT
( eq(name, "Alice")
or eq(name, "Bob")
or eq(name, "Charlie")
or eq(name, "Dave")
or eq(name, "Raj")
))
{
name
dgraph.type
age
owns_pet
friend~
friend
count(friend)
}
}
If you were to run this query, does your @filter still work?
{
q(func: eq(name, "Alice") ) @recurse(depth:10)
@filter(NOT
( eq(name, "Bob")
or eq(name, "Charlie")
or eq(name, "Dave")
or eq(name, "Raj")
))
{
name
dgraph.type
age
owns_pet
friend~
friend
count(friend)
}
}
As an aside, coming out of this conversation, is GitHub the means to report potential bugs and request documentation improvements for the team to take a look at and triage, or have ‘on file’ for others and later?
Thanks,
Ryan