123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- import { gql } from 'apollo-server-express'
- import { EntityViewsInfo } from '../../src/entities/EntityViewsInfo'
- export const GET_VIDEO_VIEWS = gql`
- query GetVideoViews($videoId: ID!) {
- videoViews(videoId: $videoId) {
- id
- views
- }
- }
- `
- export const GET_MOST_VIEWED_VIDEOS = gql`
- query GetMostViewedVideos($timePeriodDays: Int!) {
- mostViewedVideos(timePeriodDays: $timePeriodDays) {
- id
- views
- }
- }
- `
- export const GET_MOST_VIEWED_VIDEOS_ALL_TIME = gql`
- query GetMostViewedVideosAllTime($limit: Int!) {
- mostViewedVideosAllTime(limit: $limit) {
- id
- views
- }
- }
- `
- export type GetVideoViews = {
- videoViews: EntityViewsInfo | null
- }
- export type GetMostViewedVideos = {
- mostViewedVideos: EntityViewsInfo[]
- }
- export type GetVideoViewsArgs = {
- videoId: string
- }
- export type GetMostViewedVideosArgs = {
- timePeriodDays: number
- }
- export type GetMostViewedVideosAllTimeArgs = {
- limit: number
- }
- export type GetMostViewedVideosAllTime = {
- mostViewedVideosAllTime: EntityViewsInfo[]
- }
- export const GET_CHANNEL_VIEWS = gql`
- query GetChannelViews($channelId: ID!) {
- channelViews(channelId: $channelId) {
- id
- views
- }
- }
- `
- export const GET_MOST_VIEWED_CHANNELS = gql`
- query GetMostViewedChannels($timePeriodDays: Int!) {
- mostViewedChannels(timePeriodDays: $timePeriodDays) {
- id
- views
- }
- }
- `
- export const GET_MOST_VIEWED_CHANNELS_ALL_TIME = gql`
- query GetMostViewedVideosAllTime($limit: Int!) {
- mostViewedChannelsAllTime(limit: $limit) {
- id
- views
- }
- }
- `
- export type GetChannelViews = {
- channelViews: EntityViewsInfo | null
- }
- export type GetMostViewedChannels = {
- mostViewedChannels: EntityViewsInfo[]
- }
- export type GetChannelViewsArgs = {
- channelId: string
- }
- export type GetMostViewedChannelsArgs = {
- timePeriodDays: number
- }
- export type GetMostViewedChannelsAllTimeArgs = {
- limit: number
- }
- export type GetMostViewedChannelsAllTime = {
- mostViewedChannelsAllTime: EntityViewsInfo[]
- }
- export const GET_MOST_VIEWED_CATEGORIES = gql`
- query GetMostViewedCategories($timePeriodDays: Int!) {
- mostViewedCategories(timePeriodDays: $timePeriodDays) {
- id
- views
- }
- }
- `
- export const GET_MOST_VIEWED_CATEGORIES_ALL_TIME = gql`
- query GetMostViewedVideosAllTime($limit: Int!) {
- mostViewedCategoriesAllTime(limit: $limit) {
- id
- views
- }
- }
- `
- export type GetMostViewedCategories = {
- mostViewedCategories: EntityViewsInfo[]
- }
- export type GetMostViewedCategoriesArgs = {
- timePeriodDays: number
- }
- export type GetMostViewedCategoriesAllTimeArgs = {
- limit: number
- }
- export type GetMostViewedCategoriesAllTime = {
- mostViewedCategoriesAllTime: EntityViewsInfo[]
- }
- export const ADD_VIDEO_VIEW = gql`
- mutation AddVideoView($videoId: ID!, $channelId: ID!, $categoryId: ID) {
- addVideoView(videoId: $videoId, channelId: $channelId, categoryId: $categoryId) {
- id
- views
- }
- }
- `
- export type AddVideoView = {
- addVideoView: EntityViewsInfo
- }
- export type AddVideoViewArgs = {
- videoId: string
- channelId: string
- categoryId?: string
- }
|