3 ms·
Because loading all the friends for a user needs to be done in five different places with slightly different data in each one, and loading the data for each req
by strken 7y ago
Because loading all the friends for a user needs to be done in five different places with slightly different data in each one, and loading the data for each request takes 500ms combined but only 150ms separately, plus there are specific questions about each friend like "is this friend in event X?" that only make sense if you know what X is, and when you add a parameter like event=X you notice that there's already an event parameter that does something else and all these different cases are becoming messy, your backend logic had started to reflect the frontend, and you wish you had some kind of way to query your graph of users to retrieve exactly the fields and embedded relationships you need.
- netik 7y agosee, this is where things like apollo client shine. one part of the page makes a request and the rest of the page gets to use the data because now it’s in the local object cache. I get what this article is saying but there is a lot more to graphQL than reducing network RT. It’s about replacing statically defined REST API responses. As a prior commenter wrote, it’s making the backend more flexible when the front end devs change their mind.