What is GraphQL and why should you use it

If you are a regular user or a developer of APIs, then you must be familiar with SOAP APIs or REST APIs. In commonly used APIs like the ones listed, over a period of time, when new features get added, the payload tends to increase. With the increase in payload, API performance tends to suffer a lot.

But did you know that GraphQL can brilliantly solve this problem?

GraphQL is basically a query language of APIs, originally developed by Facebook and very well adopted by Industry pioneers such as Github, Pinterest, Yelp, etc. 

Using GraphQL, you can define the structure of the data which you want and the server will return only the requested data as a response.

This significantly helps tune up performance thus improving the response time of APIs.

It's a must-use for applications involving large payloads and responses, where users may want a limited set of data as per their needs and want to reduce the current response time of the system.

Here is an interesting example that I got to read at CosmicJs

Hope this helps you get the gist of GraphQL.

Post a Comment