INNER CODE UNIT · Go
func
shurcooL/githubv4 · githubv4.go:41
func (c *Client) Query(ctx context.Context, q interface{}, variables map[string]interface{}) error {
return c.client.Query(ctx, q, variables)
}
// Mutate executes a single GraphQL mutation request,
// with a mutation derived from m, populating the response into it.
// m should be a pointer to struct that corresponds to the GitHub GraphQL schema.
// Provided input will be set as a variable named "input".
func (c *Client) Mutate(ctx context.Context, m interface{}, input Input, variables map[string]interface{}) error {
if variables == nil {
variables = map[string]interface{}{"input": input}
} else {
variables["input"] = input
}
return c.client.Mutate(ctx, m, variables)
}