Given this (elided) SDL schema:
interface Person {
id: ID!
email: String! @id
}
type Worker implements Person {
abilities: [Ability] @hasInverse(field:worker)
}
type Ability {
id: ID!
worker: Worker!
knowledge: Knowledge
}
interface Knowledge {
id: ID!
}
This query correctly returns only Persons with the specified Knowledge:
{
q(func: has(Worker.abilities))@cascade {
uid
Worker.abilities @filter(uid_in(Ability.knowledge, 0x2e0))
}
}
However, when assigning (the uids of) that query to a var, all Workers are returned, not those restricted by the filter.
{
var(func: has(Worker.abilities))@cascade {
A AS uid
Worker.abilities @filter(uid_in(Ability.knowledge, 0x2e0))
}
results(func: uid(A)) {
uid
}
}
Any help appreciated.