Hi, hi, @broccolihighkicks
You pose some very interesting questions, most of which, don’t have an actually interesting answer, unfortunately. Though, if I did have those answers, one might wonder if I actually posses a functional crystal ball… =)
Which API should I use?
This is not easy to say. As I write this, there is not feature parity between REST and GraphQL for GitHub. Each offer unique functionality not present in the other and without going into details of your use case, would be hard pressed to suggest one over the other.
If you have an immediate need, and you are more comfortable with REST, then there’s no real reason I would suggest GraphQL over REST.
If you are looking to expand beyond REST, and learn something new, I would definitely recommend using GraphQL. It’s far more flexible, and powerful, than REST alone.
But then we get back to that whole parity thing. It is true that each offering, has some endpoints/functionality, that the other doesn’t.
Onto the next Q:
Will new features data endpoints be added to the v3 JSON API over time to keep up with the GQL data?
Yes! Our v3 REST API will continue to be iterated on over time. In fact, there is far more that you can do right now with REST, that you cannot do with GraphQL.
And the next:
What is the difference between the two? Is all the GQL data available over REST?
As I’ve mentioned already, there is not 1:1 feature parity between the two, but it is a goal! I think for the “what are the differences,” we have this document:
…which I think provides helpful context to that question.
Please let us know if there’s anything remaining, there.
Will my code still work in around 5 years, or is there a plan to deprecate the v3 API?
Ah, back to that crystal ball…
As far as I’m aware, there are no official plans to deprecate our REST API. This is of course, subject to change, and I highly recommend you follow our (rather new!) public roadmap:
…for updates. Something so substantial as deprecating our REST API would definitely be a big deal, and something we would overly communicate on.
I truly hope my response is helpful, but I know there’s some hypotheticals and some unknowns that you’re hoping to have solidified. Unfortunately, it’s really difficult to speak about that kind of thing in a public space =(
So please let us know if you had any more specific questions about either REST or GraphQL that we could field