Search for code in GitHub using GraphQL (v4 API) : <p>I am using the GitHub's GraphQL API to search for files/code containing a particular word.  A simple (contrived) example of a search which in this case is to find the term "beef" in files located in "recipes" (the repo) for "someuser" (the owner for the repo) is shown below:</p>

<pre><code>{
  search(query: "beef repo:someuser/recipes", type: REPOSITORY, first: 10) {
    repositoryCount
    edges {
      node {
        ... on Repository {
          name
        }
      }
    }
  }
}
</code></pre>

<p>I tried this in GitHub's GraphQL Explorer (<a href="https://developer.github.com/v4/explorer/" rel="noreferrer">https://developer.github.com/v4/explorer/</a>) and receive zero results from the search which is incorrect as I can confirm that the word ("beef" in the example above) is in the files in the repo:</p>

<pre><code>{
  "data": {
    "search": {
      "repositoryCount": 0,
      "edges": []
    }
  }
}
</code></pre>

<p>When I try this using GitHub's REST API (v3) via curl, I definitely get results:</p>

<pre><code>curl --header 'Accept: application/vnd.github.v3.raw' https://api.github.com/search/code?q=beef+repo:someuser/recipes
</code></pre>

<p>... So I know that the query (REST v3 API) is valid, and my understanding is that the query string in the GraphQL (v4) API is identical to that for the REST (v3) API.</p>

<p>My questions are:</p>

<ol>
<li>Am I incorrectly using the GitHub GraphQL (v4) API or am I specifying the query string improperly, or am I trying to use functionality that is not yet supported?</li>
<li>Is there an example of how to do this that someone can provide (or link to) that illustrates how to search code for specific words?</li>
</ol>
