Based on this talk: https://www.youtube.com/watch?v=srfaKA2wJ0s
I would like to implement an analytics/time series query in GraphQL like
query {
sales(date: { start: ‘2017-01-01’, end: ‘2018-01-01’ }) {
revenue(stat: mean)
daily: interval(by: day) {
date
revenue
}
}
}
revenue(stat: mean) is an aggregation based on one statistic (mean in this case) daily is a list of data points by hour/day/month
How to implement this using mongodb, or postgresql/mysql databases in a performant way?