INNER CODE UNIT · Go
NewClient
shurcooL/githubv4 · githubv4.go:20
func NewClient(httpClient *http.Client) *Client {
return &Client{
client: graphql.NewClient("https://api.github.com/graphql", httpClient),
}
}
// NewEnterpriseClient creates a new GitHub GraphQL API v4 client for the GitHub Enterprise
// instance with the specified GraphQL endpoint URL, using the provided http.Client.
// If httpClient is nil, then http.DefaultClient is used.
//
// Note that GitHub GraphQL API v4 requires authentication, so
// the provided http.Client is expected to take care of that.
func NewEnterpriseClient(url string, httpClient *http.Client) *Client {
return &Client{
client: graphql.NewClient(url, httpClient),
}
}