4 ms·
I agree with this take. I work on a small team (2 backend devs, 2 frontend). The we are always arguing about the API. The frontend devs want the data for their
by sibit 3y ago
I agree with this take.
I work on a small team (2 backend devs, 2 frontend). The we are always arguing about the API. The frontend devs want the data for their components pre-formatted in 1 API call. The backend team wants to run a SQL query and return the entire record as JSON.
- keyle 3y agoFWIW here: The backend guys are wrong.
- operatingthetan 3y agoThe test is to ask ask a full stack developer responsible for both sides what they would do! (And of course, accommodating the data needs of the UI is the answer.)
- sibit 3y agoExactly. My understanding is the API accommodates the frontend data which accommodates the design which accommodates the users needs.
- wruza 3y agoWhat a fullstack guy would do is irrelevant here, because if their requirements changed, they’d just redo it. It’s not about who does the job, but about where we end up at when the format becomes obsolete. Likely scenario: backend formats data and moves on / gets busy elsewhere. Frontend changes, so that data is now required in a different format. Frontend decides to just reformat it at their side because of schedules. Now it’s a mess and nobody knows why. The root of the problem is this stupid frontend/backend team division when it’s actually a single program. That’s where the idea of “let’s ask fullstack” comes from. But there’s no good answer this guy could give you, apart from “stop drawing stupid dividers across the whole”.
- survirtual 3y agoThis is why you version an API. Or just use GraphQL-esque methods, but versioning will poke its head in somewhere eventually.
- operatingthetan 3y ago>What a fullstack guy would do is irrelevant here, because if their requirements changed, they’d just redo it That was obviously a really general rule of thumb not intended to be an actual architecture guideline...
- ilyt 3y agoEntirely depends on how big the request might be
- sibit 3y agoI agree. Sometimes it's easier to just return the record. It starts to suck when you get an array back and you have to loop through all n+1 results to query each additional record instead of just getting what you need in 1 request.
- pdntspa 3y agoIt sounds like both sides simply want to do the least amount of work possible.
- 1123581321 3y agoHence Graphql’s political role, assuming the back end is willing to batch and to maintain types.