-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QueryWithVars doesn't receive int variable in @recurse() #3301
Comments
I checked the code and variables inside recurse have never been supported. Most likely an oversight but since this is not breaking existing features I have tagged it as a feature. |
hey guys, appreciate the hard work. Any updates on this issue. This breaks with the same error using the python version as well
|
It's messy, but you can use string interpolation as a workaround for now. |
@campoy Any updates on this issue? @stevenayers It will be helpful if you share an example. Thanks. |
depth := strconv.Itoa(5)
variables := map[string]string{"$id": Id}
q := `query withvar($url: string, $depth: int){
result(func: eq(id, $id)) @recurse(depth: ` + depth + `, loop: false){
uid
links
}
}`
resp, err := txn.QueryWithVars(*ctx, q, variables) |
I would have raised this in dgo, but it looks like it could be more to do with the parser. I saw that even though you have to pass a
map[string]string
intoQueryWithVars
, if you specify it as an int inwithvar()
, it should be able to take it.Code ref: https://github.com/dgraph-io/dgraph/blob/master/gql/parser.go#L303
What version of Dgraph are you using?
1.0.14
Have you tried reproducing the issue with latest release?
yes
What is the hardware spec (RAM, OS)?
rd5.large
Steps to reproduce the issue (command/config used to run Dgraph).
You can only pass a string map as the variables map.
Error:
Expected value inside @recurse() for key: depth
The text was updated successfully, but these errors were encountered: