What I learned about GraphQL in one talk

GraphQL has been a buzzword for ages, and one that I’ve not had the time to really look into. Though, I’ve been at Codemotion Berlin this week 🎉, so when I saw Michelle Garrett’s talk ‘Build the API you want to see in the world (with GraphQL)’, it sounded like an opportunity to finally understand the hype.

Firstly, the thing that I’ve heard the most; is how GraphQL will eventually replace REST. Michelle started by talking about the differences between the two.

REST generally involves calls to different endpoints, like /movies /reviews or /actors then you have to figure out how to stitch these calls together to get the information you actually want. Makes sense, I’ve done this on a bunch of personal projects that use public APIs.

GraphQL on the other hand has one endpoint e.g. /graphql and all of your requests go to that endpoint. You also specify all the fields you want returned in your response and you will get exactly that. “No more, no less”, just what you ask for.

What GraphQL looks like to me from this talk, is a layer that sits between your API and your application, like some funky front-end middleware.

Image for post
Image for post
What the GraphQL setup looks like in my head

Interesting so far, but what are the real selling points? Why do people love it so much?

Okies, I think I’m sold. When is the right time for me to use it?

Image for post
Image for post
Slide from Michelle’s talk at Codemotion Berlin 2018

Overall, GraphQL seems really cool! The only thing I don’t know yet, is how easy it is to set up your GraphQL layer in the first place 🤔 That can be some homework for me, when I find a project to squeeze it in to! 😄

Thanks Michelle for the great talk!

Software engineer. She speaks and writes about career progression and front-end development. @tara_ojo

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store