Had a 馃挕 moment w/ @orta this morning. We can request _multiple issue/PR_ status info via the GraphQL API to batch notification status into a single network request using GQL aliases. An example request:
query {
repository(owner: "rnystrom", name: "githawk") {
issue(number:1) {
title
state
}
issue2: issue(number:2) {
title
state
}
}
}
Response:
{
"data": {
"repository": {
"issue": {
"title": "Sample issue",
"state": "CLOSED"
},
"issue2": {
"title": "New MarkdownView",
"state": "CLOSED"
}
}
}
}
The trick to making this work is to:
FlatCache, so just reload feed with .list type changesReally, really excited about this. Makes consuming notifications so much easier!
I know you said not to use Apollo, but might be an idea to throw this Martijn as it could be pretty cool functionality on their side to group requests! (extremely powerful, and something they could do pretty easily with their infra!)
Overall support the idea
Good call, creating dynamic queries would be _amazing_.
Cc @martijnwalraven :)
Sent with GitHawk
We've experimented with various ways of doing query batching in Apollo Client, including dynamically constructing queries. Using dynamic queries had too many drawbacks however, so we've actually removed this from more recent versions. Instead, we recommend transport level batching, which is a simple way to send multiple queries in a single HTTP request. It does require server support however, so it may not be supported by the GitHub API.
Btw got a hack together locally! Going to add comment count as well as change the icon depending on status (there's a closed-issue icon).

Yesssss! Would it be possible to query for labels also (and show them, just like in repositories)? That would be perfect!
Sent with GitHawk
@BasThomas yup! that's a good followup. I added a comment count too (not sold on its position atm). Honestly this unlocks so many doors!