In plain words
An API call is a message your app sends to a server at a specific address, asking it to fetch, save or change something, then waiting for the reply.
Where you see it
Open DevTools, go to the Network tab and reload Chirp: each row is an API call, such as GET /api/posts. Click one to see what went out and what came back.
What goes wrong
- Not checking whether the call worked
fetch only throws when the network itself fails. A 500 from your server still counts as a reply, so without a check the screen quietly shows nothing.
const posts = await (await fetch("/api/posts")).json(); - No loading or error state
The page says "No posts yet" while the call is still on its way, or forever if it failed. People read that as their data being gone.
- A call that fires on every render
A useEffect with no dependency list, the [] at the end, runs after every redraw, and each reply triggers another redraw. The loop hammers your database and can use up a free plan's limits in minutes.
useEffect(() => { loadPosts().then(setPosts); });
What to tell your agent
Quick check
Sign in to earn +10 XP for itChirp's feed shows "No posts yet", but the database holds 300 posts. Where do you look first?