GRAPHQL VS REST
JOHNNY HASHOUL
DECEMBER 2019
REST(FUL) API
WEB STANDARD FOR
DESIGNING APIS
STRUCTURED ACCESS TO
RESOURCES
HTTP VERBS (GET, POST,
PUT, DELETE)
RESOURCE BASED
ENDPOINTS (/USERS/<ID>)
REST(FUL) API - USAGE
GET …/users/1
{
"id":1,
"name":"Johnny",
"surename":"Hashoul",
"edited":"2014‐12‐20T20:18:48.516Z"
}
REST(FUL) API - USAGE (CONT’D)
Fetching comment data
GET …/users/posts
GET …/users/<postId>/comments
GET …/users/<postId>/<commentId>likes
GRAPHQL
Query Language created by
Facebook (2012)
Provides common interface
for data fetching and
manipulation
Natural way to describe data
requirement
Flexibility and efficiency in
mind
DATA
FETCHING
DATA
FETCHING
GRAPHQL
GraphiQL Demo
WHY GRAPHQL
No more Over- and Underfetching
 Returns more than fixed data structure
 Get the exact required fields
 Prevents underfetching
THANK YOU!

GraphQL vs REST