Skip to content

GraphQL

### A country
GRAPHQL https://countries.trevorblades.com/graphql
query Country($code: ID!) {
country(code: $code) {
name
capital
}
}
{ "code": "GB" }
  • Use the GRAPHQL method, as JetBrains IDEs do, or a normal POST with an X-REQUEST-TYPE: GraphQL header, as VS Code REST Client does.
  • The body is the query or mutation, optionally followed by a blank line and a JSON object of variables.
  • In the form, the request shows Query and Variables boxes.
  • {{variables}} work in both, and a GraphQL request can be chained like any other: {{country.response.body.$.data.country.name}}.