Skip to content

search for GitHub repositories using version 4 of the GitHub API (https://developer.github.com/v4) #24896

Discussion options

You must be logged in to vote

You can use the search query to search for all kinds of GitHub objects. If I wanted to search for repositories containing “atom” though, I would use:

{
  search(query: "atom", type: REPOSITORY, first: 10) {
    edges {
      node {
        ... on Repository {
          nameWithOwner
        }
      }
    }
  }
}

which results in:

{
  "data": {
    "search": {
      "edges": [
        {
          "node": {
            "nameWithOwner": "atom/atom"
          }
        },
        {
          "node": {
            "nameWithOwner": "AtomicGameEngine/AtomicGameEngine"
          }
        },
        {
          "node": {
            "nameWithOwner": "rybalkinsd/atom"
          }
        },
     …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants