Moved from GitHub ratel/219
Posted by danielmai:
A user reported this error when running Dgraph v1.0.14 with Ratel. When they send a query they get the following error. This happens on Ratel ?dev, ?latest, and ?local.
Error Name: t
Message: Expected some name. Got: lex.Item [1] "while lexing {\"query\":\"{\\n exampleQuery(func:has(userType), first:10){\\n \\tuid\\n \\tfirstName\\n \\tlastName\\n\\t}\\n}\",\"variables\":{}}: Unrecognized character in lexText: U+0022 '\"'"
Raw Error:
{
"name": "t",
"url": "http://localhost:8080/query?timeout=20s&debug=true",
"errors": [
{
"code": "ErrorInvalidRequest",
"message": "Expected some name. Got: lex.Item [1] \"while lexing {\\\"query\\\":\\\"{\\\\n exampleQuery(func:has(userType), first:10){\\\\n \\\\tuid\\\\n \\\\tfirstName\\\\n \\\\tlastName\\\\n\\\\t}\\\\n}\\\",\\\"variables\\\":{}}: Unrecognized character in lexText: U+0022 '\\\"'\""
}
]
}
Error
Dgraph v1.0.x and earlier does not support queries in the JSON format {"query": "...", "variables": "..."}
. This was introduced in the HTTP API in Dgraph v1.1.0 and later to pass GraphQL variables.
I couldn’t reproduce this. Any ideas? It seems like Ratel mis-detected the version of Dgraph here and tried using the new HTTP API in v1.1.0 and And the user said that ?local didn’t work either which is odd.