Пример #1
0
 def resolve_my_followers(self, info, next_page):
     user_pk = get_current_user(info.context)
     users, next_page = get_user_followers_or_followings(
         'followers', user_pk, next_page)
     return MyFollowers(followers=users,
                        next_page=next_page,
                        size=len(users))
Пример #2
0
 def mutate(root, info, user_id_to_follow):
     user = get_current_user(info.context)
     message = follow(user, int(user_id_to_follow))
     return Follow(message=message)
Пример #3
0
 def resolve_my_unfollowers(self, info, next_page):
     user_pk = get_current_user(info.context)
     users = get_not_followers(user_pk)
     return MyUnfollowers(unfollowers=users,
                          next_page=None,
                          size=len(users))
Пример #4
0
 def resolve_user_feed(self, info, user_id, next_page):
     user_pk = get_current_user(info.context)
     return get_user_feed(user_pk, next_page)
Пример #5
0
 def resolve_user_info(self, info, pk):
     user_pk = get_current_user(info.context)
     return get_user_info(user_pk, pk)
Пример #6
0
 def mutate(root, info):
     user = get_current_user(info.context)
     message = logout(user)
     return Logout(message=message)