Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 2.18 KB

RESTvsGraphQL.md

File metadata and controls

21 lines (16 loc) · 2.18 KB

REST vs GraphQL

img.png

Feature GraphQL REST
Flexibility 👍 Client specify exact resource & fields in GraphQL schema (query param), it wants. Rigid
Speed 👍 GraphQL is faster than REST because as you can pick the fields you want to query, so the request will always be the smallest possible.
Prerequisites/Overheads 👎 Extra-tools are needed on both client & server side. 👍 Standard CURL is supported. No extra tools needed.
HTTP Cache (Browsers, CDNs, Proxy Servers) 👎 Not-Supported 👍 Supported
Security 👎 Un-required table scan can be done, by client. This can be mitigated, but with maintenance overhead. 👍 Good.
Over-fetching No Yes

Read more

Similarities of REST with GraphQL

Both REST and GraphQL are based on following,

  • HTTP
  • API URL
  • Can return JSON response