Maybe the $ b field is wrong, or is passing some extra character. If this field is wrong the answer will be empty indeed. You have to make sure you are correctly passing the Var. btw this is a “GraphQL Variable”, It is not a Dgraph variable itself.
For test effect, try to see if searching $ b for dept_name, returns the correct department.
It would be interesting to be able to expand the variable within the query field. But at the moment I can not test, I’m just with Ratel to test things fast. And Ratel does not apparently accept Graphql Var.
Okay, Fill a issue on Github. As you tested with common characters (and not Chinese) already helped filter out a possible bug with characters. Sounds like a valid issue. Even so, I’ll do tests during this.
Yes Yes. This example has problems to play online. I forgot what I could do it locally. It’s just that you were using your own examples, which I do not have access to. Then my head did not stop to reproduce something close. But I can mount an instance by loading the RDF movielens and test this.
i have a query like this:
query withvar($a:string, $b:string) {
var(func:uid($a)) {
company_dept @filter(uid($b)){
~candidate_dept @groupby(age_node) {
a as count(uid)
}
}
}
query(func:uid(a)) {
uid
name
total:val(a)
}
}
,
if i don’t pass var $b, like it’s a empty string, and i want to let this filter: @filter(uid($b)) do not work in this query,
or what var should i pass to $b to let filter don’t work.
how to do this?