INNER CODE UNIT · Go

NewEnterpriseClient

shurcooL/githubv4 · githubv4.go:32

func NewEnterpriseClient(url string, httpClient *http.Client) *Client {
	return &Client{
		client: graphql.NewClient(url, httpClient),
	}
}

// Query executes a single GraphQL query request,
// with a query derived from q, populating the response into it.
// q should be a pointer to struct that corresponds to the GitHub GraphQL schema.
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 {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…