# Ratel sends incorrect query to Dgraph v1.0.x

**URL:** <https://discuss.dgraph.io/t/ratel-sends-incorrect-query-to-dgraph-v1-0-x/8060>\
**Category:** Ratel\
**Tags:** investigate, kind:bug, ratel\
**Created:** [June 24, 2020, 11:28pm UTC](https://discuss.dgraph.io/t/ratel-sends-incorrect-query-to-dgraph-v1-0-x/8060 "2020-06-24T23:28:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [June 24, 2020, 11:28pm UTC](https://discuss.dgraph.io/t/ratel-sends-incorrect-query-to-dgraph-v1-0-x/8060/1 "2020-06-24T23:28:24Z")

</div>

**Moved from GitHub [ratel/219](https://github.com/dgraph-io/ratel/issues/219)**

_Posted by_ [danielmai](https://github.com/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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [June 30, 2020, 3:11pm UTC](https://discuss.dgraph.io/t/ratel-sends-incorrect-query-to-dgraph-v1-0-x/8060/2 "2020-06-30T15:11:28Z")

</div>

[paulftw](https://github.com/paulftw) _commented_ :

Tried on play latest with Dgraph v1.0.14 and v1.0.16 and it worked both times.  
Even adding query variables through the new UI worked as expected.

@danielmai, can you please ask them to try sending that query from `https://play.dgraph.io/?latest`. ?  
And also ask them to provide the Ratel’s build TS and commit Id they are seeing in Ratel’s help?

What is the version of the server they are seeing in the Ratel network tab? Does it say `1.0.15-???` ?

![Screen Shot 2020-06-30 at 6 04 40 PM](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/2/206a902487de7911c1578af83fcf5cfe77939545.png)
