# CHANGE: Removed because unused
# query GetBasicVideo(...) { ... }

query GetFullVideo($id: String!) {
  # CHANGE: Replacement for `videoByUniqueInput`, which is no longer available
  videoById(id: $id) {
    ...FullVideoFields
  }
}

# No changes
query GetBasicVideosConnection(
  $first: Int
  $after: String
  $orderBy: [VideoOrderByInput!] = [createdAt_DESC]
  $where: VideoWhereInput
) {
  videosConnection(first: $first, after: $after, where: $where, orderBy: $orderBy) {
    edges {
      cursor
      node {
        ...BasicVideoFields
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}

# No changes
query GetFullVideosConnection(
  $first: Int
  $after: String
  $orderBy: [VideoOrderByInput!] = [createdAt_DESC]
  $where: VideoWhereInput
) {
  videosConnection(first: $first, after: $after, where: $where, orderBy: $orderBy) {
    edges {
      cursor
      node {
        ...FullVideoFields
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}

# No changes
query GetBasicVideos(
  $offset: Int
  $limit: Int
  $where: VideoWhereInput
  $orderBy: [VideoOrderByInput!] = [createdAt_DESC]
) {
  videos(offset: $offset, limit: $limit, where: $where, orderBy: $orderBy) {
    ...BasicVideoFields
  }
}

# No changes
query GetFullVideos(
  $offset: Int
  $limit: Int
  $where: VideoWhereInput
  $orderBy: [VideoOrderByInput!] = [createdAt_DESC]
) {
  videos(offset: $offset, limit: $limit, where: $where, orderBy: $orderBy) {
    ...FullVideoFields
  }
}

# No changes
query GetMostViewedVideosConnection(
  $limit: Int = 50
  $periodDays: Int
  $first: Int
  $after: String
  $orderBy: [VideoOrderByInput!] = [createdAt_DESC]
  $where: VideoWhereInput
) {
  mostViewedVideosConnection(
    limit: $limit
    first: $first
    after: $after
    periodDays: $periodDays
    orderBy: $orderBy
    where: $where
  ) {
    edges {
      cursor
      node {
        ...BasicVideoFields
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}

query GetVideosCount($where: VideoWhereInput) {
  videosConnection(where: $where, orderBy: [createdAt_ASC]) {
    totalCount
  }
}

# CHANGE: `channelId` and `categoryId` args were removed, ID is now `String`
mutation AddVideoView($videoId: String!) {
  addVideoView(videoId: $videoId) {
    videoId
    viewsNum
  }
}

# CHANGE: ID is now `String`
mutation ReportVideo($videoId: String!, $rationale: String!) {
  reportVideo(videoId: $videoId, rationale: $rationale) {
    id
    videoId
  }
}
