Skip to content

Commit

Permalink
docs(example): fix usage example of client.Raw() (#5)
Browse files Browse the repository at this point in the history
* docs(example): fix usage example of client.Raw()

* docs(readme): improve raw example output
  • Loading branch information
RafaelKr authored and steebchen committed Jun 5, 2019
1 parent da2e3f8 commit a8c796b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ func main() {
If you don't want to use structs, you use `Raw()` to use maps for both input (variables) and output (response data).

```go
client := gqlclient.New("https://metaphysics-production.artsy.net")

resp, err := client.Send(&data, query, map[string]interface{}{
ID: "55bfed9275de7b060098b9bc",
resp, err := client.Raw(query, map[string]interface{}{
"id": "55bfed9275de7b060098b9bc",
})

if err != nil {
Expand All @@ -101,9 +99,9 @@ if err != nil {
log.Printf("data: %+v", resp.Data)
// Output:
// data: map[
// article:map[
// id:55bfed9275de7b060098b9bc
// title:How the 1960s’ Most Iconic Artists Made Art Contemporary
// article: map[
// id: 55bfed9275de7b060098b9bc
// title: How the 1960s’ Most Iconic Artists Made Art Contemporary
// ]
// ]
```
Expand Down

0 comments on commit a8c796b

Please sign in to comment.