Why UI Developers Love GraphQL

SITE NAME
2016-11-23T22:20:00+00:00

This is the first part in a multi-part series of blog posts covering our transition from a homegrown data access framework to using GraphQL across all of our clients (web & mobile) here at Coursera.

To introduce the Coursera engineering organization to GraphQL, Sashko Stubailo (core contributor to Apollo and part of the Meteor Development Group) graciously volunteered to share a beginner-level rundown of GraphQL, what it brings to the table, and where it can go in the future. We’ve also included some highlights of that have been especially useful to us in the last couple of months since this talk was given.

Why UI Developers Love GraphQL — Sashko Stubailo, Tech Talks @ Coursera 9/20/2016. Slides available here

GraphiQL is one of the most important tools you’ll use.

Having (essentially) an in-browser IDE for writing and validating your GraphQL queries is crucial to making developers efficient and more confident in their code. On top of that, being able to copy-paste queries straight from GraphiQL into your Apollo Client code is just so awesome.

Keep your queries static.

Being able to lint and statically validate the correctness of your data access makes it easier for front-end developers to know exactly what fields are available on the backend, and for backend developers to be certain that schema changes won’t break the front-ends. Using eslint-plugin-graphql is a must for any GraphQL developer! See this helpful blog post about other benefits of keeping your queries static.

Building caching clients is difficult.

While building a basic GraphQL client consists of sending queries to a GraphQL server, caching those queries consistently can be a difficult job. Instead of reinventing the wheel, we took a survey of the landscape and found Apollo Client to be the best fit for our needs, but Facebook’s Relay was another contender. Also, don’t forget to check out Lokka and Relate!

There’s a lot to look forward to in the realm of GraphQL (and the clients and servers that power it) — this all is just the beginning. Keep an eye out for next parts in this series of posts covering our transition to GraphQL, Choosing a GraphQL Client and How We Made Our Backends Speak GraphQL.