From 9d8155527dd4443ac05e4621021daa12a0155132 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Wed, 30 Oct 2024 16:18:25 -0600 Subject: [PATCH] Use getUser for getting followers --- src/index.tsx | 13 ++++++------- src/operations/user.gql | 5 ++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index d9b90e9..74bf86a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3202,14 +3202,13 @@ export type UnfollowUserMutation = { }; export type GetUserFollowingFollowersQueryVariables = Exact<{ - [key: string]: never; + userId: Scalars["Int"]["input"]; }>; export type GetUserFollowingFollowersQuery = { __typename?: "Query"; - getLoggedInUser?: { + getUser?: { __typename?: "UserGQL"; - id: number; following?: Array<{ __typename?: "UserGQL"; id: number; @@ -5475,9 +5474,8 @@ export type UnfollowUserMutationOptions = Apollo.BaseMutationOptions< UnfollowUserMutationVariables >; export const GetUserFollowingFollowersDocument = gql` - query getUserFollowingFollowers { - getLoggedInUser { - id + query getUserFollowingFollowers($userId: Int!) { + getUser(userId: $userId) { following { id username @@ -5502,11 +5500,12 @@ export const GetUserFollowingFollowersDocument = gql` * @example * const { data, loading, error } = useGetUserFollowingFollowersQuery({ * variables: { + * userId: // value for 'userId' * }, * }); */ export function useGetUserFollowingFollowersQuery( - baseOptions?: Apollo.QueryHookOptions< + baseOptions: Apollo.QueryHookOptions< GetUserFollowingFollowersQuery, GetUserFollowingFollowersQueryVariables >, diff --git a/src/operations/user.gql b/src/operations/user.gql index 173e67b..832afe6 100644 --- a/src/operations/user.gql +++ b/src/operations/user.gql @@ -112,9 +112,8 @@ mutation unfollowUser($followedUserId: Int!) { } } -query getUserFollowingFollowers { - getLoggedInUser { - id +query getUserFollowingFollowers($userId: Int!) { + getUser(userId: $userId) { following { id username -- 2.46.1