Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 18

Error accessing GraphQL search when authenticated as a GitHub App Installation

I'm migrating from an Oauth App to a github App and I'm having issues accessing the search using the GraphQL API (v4)

I'm doing a search request, on Issue types. (filtered down to pull requests).
My app has the following permissions:

 

Read access to code

Read access to issues, members, metadata, and pull requests

Using the search endpoint with graphQL worked correctly when I was authenticated using an Oauth App, but when I switch to an authentication as an App Installation, I get the following error:

"GitHub Apps are not allowed access to search"

I don't understand, is it a global restriction ? If this is the case, why is the search issues and pull requests listed as enabled for github app for the rest API and not GraphQL ? (https://developer.github.com/v3/search/#search-issues-and-pull-requests)

If not, is this an issue with missing authorizations for my app ? I've stripped down my graphQL request to a bare minimum, requesting only the pull request number, but I'm still getting the error.

If search is indeed not available for github apps, is this feature on the roadmap ? I understant that github apps are now the preferred way to integrate with github, but not being able to access the search is a blocker for us.

17 Replies
Community Manager
Message 2 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation

Hi @HHK1,

 

Thanks for being here! GitHub App permissions are more granular than OAuth Apps/Personal Access tokens, and the GraphQL API currently does not have support the equivalent of the Contents API. If you wish to continue using your GitHub App with the Single File permission, but use the REST API, you can do so using one of the API endpoints accessible with the Single File permission.

 

I can confirm there is a schema request for this and I've taken your feedback and passed it along to the appropriate teams. Thanks again for reaching out 😀


Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Pilot Lvl 1
Message 3 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation

Please make the GraphQL search query support user-to-server tokens and installation tokens. I want to search for issues/pull_requests and include the private ones in the result. Currently the search is completely blocked for GitHub Apps, even when searching public things.

Pilot Lvl 1
Message 4 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation

Hi @AndreaGriffiths11 

 

I don't see how the Single File permissions as anything to do with the search endpoint. Maybe I missed something but if I understand well, the problem here as said @HHK1 is that the search capability allowed for github apps on the REST API v3 is not allowed for the GraphQL endpoint.

 

This kind of requests can't be performed:

query ($filter: String!) {
  search(type: ISSUE, query: $filter, first: 100) {
    issueCount
  }
}

The error being "GitHub Apps are not allowed access to search"

 

Is there any timeline for this ?

It's highly important for us as well..

 

Thanks in advance to the team :)

Copilot Lvl 2
Message 5 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation

Yes @toniopelo , I don't understand either how the Single File permissions  is related to this issue.

Right now, the only solution I can think of, is to use the github app webhooks and aggregate the data in our own DB so that we can query it in a similar fashion, but that's a huge amount of work for something that should be doable with graphQL.

Pilot Lvl 1
Message 6 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation


@HHK1 wrote:

 

Right now, the only solution I can think of, is to use the github app webhooks and aggregate the data in our own DB so that we can query it in a similar fashion, but that's a huge amount of work for something that should be doable with graphQL.



Woah, that's such a pain to rely on the webhooks to recreate the state based on events..

Might even be unreliable in case of downtime from github or your service right ?

 

I agree with you that should be possible with the GraphQL API.

@AndreaGriffiths11 Please could we have an idea of the state of this request ?

Community Manager
Message 7 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation

Thanks for the ping @toniopelo, I'll get an update today. 


Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Pilot Lvl 1
Message 8 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation

@AndreaGriffiths11 Did you get something new about our problem ?

Ground Controller Lvl 1
Message 9 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation

check permissions

Pilot Lvl 1
Message 10 of 18

Re: Error accessing GraphQL search when authenticated as a GitHub App Installation

@mrho0123 What do you mean ? I don't see any permissions that would allow / deny search capabilities on GraphQL (I can perform the same operation over REST API v3 with the same installation token).

Moreover the error message is quite self explanatory: "GitHub Apps are not allowed access to search"