We discussed the REST API, GraphQL, and their usage. A recording of the session demonstrations is available here.
Representational State Transfer is a software architectural style that defines a set of constraints to be used for creating Web services.
It is abundantly used in web applications for data retrieval, insertion, manipulation, and deletion.
Below are the 4 request-types we discussed:
GET
- Used to retrieve data.
- The request body doesn't have significance, but the endpoint does.
POST
- Used to insert data.
- Both request body and the endpoint are significant.
PUT
- Used to update data.
- Both request body and the endpoint are significant.
DELETE
- Used to delete data.
- The request body doesn't have significance, but the endpoint does.
The limitations of the REST API are:
- We are victim to overfetching. We can't selectively choose which properties to retrieve, unless we are using extensive non-standard techniques.
GET
andDELETE
requests don't use any data provided in the request body.
To overcome these, and possibly several other limitations, GraphQL was born.
Use the below-mentioned tools to try out the REST API and GraphQL:
- REST API Playground by Param.
- GraphQL Playground by Ritesh.