GraphQL is a query which provides a common interface between the client and the server for data fetching and manipulations. The client can ask asks for data from the GraphQL server via queries. The response format is described in the query and defined by the client instead of the server: they are called client‐specified queries.
The Graph QL standard is available on GitHub.
Drift is building the customer messaging platform for businesses to communicate with prospects and customers from their own website or application ... Once we realized at Drift that we were going down the same path, it was time to evaluate alternative solutions. We discovered a new query language specification designed to help us with many of the challenges we’d seen before called GraphQL. Those frontend engineers at HubSpot were on the right path in the first place.
The advantages of REST APIs are that they are cacheable, and their behaviour is obvious. The disadvantage is that it's hard to specify and implement advanced requests with includes, excludes and especially with linked resources. I think you have already seen requests like:
GET /users/1/friends/1/dogs/1?include=user.name,dog.age This is exactly the problem what GraphQL wants to solve. If you have types of user and dog and their relations are defined, you can write any kind of query to get your data.
GraphQL’s power comes from a simple idea — instead of defining the structure of responses on the server, the flexibility is given to the client. Each request specifies what fields and relationships it wants to get back, and GraphQL will construct a response tailored for this particular request. The benefit: only one round-trip is needed to fetch all the complex data that might otherwise span multiple REST endpoints, and at the same time only return the data that are actually needed and nothing more.