-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add graphql path when creating client #863
Add graphql path when creating client #863
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this.
I don't have access to a GitHub enterprise so my knowledge is purely theorical
Could I ask you to use the standard url library to do a clean url join
https://pkg.go.dev/net/url@go1.19beta1#JoinPath
something like
graphqlURL , err := url.JoinPath(s.URL, "/api/graphql")
if err != nil {
return nil, err
}
g.client = githubv4.NewEnterpriseClient(graphqlURL, httpClient)
Done :D |
Thanks for fixing this part, if all tests are green, I can cut a release |
Co-authored-by: Hervé Le Meur <91831478+lemeurherve@users.noreply.github.com>
Fix 862
After investigating for a while, I found that the problem is that shurcooL/githubv4 expects a graphql url.
Just adding the graphql path to the URL parameter doesn't work (as that same url is used to pull the repo), but just by appending /api/graphql to the s.URL when initiating the client, fixes it.
Based on official documentation, the enterprise url for GraphQL is
https://<HOST>/api/graphql
.Additional Information
Tradeoff
Potential improvement
Tests are missing for all the custom URLs.