0

I'm trying to sort out how to make a call to Github's API to get a hold of my pinned repos but I can't seem to find anything from Github's documentation using a REST call.

I did find this which uses graphql and does what I want but I'm not looking to spin up another server for this project.

so far I'm using https://api.github.com/users/USERNAME/repos. Has a good amount of what I want but nothing for pinned repos.

anyone know?

Rob Cha
  • 139
  • 12
  • I'm not entirely sure, but it's possible GitHub built this feature entirely with the GraphQL API and no REST endpoints exist. Note that [v4](https://developer.github.com/v4/) of the GitHub API is entirely in GraphQL and not REST. Any reason you don't want to use GraphQL? You shouldn't need another server. GraphQL API calls are normal HTTP requests. – Wilhelm Klopp May 28 '17 at 16:43
  • I'm not opposed to Graphql at all. in fact, I was initially using it. The problem is, everything I looked up on how exactly to use Graphql mentioned servers. – Rob Cha May 29 '17 at 19:01
  • Ok cool! You only need a server if you're looking to run your own GraphQL API. Just consuming the GitHub GraphQL API won't require any severs :) Check out the v4 link above for details on how to get started – Wilhelm Klopp May 29 '17 at 19:16

1 Answers1

0

As @Wilhelm said, you do not need your own servers to make a GraphQL call.
Have a look here to get started.

Briefly,

  • https://api.github.com/graphql POST request
  • Authorization: bearer <token> header
  • { "query": "query MyQueryToGithub { ... }" } JSON payload
yachaka
  • 5,429
  • 1
  • 23
  • 35
  • 1
    One issue with this is that there's no anonymous access to GraphQL. So if, for example, you wanted to dynamically include a list of your pinned repos via JS in a public web page, this is problematic and you'd either expose your creds publicly, or need a server to make the call. – Jason Antman Sep 10 '17 at 13:07