I am trying to get the reaction count for each content using the Github v4 API (GraphQL). Can anyone suggest how can I achieve this?
Github supports the following reactions:
THUMBS_UP
THUMBS_DOWN
LAUGH
HOORAY
CONFUSED
HEART
ROCKET
EYES
For each reaction, I want a count which denotes the number of people who reacted. For eg. I am referring to this comment -> #2190.
Github API provides a feature called reaction group. Refer to the following query...
{
repository(owner: "sindresorhus", name: "refined-github") {
issue(number: 2190) {
reactionGroups {
content
users {
totalCount
}
}
}
}
}
Hope this solves your problem!