databio / bedhost

API and UI for BEDbase
http://api.bedbase.org
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Maybe add an endpoint just return the number of bedfiles of a given the bedset #45

Closed xuebingjie1990 closed 3 years ago

xuebingjie1990 commented 3 years ago

If we want to show the total number of bed files in each bedset in the bedset query results table, that's the only way to get the number for now.

Maybe we want that to be pre-computed and stored in the database with the bedset metadata... Or, create a separate endpoint that counts it with COUNT on the back-end. You are correct that retrieving them all, and then counting them is the Wrong Way™.

Originally posted by @nsheff in https://github.com/databio/bedhost-ui/issues/9#issuecomment-782524497

xuebingjie1990 commented 3 years ago

with GraphQL:

{
  bedsets (filters:{md5sum:"48a1a8c1476fecb1961894f81d1afadd"}){
    edges {
      node {
        bedfiles{
          totalCount
        }
      }
    }
  }
}