Do you guys know when other query aggregations wil...
# orm-help
j
Do you guys know when other query aggregations will come in prisma? I need to have like an AVG of all the rates a topic has and show it and wanted to do it from the server without using resource on the client to calculate it since i'm working on a mobile app. Was messing around and thought on something like this
Copy code
getUserRateAverage(parent, args, ctx, info) { 
    let rates = ctx.db.query.rates({}, info);
    let sum = 0;
    for (let i = 0; i < rates.length; i++) {
      sum += rates[i];
    }

    return rates.length != null ? sum / rates.length : 0;
  },
but don't know if this is even legit hahahaha, really new with GraphQL and Prisma. Let me know!