On the Client

To illustrate conventional GraphQL communication practices, let’s imagine how a web or mobile application might request data from a server over HTTP. At a high level, this conversation looks something like the figure.

images/chp.graphql/req-resp.png

The application sends a GraphQL document to the server, and the server responds with a JSON document, having consulted a schema that describes data it has available to query and to modify. Because of the schema, the server is empowered to flexibly fulfill the requests sent by clients on a case-by-case basis.

Let’s see how this compares to REST, looking at a specific example: retrieving information about a specific ...

Get Craft GraphQL APIs in Elixir with Absinthe now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.