This is probably a very nooby question, but imagine I have a bill, whose uid I know, and a bunch of billItem nodes (that include name and price) that point towards that bill through the edge “bill”. How can I search specifically for all those billItems whose “bill” edge points to that uid?
Here’s what I’ve tried:
{
search(func: uid(bill, 0xa)) {
uid
}
}
Error received:
Some variables are used but not defined Defined:[] Used:[bill]
Ok, so it thinks bill is a variable, understood!
Then I tried:
{
search(func: eq(bill, 0xa)) {
uid
}
}
And got error:
Attribute bill is not valid scalar type while running: name:"eq" args:"0xa"
Well yeah, I know it’s not a scalar type, it’s a uid!
Then I discovered uid_in! Surely this is the answer I’m looking for!
{
search(func: uid_in(bill, 0xa)) {
uid
}
}
But
uid_in function not allowed at root
Why not? So either I’m completely missing a really simple function, or I have to do it this way:
{
search(func: uid(0xa)) {
billItems {
uid
}
}
}
Which is fine, but is there no way to access those billItems directly based on the uid of their “bill” edge?