DEV Community

Discussion on: What is GraphQL - the misconceptions.

Collapse
 
paulcosma97 profile image
Paul Cosma

I don't see how using one endpoint for all your requests is a plus. Of course it's more convenient for the frontend Dev because they don't have to remember all the endpoints but this convenience comes with performance issues like:

  • the server has to parse the query every time. This is not an issue in rest because for GET requests you only pass the URL
  • imagine having multiple microservices. A proxy would have to parse the query, find a suitable microservice and that service would have to parse it again. By using REST you could simply parse the URL in the proxy and ignore the body
Collapse
 
barucalmaguer profile image
Baruc

Another benefit of graphql is having to perform a single server call, with REST you probably would make a lot of calls to the different endpoints.
It's costs way more to make a request to a server far away (tens of ms) than to parse a request (< 1 ms)