Skip to content

Instantly share code, notes, and snippets.

@brasic
Created January 18, 2023 23:45
Show Gist options
  • Save brasic/1aefd849885a274d1721d8999b06c335 to your computer and use it in GitHub Desktop.
Save brasic/1aefd849885a274d1721d8999b06c335 to your computer and use it in GitHub Desktop.
fetching all participants in a discussion
gh api graphql \
--paginate \
--jq 'tostream | select(.[0][-1]=="login" and .[1]!=null) | .[1]' \
-F owner=community \
-F name=community \
-F number=12341 \
-f query='
query($owner: String!, $name: String!, $number: Int!, $endCursor: String) {
repository(name: $name, owner: $owner) {
discussion(number: $number) {
author {
login
}
comments (first: 100, after: $endCursor) {
pageInfo {
endCursor
hasNextPage
}
nodes {
author { login }
replies (first: 100){
pageInfo {
endCursor
hasNextPage
}
nodes {
author { login }
}
}
}
}
}
}
}
' | sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment