-
Notifications
You must be signed in to change notification settings - Fork 90
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
Consider support for Schema Previews. #34
Comments
Since this library is largely generated, a viable possibility to consider is creating a separate package that includes support for the schema previews (doing this isn't as viable in go-github because that library is mostly written by hand). I just want to point that out, but whether or not it's a good idea to split off preview functionality into a different package (e.g., |
Hey @dmitshur! Are there any updates on this issue? |
There are no updates on this from my side yet, but there is some new demand for this feature (see #44). I won't have time to work on this in the short term. If you need this implemented, my recommendation is to experiment with finding a good solution in a fork. It will be helpful if you report your findings in this issue, so that it can eventually be upstreamed. Thank you! |
We encountered this issue while working on a PR / Fork for the Concourse github-pr-resource. Our internal GHE appliance is currently on 2.16 and we are experimenting with features that are behind the preview |
It is also required for https://developer.github.com/v4/mutation/deletepackageversion/ |
Any update on this? |
Hi, I see we have other issues/prs/forks to solve this issue but I'm curious if we had any progress on a official way to handle schema previews, I have no issues with any of the options but as the discussion has been going for a while I wanted to try to get any updates before working on something that feels like a "workaround". |
For future readers, I ended up doing this, which seems to be a functioning work-around: type headerInjector struct {
base http.RoundTripper
}
func (h *headerInjector) RoundTrip(req *http.Request) (*http.Response, error) {
req.Header.Add("Accept", "application/vnd.github.merge-info-preview+json")
return h.base.RoundTrip(req)
}
token := &TokenSource{
AccessToken: "My OAuth token",
}
...
oauthClient := oauth2.NewClient(context.Background(), token)
oauthClient.Transport = &headerInjector{
base: oauthClient.Transport,
}
ghQlClient := githubql.NewClient(
oauthClient,
) Parameterising the header injector on the previews you are interested in is left as an exercise to the reader 😄 |
Similar to GitHub REST API v3, GitHub GraphQL API v4 also has preview APIs that let users try out new features and changes before they become part of the official GitHub API:
https://developer.github.com/v4/previews/
One of the core focuses of this library is:
There are two relevant parts. One, we might want to support the preview APIs, since they're in a way a part of the API. Two, we want to try to do this in an automated way, rather than manually.
Finding a way to support these without in an automated way is very important, because otherwise, this could create a very significant amount of manual work (compared to the work required to develop and maintain the rest of this library).
The text was updated successfully, but these errors were encountered: