API

GraphQL

Graph Query language. Fixes the underfetching and overfetching problem.

Resources

Why would you use GraphQL? Well REST doesn’t scale really well. You need to set up different endpoints. Else it will just send you a huge chunk of data. Hmm is this true? Yes if you do a GET request. But like with a POST request, you can receive data afterwards based on the fields you request.

  • I guess the argument is POST was not designed for that principle.
  • Actually, GET requests can also include query parameters to specify fields, reducing overfetching by requesting only necessary data.

But it seems GraphQL is more configurable.

GraphQL services typically respond using JSON, however the GraphQL spec does not require it.