Call the GraphQL API with variables.
Section: API and GraphQL
Run a GraphQL query inline
bash
bash
gh api graphql -f query='query($owner:String!,$repo:String!){repository(owner:$owner,name:$repo){name defaultBranchRef{name}}}' -F owner=cli -F repo=cliExplanation
Call the GraphQL API with variables.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing API and GraphQL