A practical checklist for REST and GraphQL
This is cheap to get right at the start and expensive to retrofit. Run through this the next time REST and GraphQL comes up.
The question is rarely whether something can be built, but what it costs to keep running afterwards. Most teams find the first pass takes an afternoon and the maintenance takes minutes a month.
The checklist
- REST is simpler to cache and easier to reason about
- GraphQL shines when clients need wildly different shapes of data
- The right answer depends on your clients, not on fashion
- Someone is named as the owner
- There is a date to review it again
What is actually at stake
REST is simpler to cache and easier to reason about. Getting it slightly wrong is survivable. Ignoring it entirely is not. Doing this properly once is usually cheaper than doing it approximately three times.
In practice
Code gets read far more often than it gets written, and usually by someone with less context than the author had. Three things worth confirming about REST and GraphQL before you move on:
- Someone can say what the current setup is without going to look
- The right answer depends on your clients, not on fashion — and you know whether that is true here
- There is a way to tell whether the last change to this helped
If you want a second opinion on how yours is set up, ask.