Is it possible to make a recursive query, which stops at/avoids expanding a node, if count of edges/facets is greater than x? But keep the node itself.
The above query has the problem, that it exclude the node which has more than 10 connections. What I would like to achieve is to get the node it-self (with more than 10 connections), but not expand the connections.
You have mentioned in your title “Avoid recursive node expansion if facet/edge count is greater than” - So I thought you knew about how facets works and wanted to use it.
Instead of using recurse, in your case, you should have a fixed query.
node (func: eq(name, "A")) @cascade {
name
connections {
name
connections @filter(lt(count(connections), 3))
}
}
The problem with recurse is that you can’t control it. It works as a block template and it is replicated recursively. So, what you wanna do isn’t possible via recurse query.
I do know about facets - I simply reduced my example to a bare minimum, and was curios as to if the @facets would change the behaviour.
The problem with a fixed query in my case, is that I don’t know if the excessive amount of connections will happen at depth 1 or depth 5. And basically what I wanted to achieve was to make the recursive “cut” on the actual edges and not the node which is caught by the filter. But I understand it isn’t possible.