Closed Siphon880gh closed 3 years ago
Solved: The profile's Followers list is part of the profile user's state that was queried from graphQL. The querying is done with useQuery.
I exposed the refetch method from useQuery then have useEffect called it whenever the amIAFollower state changed, and the amIAFollower state changed based on the user following or unfollowing by clicking the Follow/Unfollow button.
let { loading, data: user, refetch } = useQuery(userParam ? GET_USER : GET_ME, {
variables: { username: userParam },
});
useEffect(() => {
refetch();
}, [amIAFollower])
See title