# So what am I doing wrong?

**URL:** <https://discuss.dgraph.io/t/so-what-am-i-doing-wrong/14896>\
**Category:** App Development\
**Tags:** kind:question, dgraph\
**Created:** [July 9, 2021, 3:11pm UTC](https://discuss.dgraph.io/t/so-what-am-i-doing-wrong/14896 "2021-07-09T15:11:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NinekoTheCat](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ninekothecat/32/8554_2.png) [@NinekoTheCat](https://discuss.dgraph.io/u/NinekoTheCat)\
**Post date:** [July 9, 2021, 3:11pm UTC](https://discuss.dgraph.io/t/so-what-am-i-doing-wrong/14896/1 "2021-07-09T15:11:50Z")

</div>

```javascript
var query =
        `{
            getPost( orderdesc: likes , first: 1 , offset: 0 , func: type( post ) ){
                        name
                        contents
                        createdby{
                            name
                        }
            }
            }`
        ;
    var res = await fetch( "http://{insertiphere}:8080/graphql?query=" + query + '&operation=getpost&variables={}' )
    res = await res.json()
    console.dir( res );

```

```javascript
output:
'Expected Name, found ('

```

---

<div class="post-metadata">

**Author:** ![iluminae](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/iluminae/32/7367_2.png) [@iluminae](https://discuss.dgraph.io/u/iluminae)\
**Post date:** [July 9, 2021, 3:31pm UTC](https://discuss.dgraph.io/t/so-what-am-i-doing-wrong/14896/2 "2021-07-09T15:31:46Z")

</div>

what you have there is dql right? You are sending it to /graphql. Try using /query instead.

---

<div class="post-metadata">

**Author:** ![NinekoTheCat](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ninekothecat/32/8554_2.png) [@NinekoTheCat](https://discuss.dgraph.io/u/NinekoTheCat)\
**Post date:** [July 9, 2021, 3:34pm UTC](https://discuss.dgraph.io/t/so-what-am-i-doing-wrong/14896/3 "2021-07-09T15:34:34Z")

</div>

```json
 { errors: [{ message: 'Invalid method', extensions: [Object] } ] }
```

---

<div class="post-metadata">

**Author:** ![NinekoTheCat](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/ninekothecat/32/8554_2.png) [@NinekoTheCat](https://discuss.dgraph.io/u/NinekoTheCat)\
**Post date:** [July 9, 2021, 3:39pm UTC](https://discuss.dgraph.io/t/so-what-am-i-doing-wrong/14896/4 "2021-07-09T15:39:06Z")

</div>

I had to do fetch with parameters, thank you!
