|
|
|
|
|
by switch007
1759 days ago
|
|
> Avoid multiple round trips: Often, in order to call one endpoint that required a certain parameter, such as /getProfileById/{id}, we would have to call additional endpoints as a pre-req, such as getUser{username} to returnparameters such as id. This was a problem because we were making multiple round trips to fetch one piece of information. GraphQL helped solve this problem because it allowed us to fetch everything we need in one round trip. Why not add another URL? /getProfileByUsername? Nothing stops you building another layer of endpoints to service your frontend. |
|
> Nothing stops you building another layer of endpoints to service your frontend.
They could've added a new endpoint for that specific usecase but I'm assuming they've simplified their actual needs to this one example.