So before getting into the dirt and gritty of what “The Road to GraphQL” has to offer, I have to prepare some stuff on my system, and github for the sake of being able to follow along with the examples in this book. In this post I’m going to talk about my experience getting things set up, focusing mostly on the pitfalls I encountered and how anyone reading this in the future can overstep them.
So… the first exercise in the chapter requires you to create a github account if you don’t have on and to populate that new profile with information and Github repos. For me that’s easy enough, since I have a github I try (my best) to keep current. If you’d like to take a look at my github profile, click here.
So, now that I got that task (as well as the self plug) out of the way, lets talk about what the book says to do next, which is create a github personal access token. The book has a straight forward description on how to do this, along with a warning that you don’t share the contents of the token with third parties. Either way, I kept that window open for a few days because the page told me that once I closed it I wouldn’t be able to get back to it.
Next, the book, as of late 2019, provides directions on how to access your github data via api. First the book recommends that you just use Github’s GraphQL Explorer, but because that Explorer’s functionality has changed since this version of the book was published, it’s just best you totally forget about that option and install a GraphQL client to view queries and mutation. The one recommended in the book, and the one I’ve become familiar with through developing with Gatsby is GraphiQL.
This electron.js project page for GraphiQL provides directions regarding how to install it on both Macs and Linux machines.
After you get GraphiQL’s standalone app, follow the directions on page 24: add your token to the HTTP headers of that instance of your GraphiQL client, and point the client to the github GraphQL api endpoint at
https://api.github.com/graphql. Now you’re set! Why did I have to write all of these words?
Anyways, if you have comments, tweet me @BxBytesSteph