Find projects with a specific language

Hi,

I have almost solved a problem I wanted to solve. Find projects using the Racket language:

{
  search(first: 100, type: REPOSITORY, query: "is:public language:racket") {
    repositoryCount
    pageInfo {
      endCursor
      hasNextPage
    }
    nodes {
      ... on Repository {
        nameWithOwner
        parent {
          nameWithOwner
        }
      }
    }
  }
}

Except that is not quite it. It seems to returns projects whose main language is Racket but not all the projects that might contain Racket code. Is there a way to drill down to the project and display it only if it contains Racket code?

Hi @pmatos, thank you for being here. Adding the racketin:code qualifier to the search may help. However, keep in mind there are some restrictions and considerations for code search.

query listRepos($queryString: String!) {
  rateLimit {
    cost
    remaining
    resetAt
  }
  search(query: $queryString, type: REPOSITORY, first: 100) {
    repositoryCount
    pageInfo {
      endCursor
      startCursor
    }
    edges {
      node {
        ... on Repository {
          id
          name
          createdAt
          description
          nameWithOwner
          parent {
            nameWithOwner}
                      }
                    }
                  }
                }
              }
            

With the variables:

{
"queryString": "racketin:code language:racket is:public"
}

Returns: 4764 repositories.

I hope this helps!

Thanks but I don’t think I made myself clear. Apologies for that. I am not looking for the string racket in code. I am looking for repositories that contain some Racket code - Racket being the Racket programming language.

So, even though I can use language:racket it will only return repositories which contain Racket as their main language. Not all repositories containing Racket code.

My thoughts is that I might have to drill down to the repositories languages and check if Racket is one of them but I am unsure if this is achievable.

There’s also something strange that happens with the above code. When I look through the paginations, I can only get 1000 repositories (10 pages). Then it says there are no more pages but there are a lot more than 1000 respositories as search results.

I still have points in my rate, so what else could be going on?