GraphQL:
GraphQL is a syntax that describes how to ask for data
and is generally used to load data from a server to a client.
Advantages:
- A single endpoint that takes multiple parameters dynamically.
- It allows more dynamic development.
- Allows rapid iterations and fast feedback from businesses.
- No over fetch and under fetch of data.
- It saves backend development time.
- It is faster than other communication APIs because you can cut down the request and the fields which you need only.
- Strongly typed query language.
- Because it is strongly typed most of the errors will be reduced at compile time itself.
- No versioning of APIs is required.
- The client will query only the required data needed.
- It makes it easier to aggregate data from multiple sources.
Disadvantages:
- If the query requested by the server is too large then the response will be slow.
- More complicated to implement cache, because for a single endpoint the query will be changed.
- Rate limiting
- In REST we can specify the number of requests allowed in a day, but in GraphQL it is very complex for that statement.
Thank you...
Top comments (0)