What is GraphQL ?

GraphQL is a new API standard that provides a more efficient, powerful and flexible alternative to REST. It is created by Facebook with the purpose of building client applications based on intuitive and flexible syntax, for describing their data requirements and interactions.

One of the primary challenges with traditional REST calls is the inability of the client to request a customized (limited or expanded) set of data. In most cases, once the client requests information from the server, it either gets all or none of the fields.

Another difficulty is working and maintain multiple endpoints. As a platform grows, consequently the number will increase. Therefore, clients often need to ask for data from different endpoints.

When building a GraphQL server, it is only necessary to have one URL for all data fetching and mutating. Thus, a client can request a set of data by sending a query string, describing what they want, to a server.

Why GraphQL ?

It solves the over fetching and under fetching problems of REST, as the client can specify exactly what data it needs in the query.

It supports rapid product upgrades/versioning as the, changes on client side can be made without any extra work on the server.

Dataloder APIs provides an easy way of reducing communication overhead by batching and caching.

#facebook #rest-api #software-architecture #api #graphql

Is GraphQL the new REST ?
1.10 GEEK