Ask Your Question
2

What is the method for using the GraphQL API to filter issues created by a GitHub App?

asked 2022-12-10 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-12-22 07:00:00 +0000

huitzilopochtli gravatar image

To use the GraphQL API to filter issues created by a GitHub App, you can use the following steps:

  1. Authenticate with GitHub using an access token generated for the App.

  2. Write a query to retrieve the issues created by the App. The query can include the following fields:

    • repository: The repository containing the issues
    • issues: The list of issues matching the filter
    • createdByApp: A Boolean filter to check whether the issue was created by the App or not

Here is an example query to retrieve issues created by a specific App:

query AppCreatedIssues($owner: String!, $repo: String!) {
  repository(owner: $owner, name: $repo) {
    issues(filterBy: { createdByApp: true }) {
      nodes {
        title
        bodyText
        author {
          login
        }
      }
    }
  }
}
  1. Pass in the variables for the owner and repo values and execute the query.

The response will include the information of the issues created by the App in the specified repository.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-12-10 11:00:00 +0000

Seen: 9 times

Last updated: Dec 22 '22