MCPcopy Create free account
hub / github.com/cli/cli / Mutate

Method Mutate

api/client.go:123–131  ·  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 any, variables map[string]any)

Source from the content-addressed store, hash-verified

121// 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,
122// GraphQLError will be returned, but the receiver will also be partially populated.
123func (c Client) Mutate(hostname, name string, mutation any, variables map[string]any) error {
124 opts := clientOptions(hostname, c.http.Transport)
125 opts.Headers[graphqlFeatures] = features
126 gqlClient, err := ghAPI.NewGraphQLClient(opts)
127 if err != nil {
128 return err
129 }
130 return handleResponse(gqlClient.Mutate(name, mutation, variables))
131}
132
133// 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,
134// 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