Skip to content

paolo42/testing-issue-reaction-filtering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Repo for testing GraphQL query on issue reactions.

I was curious about how to find out which issues (in a given repository) have a reaction (like, laugh, comment etc.) by me. I created this repo to test my solution.

This repository contains only one empty file and this README. Besides this, I used a separate account to open two issues here. Then I reacted on the first one with an "eyes" emoticon. The second issue has no reaction from me.

I used Github GraphQL API explorer on URL https://developer.github.com/v4/explorer/ with this query:

{
  viewer {
    login
  }
  repository(name: "testing-issue-reaction-filtering", owner: "paolo42") {
    issues (first: 10) {
      edges {
        node {
          url,
          reactions {
            viewerHasReacted
          }
        }
      }
    }
  }
}

This lists first 10 issues in the repository paolo42/testing-issue-reaction-filtering (or less if not enough issues are found). For every issue it returns issue URL and a boolean field viewerHasReacted which is true only for issues with my reaction.

This is API response:

{
  "data": {
    "viewer": {
      "login": "paolo42"
    },
    "repository": {
      "issues": {
        "edges": [
          {
            "node": {
              "url": "https://github.com/paolo42/testing-issue-reaction-filtering/issues/1",
              "reactions": {
                "viewerHasReacted": true
              }
            }
          },
          {
            "node": {
              "url": "https://github.com/paolo42/testing-issue-reaction-filtering/issues/2",
              "reactions": {
                "viewerHasReacted": false
              }
            }
          }
        ]
      }
    }
  }
}

See also

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published