1
0
mirror of synced 2025-12-19 09:57:42 -05:00
Files
docs/content/graphql/guides/using-graphql-clients.md
Johanan aa87852feb feat(graphql): Remove GraphQL Explorer embed (#58109)
Co-authored-by: Christophe (Xtof) Dehaudt <xtof.dehaudt@gmail.com>
Co-authored-by: Christophe (Xtof) Dehaudt <xtofx@github.com>
2025-11-11 13:56:44 +00:00

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.
/v4/guides/using-the-explorer
/graphql/guides/using-the-explorer
/graphql/overview/explorer
fpt ghec ghes
* * *
API

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:

  1. Point the client at the GraphQL endpoint: {% data variables.product.graphql_url %}.

  2. Add an Authorization header: Authorization: Bearer TOKEN (replace TOKEN with your {% data variables.product.company_short %} {% data variables.product.pat_generic %}. For more information, see AUTOTITLE).

  3. Set the request method to POST or if it's available, use the client-provided GraphQL mode.

  4. Enter your query or mutation in the editor and, if needed, provide variables in the "Variables" panel.

    Example:

    query {
      viewer {
        login
      }
    }
    
  5. 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
        }
      }
    }
    
  6. 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.

  1. Install and authenticate with {% data variables.product.prodname_cli %}.
  2. Run a query against {% data variables.product.graphql_url %} using the GraphQL endpoint with the gh api subcommand.

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 %}