Co-authored-by: Christophe (Xtof) Dehaudt <xtof.dehaudt@gmail.com> Co-authored-by: Christophe (Xtof) Dehaudt <xtofx@github.com>
3.2 KiB
title, intro, redirect_from, versions, topics
| title | intro | redirect_from | versions | topics | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Using GraphQL Clients | You can run queries on real {% data variables.product.prodname_dotcom %} data using various GraphQL clients and libraries. |
|
|
|
Warning
The GraphQL Explorer was removed from the documentation on November 11, 2025. See our changelog announcement.
Using GraphQL client IDEs
There are many open-source GraphQL client IDEs you can use to access {% data variables.product.company_short %}'s GraphQL API.
See AUTOTITLE for extensive information on HTTP methods, authentication, and GraphQL call structure.
First, choose a client. Common options include GraphiQL, Insomnia, and Altair (desktop/web/extension). You can see the full list of clients in the GraphQL organization's tool directory.
The following generic instructions will work with most GraphQL clients:
-
Point the client at the GraphQL endpoint:
{% data variables.product.graphql_url %}. -
Add an
Authorizationheader:Authorization: Bearer TOKEN(replaceTOKENwith your {% data variables.product.company_short %} {% data variables.product.pat_generic %}. For more information, see AUTOTITLE). -
Set the request method to
POSTor if it's available, use the client-provided GraphQL mode. -
Enter your query or mutation in the editor and, if needed, provide variables in the "Variables" panel.
Example:
query { viewer { login } } -
If your client needs a schema for documentation rendering or autocomplete, fetch it via a GraphQL introspection query. Many clients can do this automatically from the "Docs" panel.
Minimal introspection query:
query IntrospectionQuery { __schema { types { name } } } -
Run the request and inspect the JSON response. Query from example should return the login associated with the {% data variables.product.company_short %} {% data variables.product.pat_generic %} you authenticated with.
Use the client UI to explore docs, run queries, and save requests as needed.
{% data variables.product.prodname_cli %}
You can also use the command line with {% data variables.product.prodname_cli %} to run GraphQL queries.
- Install and authenticate with {% data variables.product.prodname_cli %}.
- Run a query against
{% data variables.product.graphql_url %}using the GraphQL endpoint with thegh apisubcommand.
Example:
gh api graphql -f query='query { viewer { login } }'
This should return the login associated with the {% data variables.product.company_short %} {% data variables.product.pat_generic %} you authenticated with.
Requesting support
{% data reusables.support.help_resources %}