Blog
Notes from building MockBase.
How the product gets built, what broke, and why -- written as it happens.

GraphQL Doesn't Kill the Need to Mock — It Just Moves It
A GraphQL mock that returns one fixed body for every request to /graphql tells you almost nothing — the client's query, not the URL, determines what a real server would actually send back.

Why Your Staging Environment Needs Its Own Fake Third Parties
Pointing staging at a payment or SMS provider's sandbox feels like the responsible choice — and it quietly imports every one of that sandbox's own failure modes into your test environment.

The N+1 Problem Isn't Just a Database Thing
Fetch a list of 20 items, then make a separate API call per item to fill in the details, and you've built the same footgun as an unbatched database query — just with real network latency attached to each one.

Idempotency Keys: How to Make "Retry This" Actually Safe
A client that doesn't know whether its request succeeded has one safe option: retry with a key that lets the server recognize "I've already done this." Here's how that actually has to work.

Feature Flags Turn Every User Into a Different API
Every flag you add doubles the number of distinct behaviors your API can exhibit — and unlike a version number, a flag combination is invisible in the request itself.

Consumer-Driven Contract Testing, Explained Without the Buzzwords
Instead of an API's team guessing what's safe to change, consumers write down exactly what they depend on — and the API gets tested against that, not against a vague sense of "probably fine."

The Environment Variable That Only Breaks in Staging
"It works on my machine" has a specific, common variant: works on localhost, works in production, breaks only in staging. It's almost never bad luck.

Cursor Pagination vs Offset Pagination, and Why Testing Page 2 Matters
Pagination looks solved until the list changes while someone's paging through it — at which point the choice between offset and cursor stops being a style preference.

Testing Token Expiry Without Waiting for a Token to Expire
Refresh-token logic is invisible when it works and directly responsible for "randomly logged out" complaints when it doesn't — and almost nobody actually tests it end to end.

API Versioning Is a People Problem, Not a URL Problem
Whether you version with /v1/, a header, or nothing at all matters far less than whether you have a real plan for the clients still stuck on the old version.

Designing Error Responses People Can Actually Debug
"Something went wrong" tells a developer nothing they didn't already know. A good error response answers what happened, why, and what they can do about it.

When Your Mock Lies to You: The Contract Drift Problem
Mocking a dependency is a productivity win right up until the mock quietly stops matching reality — at which point it's worse than not having one, because it gives you false confidence.

The Retry-After Header Nobody Reads
A server hitting you with a 429 is often doing you a favor by telling you exactly how long to wait. Most clients ignore it and retry immediately anyway, making the problem worse for everyone.

401 vs 403: The Difference Nobody Bothers to Get Right
The distinction between "who are you" and "I know who you are, and no" isn't pedantic trivia — mixing them up teaches your frontend to do the wrong thing when a request fails.

The Weirdest Important IP Address on the Internet
A short guide to link-local addresses, cloud metadata endpoints, and why letting your server fetch an arbitrary URL on someone else's behalf is more dangerous than it sounds.

Your Error Handling Code Has Never Actually Run
Most apps have retry logic, loading states, and fallback UI that's never been triggered by a real failure — because real failures are rare and hard to schedule. Here's how to make them happen on demand.

Build the Frontend First: A Practical Guide to API-First Development
Waiting for the backend to exist before you can build the UI against it is a scheduling problem, not a technical one. Here's how teams actually break that dependency.

OpenAPI Is a Contract, Not Documentation
Treating your OpenAPI spec as an afterthought you generate from code, instead of a source of truth you write on purpose, quietly costs teams more than they realize.

When a Fake API Needs to Remember Things
Most API mocks return the same canned response every time — which works, until the feature you're testing depends on creating something and then reading it back.

How to Break Your Own API on Purpose
"It works on my machine and fails randomly in production" is usually a timing problem, not a logic problem — and timing problems are notoriously hard to reproduce until you can control them directly.