Skip to content

Commit 016da22

Browse files
spiffcslorensr
authored andcommitted
Update POST request to use valid JSON (#7)
1 parent a036007 commit 016da22

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

text/1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ We have a couple options if we want to run this query and get the data back from
229229

230230
```sh
231231
$ curl -X POST -H "Content-Type:application/json" \
232-
> -d '{user(id: "123"){_id, username}}' \
232+
> -d '{"query": "{user(id: \"123\"){_id username}}"}' \`
233233
> http://localhost:3000/graphql
234234
{"data":{"user":{"_id":"123","username":"jeresig"}}}
235235
```
@@ -240,7 +240,7 @@ What happens when we attempt to query for a user that doesn’t exist? Does it r
240240

241241
```sh
242242
$ curl -X POST -H "Content-Type:application/json" \
243-
> -d '{user(id: "abc"){_id, username}}' \
243+
> -d '{"query": "{user(id: \"123\"){_id username}}"}' \
244244
> http://localhost:3000/graphql
245245
{"data":{"user":null}}
246246
```

0 commit comments

Comments
 (0)