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))
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)
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))
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)
def resolve_user_info(self, info, pk): user_pk = get_current_user(info.context) return get_user_info(user_pk, pk)
def mutate(root, info): user = get_current_user(info.context) message = logout(user) return Logout(message=message)