Is it possible to use uid_in
to filter results based on a node that is two edges away?
For instance, given three types, Map, Pin, and Route
- A Map can contain any number of Pins. pred:
map_has_pin
- A Route can contain any number of Pins. pred:
route_has_pin
- (There are no edges from Route to Map)
Can I create a query that finds all Routes that are in a map? (By seeing if any of that Route’s Pins are used in the Map in question)
Something like this:
{
routes(func: eq(type, "route"))
@filter(uid_in(route_has_pin.~map_has_pin, 0xaf11))
{
uid
title
}
}