MCPcopy Index your code
hub / github.com/cli/cli / Query

Method Query

api/client.go:81–89  ·  view source on GitHub ↗

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, GraphQLError will be returned, but the receiver will also be partially populated.

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

Source from the content-addressed store, hash-verified

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.
81func (c Client) Query(hostname, name string, query interface{}, variables map[string]interface{}) error {
82 opts := clientOptions(hostname, c.http.Transport)
83 opts.Headers[graphqlFeatures] = features
84 gqlClient, err := ghAPI.NewGraphQLClient(opts)
85 if err != nil {
86 return err
87 }
88 return handleResponse(gqlClient.Query(name, query, variables))
89}
90
91// QueryWithContext 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,
92// 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
QueryMethod · 0.65

Tested by

no test coverage detected