featuredContent.ts 1.9 KB

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