GraphQL as a silver bullet

I learned about GraphQL somewhere this year and thought it was genius.

Check out the official site to see what it is, but in short, you call an API and specify in your request the response contract you expect. This sounds lovely for supporting a wide range of use cases with a single API. No upfront rigid API contract, let the clients decide how they want the data.

So in my mind this sounded like the future for providing flexible API’s.

Thankfully the Internet provided some critical thinking, check out this presentation for a guide on when REST still trumps GraphQL:

https://www.infoq.com/presentations/api-rest-graphql

Highlights are your ability to rely on HTTP caching with REST and the self describing nature of HTTP verbs, things you lose with GraphQL.

And so the universally correct answer continues to be “its depends”.

Theme music for this blog post

Advertisements
GraphQL as a silver bullet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s