Home/Writing/Why I Switched from REST to GraphQL for My Portfolio API
graphqlapinextjs
Apr 28, 2026
4 min read
169 views

Why I Switched from REST to GraphQL for My Portfolio API

A practical comparison of REST vs GraphQL from a real project migration — what I gained, what I lost, and what surprised me.

As applications grow, APIs naturally evolve. For my portfolio, I realized that REST endpoints were fetching either too much or too little data. Here is why I transitioned to GraphQL.

Over-fetching and Under-fetching Problems#

With a REST setup, loading the home page required hitting three separate endpoints: profile data, recent blog posts, and featured projects. This caused multiple roundtrips and returned fields that the UI didn't immediately need.

Switching to GraphQL enabled a single, consolidated query requesting exactly the required fields. It improved client-side rendering times and simplified client-side state management significantly.