For anyone else looking for a solution, here’s the final query:
var(func: uid([USER UID])) {
validNs as HasAccessToNamespace
filteredNs as FiltersOutNamespace
}
filteredResults as var(func: eq(VertexType, "Entity")) @cascade {
uid: _uid_
Namespace @filter(not uid(filteredNs) and uid(validNs))
}
finalResults(func: uid(filteredResults)) {
...
# All that you want to retrieve here.
}