REST vs GraphQL same screen, different work

Follow one profile + feed requirement through two API designs.

Lesson 1 of 10
ONE REQUIREMENT
Show Ada’s profile and feed: name, avatar, post text, author, and like count.

REST

endpoint waterfall + client assembly

fixed resources
Client screen
Needs profile + feed.starts the waterfall
/users/ada
Fixed profile representation.name · avatar · bio
/users/ada/feed
Fixed feed representation.post · author · likes
REST data store
Resource queries.HTTP cacheable GETs
Client assembly
Combines endpoint payloads.waiting for routes
Compact REST request table
HTTP requests0 active
Payload shapefixed per endpoint

GraphQL

operation → validation → resolvers → shape

typed operation
Client operation
asks for selected fields.one HTTP POST
Schema gateway
parse + validate + authorize.rejects invalid fields
Field resolvers
profile, feed, author, likes.can fan out work
Data sources
services / databases.batching can prevent N+1
Shaped response
only requested fields.waiting for operation
Compact GraphQL execution table
HTTP requests0 active
Backend workno resolver work yet