Posted by wiradikusuma:
Given this signature:
public Response queryWithVars(final String query, final Map<String, String> vars)
How do I pass multiple value (uids) with the same key?
Posted by wiradikusuma:
Given this signature:
public Response queryWithVars(final String query, final Map<String, String> vars)
How do I pass multiple value (uids) with the same key?
wiradikusuma commented :
Tried passing string “0xAAA,0XBBB” (comma-separated text) – doesn’t work
campoy commented :
Hey @mangalaman93, please have a look at this issue.
mangalaman93 commented :
I don’t think we support passing multiple values in a variable, I can’t find an example for this in Dgraph or dgo repo.
mangalaman93 commented :
MichelDiz commented :
BTW guys, a workaround for this would be something like
query q($name1:string = "Ridley Scott", $name2:string = "Steven Spielberg") {
me(func: eq(name@en, [$name1, $name2])) {
name@en
director.film @filter(lt(initial_release_date, "1980-01-01")) {
initial_release_date
name@en
}
}
}
You pass each value separately into variables. Hence use them as above.
Details of this support Support for Gql variable in arrays by srfrog · Pull Request #2981 · dgraph-io/dgraph · GitHub