What is GraphQL and why should a web developer learn it

Share:

About GraphQL

GraphQL is gaining a lot of popularity because of its superiority over traditional REST APIs. Many big companies like Facebook, Coursera, Github, and Yelp have already started using it, which has also helped a lot in terms of gaining popularity. 
There is a good chance that you might have already have heard about GraphQL in blogs pots, on Medium, or, in general, Web,  Anyway, let me give you a brief overview of What is GraphQL and why should a web developer learn it.

GraphQL

GraphQL is nothing but a query language from Facebook, which aims to solve some problems with RESTful Services like a lot of endpoints, under-fetching, and over-fetching of data and versioning. It provides a wrapper around APIs, which makes it easier from front-end to use a single endpoint to get all the things they need.
For, example Github's REST API for user data, https://api.github.com/users/ returns User details which contain 31 fields, if you are just interested in id, location, and url, then you are fetching a lot of unnecessary data which could impact performance and scalability of your application. See the example below.

GraphQL solves this problem by wrapping this API and providing a more straightforward interface based upon your requirement. It also makes it easier to evolve APIs over time and enables powerful developer tools. Once you start using GraphQL, I am sure you will even begin to love its flexibility, type-safety, and community of support.

Because of these remarkable qualities, GraphQL is getting more and more popular every passing day, and who knows it may replace REST in the coming years. Many companies like Coursera have already use GraphQL for their API. They have also built tools that can dynamically translate their REST APIs to GraphQL.
If these things excite you and you want to try GraphQL or explore more, you can check out the courses.