import { useCache } from '../caching' ; import { RequestContext , SurveyConfig } from '../types' ; import { getSurveyTotals } from '../compute/generic' ; export default { Totals : { all_years : async ( survey , args , { db } ) => useCache ( getSurveyTotals , db , [ survey ] ) , year : async ( survey , { year } , { db } ) => useCache ( getSurveyTotals , db , [ survey , year ] ) } } ;