GraphQL: A Query Language for APIs
Learn how GraphQL is used to access multiple endpoints in a single query.
Introduction
Many client-server communication technologies have emerged over the years since the inception of the World Wide Web. Application programming interfaces (APIs) have further smoothed communication between clients and servers. In addition, coupled with emerging technologies, APIs have enabled the development of more complex applications. However, such advancements compelled API developers to invent newer methods for fetching data from the back-end servers due to the limitation of existing architectural styles. Although the preexisting REST APIs provide a scalable and flexible model for data transfer in the form of XML or JSON, they are insufficient to handle contemporary feature-rich and complex applications.
For example, today's social media applications like Facebook and Twitter fetch user data from multiple endpoints. Traditional architectural styles like the REST API prove inefficient for fetching data from multiple endpoints. Therefore, custom data-fetching solutions emerged with time. GraphQL is an example of such custom solutions. It was developed by Facebook to meet their exceeding data-fetching requirements.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.