Run a GraphQL query against a live public API in minutes — ask for exactly the fields you want, nest into related data, and see why GraphQL returns no more and no less.
Why: with GraphQL you send a query that mirrors the shape of the data you want, and the server returns exactly that — no over-fetching, no under-fetching. A query is a set of fields; nested fields drill into related objects. The response JSON has the same shape as your query.
# Ask for three fields on every country
query {
countries {
name
capital
emoji
}
}Why: the result is JSON nested under a top-level "data" key, shaped exactly like the query you sent. Request name and capital, get name and capital — nothing else. This predictability is the whole point: the client controls the response shape.
{
"data": {
"countries": [
{ "name": "Andorra", "capital": "Andorra la Vella", "emoji": "🇦🇩" },
{ "name": "United Arab Emirates", "capital": "Abu Dhabi", "emoji": "🇦🇪" }
]
}
}Why: every GraphQL server exposes ONE endpoint, and most ship an in-browser explorer (GraphiQL / Apollo Sandbox) where you type a query and run it. Open a public one now and paste the query above. The countries API at countries.trevorblades.com is a great no-signup sandbox. See https://countries.trevorblades.com.
open https://countries.trevorblades.com → paste a query → Run ▶