Chapter 1
Meet GraphQL

There was a time when the primary job of a web server was supplying HTML content to a web browser for display, but these days—to support mobile and rich client-side applications—a lot of the work that we need to do on the backend involves building APIs.

Building an API that can support a wide range of possible clients can quickly become a challenge. The needs of applications that use the API can quickly diverge and force us to make tough decisions; what starts as a simple REST API can quickly become more complex as we work to make its endpoints more flexible to support clients.

Let’s explore a different way to build APIs—one that addresses this modern problem head on and comes packed with other benefits: GraphQL.

GraphQL is a query language that gives the users of an API the ability to describe the data that they want, and lets creators of the API focus on data relationships and business rules instead of worrying about the various data payloads the API needs to return.

In this chapter, we’re going to look at some of the key concepts behind GraphQL, including how these query documents are structured and how a GraphQL server interprets them. Along the way, we’ll draw some comparisons with the most common technology driving web services today: REST.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.15.161