gh api graphql -f query='{ viewer { login } }'

Category: GitHub CLI

gh api graphql -f query='{ viewer { login } }'

Execute a GraphQL query against the GitHub API

Executes a GraphQL query against the GitHub API — GraphQL lets you request exactly the data you need.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.