MCPcopy
hub / github.com/cli/cli / Mutate

Method Mutate

api/client.go:69–77  ·  view source on GitHub ↗

Mutate performs a GraphQL mutation based on a struct and parses the response with the same struct as the receiver. If there are errors in the response, GraphQLError will be returned, but the receiver will also be partially populated.

(hostname, name string, mutation interface{}, variables map[string]interface{})

Source from the content-addressed store, hash-verified

67// Mutate performs a GraphQL mutation based on a struct and parses the response with the same struct as the receiver. If there are errors in the response,
68// GraphQLError will be returned, but the receiver will also be partially populated.
69func (c Client) Mutate(hostname, name string, mutation interface{}, variables map[string]interface{}) error {
70 opts := clientOptions(hostname, c.http.Transport)
71 opts.Headers[graphqlFeatures] = features
72 gqlClient, err := ghAPI.NewGraphQLClient(opts)
73 if err != nil {
74 return err
75 }
76 return handleResponse(gqlClient.Mutate(name, mutation, variables))
77}
78
79// Query performs a GraphQL query based on a struct and parses the response with the same struct as the receiver. If there are errors in the response,
80// GraphQLError will be returned, but the receiver will also be partially populated.

Callers

nothing calls this directly

Calls 3

clientOptionsFunction · 0.85
handleResponseFunction · 0.85
MutateMethod · 0.65

Tested by

no test coverage detected