What is GraphQL?
As per the definition from the official website, GraphQL is a query language for the API.
It works on 3 core features:
Below is a simple example of how you can get only those things in response which is asked as a GraphQL query to the API.
One of the most important aspects of GraphQL is that, while typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request.This makes GraphQL APIs faster ABD thus, apps using GraphQL can be quick even on slow network connections.
The below diagrams are an example of how you can get many resources in a single request. The first diagram depicts the GraphQL query request and the second diagram is the response returned for the query.
It has a strong system using which we can describe the APIs as types and fields and not endpoints. GraphiQL is very useful tool to work with GraphQL.