octokit / octokit.js

The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
MIT License
7.02k stars 1.03k forks source link

Question : How to support X-GitHub-Api-Version #2359

Open filipvh opened 1 year ago

filipvh commented 1 year ago

I had some questions after the launch of the new versioning scheme: GitHub Blog - To infinity and beyond: enabling the future of GitHub’s REST API with API versioning

My main question is: how will this be supported by this library that I use?

I've been searching a bit, but have yet to find some relevant information. In the blogpost there might be one sentence about it, but not really helpful.

Any info, even pointing out there is none, would be helpful! Thanks!

wolfy1339 commented 1 year ago

Currently there isn't a way to define the API version per say.

If you want to use it, as it's it a header, you can add it to the options when you call the Octokit class.

Feel free to send a PR to add a proper option for this though

jonasfroeller commented 8 months ago

Does the GraphQL API have consistent versions? In other words, are they released simultaneously each time? Does this mean I can request it using the same version header: "X-GitHub-Api-Version": "2022-11-28"?

wolfy1339 commented 8 months ago

That header is only applicable to the REST endpoints. The GraphQL endpoint doesn't use it

gr2m commented 8 months ago

GraphQL has the ability to deprecate APIs built-in already