Add isFollowedByCurrentUser field and hasFollowing to feed query
All checks were successful
Tests / Tests (pull_request) Successful in 9s
All checks were successful
Tests / Tests (pull_request) Successful in 9s
Updated GraphQL operations to support efficient follow status checking: - Added isFollowedByCurrentUser field to UserSocialsFields fragment - Removed nested followers array from UserSocialsFields (over-fetching) - Simplified followUser/unfollowUser mutations to return minimal data - Added hasFollowing field to GetVideoFeed query for feed mode detection - Updated getUserFollowingFollowers query to include isFollowedByCurrentUser These changes enable the mobile app to: - Display correct follow/unfollow button states without client-side lookups - Differentiate between "Following" and "Popular" feed modes - Reduce payload size by removing unnecessary nested data Backend handles efficient resolution via request-scoped caching. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -88,31 +88,15 @@ query GetUserTags {
|
||||
|
||||
mutation followUser($followedUserId: Int!) {
|
||||
followUser(followedUserId: $followedUserId) {
|
||||
username
|
||||
id
|
||||
following {
|
||||
id
|
||||
username
|
||||
}
|
||||
followers {
|
||||
id
|
||||
username
|
||||
}
|
||||
username
|
||||
}
|
||||
}
|
||||
|
||||
mutation unfollowUser($followedUserId: Int!) {
|
||||
unfollowUser(followedUserId: $followedUserId) {
|
||||
username
|
||||
id
|
||||
following {
|
||||
id
|
||||
username
|
||||
}
|
||||
followers {
|
||||
id
|
||||
username
|
||||
}
|
||||
username
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,11 +107,13 @@ query getUserFollowingFollowers {
|
||||
id
|
||||
username
|
||||
profileImageUri
|
||||
isFollowedByCurrentUser
|
||||
}
|
||||
followers {
|
||||
id
|
||||
username
|
||||
profileImageUri
|
||||
isFollowedByCurrentUser
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user