Test a GraphQL service using Altair

icanhazdadjoke.com provides "dad jokes" structured as follows:

type Joke {
  id ID
  joke String
  permalink String
}

You can request a joke and its id using curl:
curl -X POST -d '{"query": "query { joke {id joke } }"}' -H "Content-Type: application/json" https://icanhazdadjoke.com/graphql

The Altair tool provides a GUI Client to query GraphQL services.

  1. Open the Altair Firefox extension: click the puzzle-shapped icon on the upper-right corner of Firefox, and then click the Altair icon.
  2. In the url field, paste https://icanhazdadjoke.com/graphql and click Docs to retrieve the schema of the service.
  3. The schema opens on the right frame, click Query to expand it.
  4. Hover over joke, "ADD QUERY" appears at the end of the line. Click it.
  5. A query skeleton appears in the left frame. Edit it to request a random joke and its id:
    {
      joke {
        id
        joke
      }
    }

    Click "Send Request".
  6. The response appears in the central frame.

Note: once you're satisfied with your request, you can copy it as a curl command using the bagage-case shapped icon on the left.

In case the Dad Joke service is not available, use the Countries service:
curl -X POST -d '{"query":"{\n country(code: \"FR\") {\n capital\n code\n currencies\n currency\n languages {\n code\n name\n native\n }\n }\n}\n","variables":{}}' -H "Content-Type: application/json" https://countries.trevorblades.com/graphql