Lets say we have the following schema:
type Cart {
id: ID!
name: String! @search(by: [exact, regexp, term])
items: [Item] @hasInverse(field: inCarts)
}
type Item {
id: ID!
name: String! @search(by: [exact, regexp, term])
inCarts: [Cart]
}
Is it possible, within one query, to filter items by Item.name, resulting in A and then returning all carts where Cart.item contains A.
E.g.:
query {
var(func: type(Item)) @filter(some_filter) {
filteredItems as uid
}
carts(func: type(Cart)) @filter(has_to_contain(filtereditems)) {
uid
}
}
Cheers!