I’m trying to include the uid of a parent as a field on the children within my query. I’ve been trying to use variables, but I haven’t been able to get it to work. Here’s a sample of the query I’m trying to perform:
q(func: uid(${problem.uid})) {
problemID as uid
solution {
uid
text
problemID : val(problemID)
}
}
Variables won’t do it in this case. One way that I can think of is having a reverse edge on solution, then you could do
solution: uid @reverse .
q(func: uid(${problem.uid})) {
problemID as uid
solution {
uid
text
~solution {
uid
}
}
}
Though I think we could allow fetch uid variables and then the query @janardhan supported should work. Can you please file an issue so that we can look into supporting it?