REST has been the long-reigning king in the realm of web application architecture. It provides a comprehensive set of rules and constraints that can deliver fully functioning web services. However, those rules and constraints can quickly become problematic as well.
Using REST to its full potential requires an extremely high level of familiarity with its complexities, which is just not feasible for every developer. This has given rise to “so-called REST” APIs which do not actually conform with RESTful rules.
GraphQL makes API development easier and more accessible to a larger population. Clients that lack the time and money needed to work with REST love the simplicity of GraphQL.
In a REST API, fetching multiple resources requires making multiple requests to the server. However, with GraphQL, this can be done with just a single query.
GraphQL also solves the problem of over/under-fetching data. A REST call can often retrieve a lot of extra or incomplete information. On the other hand, GraphQL queries are very specific and return exactly what we need.
REST does have its own advantages. Performance optimization is pre-defined in the protocol. It is also a highly scalable technology. These functionalities do exist in GraphQL, but it is entirely up to the client to implement them.
Free Resources