The following is the first few sections of a chapter from GraphQL and Android, plus headings for the remaining major sections, to give you an idea about the content of the chapter.


GraphQL in Five Minutes

Before we get into what GraphQL is, why you might be using it, and what it has to do with Android, let’s spend a few minutes playing around with GraphQL. One of the nice things about this piece of technology is that you can experiment with it easily enough, using publicly-available GraphQL sites… starting from the comfort of your desktop Web browser.

(you could use a mobile Web browser, such as on your Android phone or tablet, but a physical keyboard is really handy when working on programming-like tasks)

Step #1: Gotta Get a GraphiQL

Developers love tools. After all, programming computers by hand-calculating machine instructions for a CPU gets to be tiresome rather quickly. We are used to having IDEs for base development, with structured editors, debuggers, and the like. We are used to having databases with clients that we can use for testing queries. We are used to being able to browse the source of Web pages and bring up other interactive Web development tools in the browser.

The people who created GraphQL provided a Web-based interactive GraphQL tool called GraphiQL. GraphiQL allows you to play around with GraphQL without having to install anything or even know much about GraphQL.

With that in mind, in a desktop Web browser, visit https://graphql-demo.commonsware.com/0.3/graphql. While this link will work on a phone or tablet, GraphiQL is not designed for use from mobile devices.

This will bring up GraphiQL on a CommonsWare-hosted GraphQL-powered server:

GraphiQL, As Initially Launched
Figure 1: GraphiQL, As Initially Launched

On the left, you can enter in something in GraphQL. Clicking the “run” button (rightward-pointing triangle) sends that to the server, which triggers a response on the right.

Step #2: Drafting a Document

The preview of this section was fed to a gremlin, after midnight.

Step #3: Making the Request

The preview of this section was lost in the sofa cushions.

Step #4: Looking at the Docs

The preview of this section is [REDACTED].