featuredContent.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. videoId
  21. videoCutUrl
  22. }
  23. }
  24. `
  25. export type GetCategoryFeaturedVideos = {
  26. categoryFeaturedVideos: FeaturedVideo[] | null
  27. }
  28. export type GetCategoryFeaturedVideosArgs = {
  29. categoryId: string
  30. }
  31. export const GET_ALL_CATEGORIES_FEATURED_VIDEOS = gql`
  32. query GetAllCategoriesFeaturedVideos {
  33. allCategoriesFeaturedVideos {
  34. categoryId
  35. videos {
  36. videoId
  37. videoCutUrl
  38. }
  39. }
  40. }
  41. `
  42. export type GetAllCategoriesFeaturedVideos = {
  43. allCategoriesFeaturedVideos: CategoryFeaturedVideos[] | null
  44. }
  45. export const SET_VIDEO_HERO = gql`
  46. mutation SetVideoHero($newVideoHero: VideoHeroInput!) {
  47. setVideoHero(newVideoHero: $newVideoHero) {
  48. videoId
  49. heroTitle
  50. heroVideoCutUrl
  51. heroPosterUrl
  52. }
  53. }
  54. `
  55. export type SetVideoHero = {
  56. setVideoHero: VideoHero
  57. }
  58. export type SetVideoHeroArgs = {
  59. newVideoHero: {
  60. videoId: string
  61. heroTitle: string
  62. heroVideoCutUrl: string
  63. heroPosterUrl: string
  64. }
  65. }
  66. export const SET_CATEGORY_FEATURED_VIDEOS = gql`
  67. mutation SetCategoryFeaturedVideos($categoryId: ID!, $videos: [FeaturedVideoInput!]!) {
  68. setCategoryFeaturedVideos(categoryId: $categoryId, videos: $videos) {
  69. videoId
  70. videoCutUrl
  71. }
  72. }
  73. `
  74. export type SetCategoryFeaturedVideos = {
  75. setCategoryFeaturedVideos: FeaturedVideo[]
  76. }
  77. export type SetCategoryFeaturedVideosArgs = {
  78. categoryId: string
  79. videos: FeaturedVideo[]
  80. }