featuredContent.ts 2.0 KB

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