Skip to content

Commit f73241e

Browse files
committed
added readme
1 parent b5b2e52 commit f73241e

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
11
# graphql
2-
Low-level GraphQL client for Go
2+
3+
Low-level GraphQL client for Go.
4+
5+
* Simple, familiar API
6+
* Build and execute any kind of GraphQL request
7+
8+
```go
9+
ctx := context.Background()
10+
ctx = graphql.NewContext(ctx, "https://machinebox.io/graphql")
11+
r := graphql.NewRequest(`
12+
query ($key: String!) {
13+
items (id:$key) {
14+
field1
15+
field2
16+
field3
17+
}
18+
}
19+
`)
20+
r.Var("key", "value")
21+
var res ResponseStruct
22+
if err := r.Run(ctx, &resp); err != nil {
23+
log.Fatalln(err)
24+
}
25+
```

0 commit comments

Comments
 (0)