We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1128f7 commit 459bffaCopy full SHA for 459bffa
README.md
@@ -10,8 +10,7 @@ Low-level GraphQL client for Go.
10
* Simple error handling
11
12
```go
13
-ctx := context.Background()
14
-ctx := graphql.NewContext(ctx, "https://machinebox.io/graphql")
+// make a request
15
req := graphql.NewRequest(`
16
query ($key: String!) {
17
items (id:$key) {
@@ -21,7 +20,15 @@ req := graphql.NewRequest(`
21
20
}
22
23
`)
+
24
+// set any variables
25
req.Var("key", "value")
26
27
+// get a context
28
+ctx := context.Background()
29
+ctx := graphql.NewContext(ctx, "https://machinebox.io/graphql")
30
31
+// run it and capture the response
32
var respData ResponseStruct
33
if err := req.Run(ctx, &respData); err != nil {
34
log.Fatalln(err)
0 commit comments