follows.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { gql } from 'apollo-server-express'
  2. import { ChannelFollowsInfo } from '../../src/entities/ChannelFollowsInfo'
  3. import { ChannelConnection } from '../../src/types'
  4. export const GET_MOST_FOLLOWED_CHANNELS_CONNECTION = gql`
  5. query GetMostFollowedChannelsConnection($periodDays: Int, $limit: Int!) {
  6. mostFollowedChannelsConnection(periodDays: $periodDays, limit: $limit) {
  7. edges {
  8. node {
  9. id
  10. follows
  11. }
  12. }
  13. }
  14. }
  15. `
  16. export type GetMostFollowedChannelsConnection = {
  17. mostFollowedChannelsConnection: ChannelConnection
  18. }
  19. export type GetMostFollowedChannelsConnectionArgs = {
  20. periodDays: number | null
  21. limit: number
  22. }
  23. export const FOLLOW_CHANNEL = gql`
  24. mutation FollowChannel($channelId: ID!) {
  25. followChannel(channelId: $channelId) {
  26. id
  27. follows
  28. }
  29. }
  30. `
  31. export const UNFOLLOW_CHANNEL = gql`
  32. mutation FollowChannel($channelId: ID!) {
  33. unfollowChannel(channelId: $channelId) {
  34. id
  35. follows
  36. }
  37. }
  38. `
  39. export type FollowChannel = {
  40. followChannel: ChannelFollowsInfo
  41. }
  42. export type FollowChannelArgs = {
  43. channelId: string
  44. }
  45. export type UnfollowChannel = {
  46. unfollowChannel: ChannelFollowsInfo
  47. }
  48. export type UnfollowChannelArgs = FollowChannelArgs