Why GraphQL?

GraphQL

Origin

REST and its shortcomings

query FetchUserBlogsAndCommentsQuery {
user(id: "123"){
id
username
email
blogs{
title
description
tags
comments{
author{
username
}
text
}
}
}
}
{
"data":{
"user":{
"id": 123,
"username": "John Doe",
"email": "john@doe.com",
"blogs":[
{
"title": "Why GraphQL??",
"description": "GraphQL was developed to cope with the need for more flexibility!",
"tags": ["GraphQL", "REST", "API"],
"comments":[
{
"author": {
"username": "Jane Doe"
}
"text": "This blog clearly explains why GraphQL was needed, Helped a lot!!"
}
]
}
]
}
}
}

Smaller precise payloads

Over-fetching leads to downloading more data

Under-fetching for n+1 problem

Benefits of a Schema and Strictly Type System

Documentation

No more versioned APIs

Better performance and rapid frontend iteration

REST is GOOD GraphQL is BETTER

Get in touch

--

--

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