GraphQL search different in explorer/web vs HTTP

I found that running a search query in the explorer and search on the website give different results compared to using the GraphQL API.

For example in the Explorer,

{
  search(query: "license:zlib created:2017-01-01..2019-08-10", type: REPOSITORY) {
    repositoryCount
  }
}

{
  "data": {
    "search": {
      "repositoryCount": 1377
    }
  }
}

When I try the same thing using HTTP (tried Julia’s Diana.jl and R’s ghql),

query x {
search(query: "license:zlib created:2017-01-01..2019-08-10", type: REPOSITORY) {
repositoryCount
}
}

{
"data": {
"search": {
"repositoryCount": 1375
}
}
}

I have found multiple instances where there is a disparity as such.

Hey @nosferican,

Are you authenticating with the API using a Personal Access Token, or a GitHub App in all instances? The authentication token or app will need to have the relevant permissions or scope to read Team information. The same is true for an organization’s private repositories. 

Hi Andrea,

I found some instances where the differences were just some private packages and updated the Personal Access Token to read only public for consistency. However, I couldn’t replicate another instance where it couldn’t have been permission issues. I am leaning to believe it was a “this search took a while results might vary” or so. Will experiment a bit longer in case I fing any other differences or close the issue. Thanks!

1 Like

Very interesting, thanks for taking the time to report and test, I’d log it on my end to keep an eye on.