GraphQL Explorer is an instance of GraphiQL, which is a "graphical interactive in-browser GraphQL IDE". You can use it to test your queries for syntax or to check the documentation of a particular object.
On this guide, inside some GraphQL query samples, you may see a link that says "Run in Explorer." Click the link and you'll go to the Explorer window with the query sample already filled in. You'll need to fill in the token before you can actually run the query.
query {
organization {
name
}
}
You should see a response like the following:
{
"data": {
"organization": {
"name": "your organization name"
}
}
}
All types in a GraphQL schema include a description field compiled into documentation. The collapsible Docs pane on the right side of the Explorer page allows you to browse documentation about the type system. The docs are automatically updated and will drop deprecated fields.
Because GraphQL is introspective, the Explorer supports:
If you enter a query that is not well-formed or does not pass schema validation, a popup warns you of an error. If you run the query, the error returns in the response pane.
A GraphQL response contains a "data"
object.
If the response failed the value of "data"
is null
and the response will contain an "errors"
array.
{
"data": null,
"errors": [{
"message": "Objects must have selections",
"locations": [{
"line": 5,
"column": 8
}]
}]
}