|
@@ -9,16 +9,16 @@ import { OrionContext } from '../../types'
|
|
export const videoResolvers = (queryNodeSchema: GraphQLSchema): IResolvers<any, OrionContext> => ({
|
|
export const videoResolvers = (queryNodeSchema: GraphQLSchema): IResolvers<any, OrionContext> => ({
|
|
Query: {
|
|
Query: {
|
|
top10VideosThisWeek: async (parent, args, context, info) => {
|
|
top10VideosThisWeek: async (parent, args, context, info) => {
|
|
- const mostViewedVideosIds = getMostViewedVideosIds(context, { limit: 10, period: 7 })
|
|
|
|
|
|
+ const mostViewedVideosIds = getMostViewedVideosIds(context, { limit: 30, period: 7 })
|
|
const resolver = createResolver(queryNodeSchema, 'videos')
|
|
const resolver = createResolver(queryNodeSchema, 'videos')
|
|
const videos = await getDataWithIds(resolver, mostViewedVideosIds, parent, args, context, info)
|
|
const videos = await getDataWithIds(resolver, mostViewedVideosIds, parent, args, context, info)
|
|
- return sortEntities(videos, mostViewedVideosIds)
|
|
|
|
|
|
+ return sortEntities(videos, mostViewedVideosIds).slice(0, 10)
|
|
},
|
|
},
|
|
top10VideosThisMonth: async (parent, args, context, info) => {
|
|
top10VideosThisMonth: async (parent, args, context, info) => {
|
|
- const mostViewedVideosIds = getMostViewedVideosIds(context, { limit: 10, period: 30 })
|
|
|
|
|
|
+ const mostViewedVideosIds = getMostViewedVideosIds(context, { limit: 30, period: 30 })
|
|
const resolver = createResolver(queryNodeSchema, 'videos')
|
|
const resolver = createResolver(queryNodeSchema, 'videos')
|
|
const videos = await getDataWithIds(resolver, mostViewedVideosIds, parent, args, context, info)
|
|
const videos = await getDataWithIds(resolver, mostViewedVideosIds, parent, args, context, info)
|
|
- return sortEntities(videos, mostViewedVideosIds)
|
|
|
|
|
|
+ return sortEntities(videos, mostViewedVideosIds).slice(0, 10)
|
|
},
|
|
},
|
|
mostViewedVideosConnection: async (parent, args, context, info) => {
|
|
mostViewedVideosConnection: async (parent, args, context, info) => {
|
|
const mostViewedVideosIds = getMostViewedVideosIds(context, {
|
|
const mostViewedVideosIds = getMostViewedVideosIds(context, {
|