There isn't a field that sums downloadCount by release, or across releases, so the only option is to walk the graph and add them up yourself.
Release count is easier, as repository.releases has a totalCount, so you can get the total number of releases from that, and at least see whether pagination is a limit (where that totalCount is over 100). Pagination isn't so bad, here's an earlier answer I provided on that topic.
For a repo that has enough releases to need pagination. e.g.
this query:
query{
repository(owner: "microsoft", name: "typescript") {
releases(first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {
nodes {
releaseAssets(first: 10) {
nodes {
downloadCount
name
}
totalCount
}
name
}
totalCount
pageInfo {
endCursor
hasNextPage
}
}
}
}
ends with this response fragment:
"totalCount": 146,
"pageInfo": {
"endCursor": "Y3Vyc29yOnYyOpK5MjAxOC0wMi0xMlQyMTo0MDo1NyswMDowMM4Ak_Ha",
"hasNextPage": true
}
So there's another page with 46 more nodes on it, which you can get at with:
query{
repository(owner: "microsoft", name: "typescript") {
releases(first: 100, after: "Y3Vyc29yOnYyOpK5MjAxOC0wMi0xMlQyMTo0MDo1NyswMDowMM4Ak_Ha", orderBy: {field: CREATED_AT, direction: DESC}) {
...