more wiring for configurable context/client, theoretically should be good enough for khan use

This commit is contained in:
Ben Kraft
2021-03-22 19:17:06 -07:00
parent 59ca841a6b
commit dd85597577
18 changed files with 186 additions and 53 deletions
+11 -3
View File
@@ -14,18 +14,26 @@ type SimpleInputQueryUser struct {
Id string `json:"id"`
}
func SimpleInputQuery(client *graphql.Client, name string) (*SimpleInputQueryResponse, error) {
func SimpleInputQuery(
client *graphql.Client,
name string,
) (*SimpleInputQueryResponse, error) {
variables := map[string]interface{}{
"name": name,
}
var retval SimpleInputQueryResponse
err := client.MakeRequest(nil, `
err := client.MakeRequest(
nil,
`
query SimpleInputQuery ($name: String!) {
user(query: {name:$name}) {
id
}
}
`, &retval, variables)
`,
&retval,
variables,
)
return &retval, err
}