featuredContent.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import { gql } from 'apollo-server-express'
  2. import { FeaturedVideo, VideoHero } from '../../src/models/FeaturedContent'
  3. import { CategoryFeaturedVideos } from '../../src/entities/CategoryFeaturedVideos'
  4. export const GET_VIDEO_HERO = gql`
  5. query GetVideoHero {
  6. videoHero {
  7. heroTitle
  8. heroVideoCutUrl
  9. heroPosterUrl
  10. videoId
  11. }
  12. }
  13. `
  14. export type GetVideoHero = {
  15. videoHero: VideoHero | null
  16. }
  17. export const GET_CATEGORY_FEATURED_VIDEOS = gql`
  18. query GetCategoryFeaturedVideos($categoryId: ID!) {
  19. categoryFeaturedVideos(categoryId: $categoryId) {
  20. videoCutUrl
  21. videoId
  22. }
  23. }
  24. `
  25. export type GetCategoryFeaturedVideos = {
  26. categoryFeaturedVideos: {
  27. videoId: string
  28. videoCutUrl: string
  29. }
  30. }
  31. export type GetCategoryFeaturedVideosArgs = {
  32. categoryId: string
  33. }
  34. export type GetAllCategoriesFeaturedVideosArgs = {
  35. videosLimit: number
  36. }
  37. export const GET_ALL_CATEGORIES_FEATURED_VIDEOS = gql`
  38. query GetAllCategoriesFeaturedVideos($videosLimit: Int!) {
  39. allCategoriesFeaturedVideos(videosLimit: $videosLimit) {
  40. categoryId
  41. categoryFeaturedVideos {
  42. videoId
  43. videoCutUrl
  44. }
  45. }
  46. }
  47. `
  48. export type GetAllCategoriesFeaturedVideos = {
  49. allCategoriesFeaturedVideos: CategoryFeaturedVideos[] | null
  50. }
  51. export const SET_VIDEO_HERO = gql`
  52. mutation SetVideoHero($newVideoHero: VideoHeroInput!) {
  53. setVideoHero(newVideoHero: $newVideoHero) {
  54. videoId
  55. heroTitle
  56. heroVideoCutUrl
  57. heroPosterUrl
  58. }
  59. }
  60. `
  61. export type SetVideoHero = {
  62. setVideoHero: VideoHero
  63. }
  64. export type SetVideoHeroArgs = {
  65. newVideoHero: {
  66. videoId: string
  67. heroTitle: string
  68. heroVideoCutUrl: string
  69. heroPosterUrl: string
  70. }
  71. }
  72. export const SET_CATEGORY_FEATURED_VIDEOS = gql`
  73. mutation SetCategoryFeaturedVideos($categoryId: ID!, $videos: [FeaturedVideoInput!]!) {
  74. setCategoryFeaturedVideos(categoryId: $categoryId, videos: $videos) {
  75. videoId
  76. videoCutUrl
  77. }
  78. }
  79. `
  80. export type SetCategoryFeaturedVideos = {
  81. setCategoryFeaturedVideos: FeaturedVideo[]
  82. }
  83. export type SetCategoryFeaturedVideosArgs = {
  84. categoryId: string
  85. videos: FeaturedVideo[]
  86. }