From 9b6559559c9ccb2cf5f186f244b8f8e0d0990017 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 25 Oct 2024 16:58:21 -0600 Subject: [PATCH] Use clearer names in the fields of GetUserRelationshipsMatching --- src/index.tsx | 41 ++++++++++++++++++++++++++--------------- src/operations/user.gql | 12 +++++++----- src/schema.gql | 13 +++++++++---- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 7dfad59..f0215f6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2166,7 +2166,7 @@ export type Query = { getShotsByIds: Array; getShotsWithMetadata: GetShotsResult; getUser?: Maybe; - getUserRelationshipsMatching: Array; + getUserRelationshipsMatching: UserRelationshipsResult; getUserTags: Array; getUserVideos: VideoHistoryGql; getUsernames: Array; @@ -2525,9 +2525,15 @@ export type UserPlayTimeGql = { export type UserRelationship = { __typename?: "UserRelationship"; - following: Scalars["Boolean"]["output"]; - follows: Scalars["Boolean"]["output"]; - user: UserGql; + toUser: UserGql; + toUserFollows: Scalars["Boolean"]["output"]; + toUserIsFollowedBy: Scalars["Boolean"]["output"]; +}; + +export type UserRelationshipsResult = { + __typename?: "UserRelationshipsResult"; + inquiringUser: UserGql; + relationships: Array; }; export type VideoFilterInput = { @@ -3143,12 +3149,15 @@ export type GetUserRelationshipsMatchingQueryVariables = Exact<{ export type GetUserRelationshipsMatchingQuery = { __typename?: "Query"; - getUserRelationshipsMatching: Array<{ - __typename?: "UserRelationship"; - follows: boolean; - following: boolean; - user: { __typename?: "UserGQL"; username: string; id: number }; - }>; + getUserRelationshipsMatching: { + __typename?: "UserRelationshipsResult"; + relationships: Array<{ + __typename?: "UserRelationship"; + toUserFollows: boolean; + toUserIsFollowedBy: boolean; + toUser: { __typename?: "UserGQL"; username: string; id: number }; + }>; + }; }; export type GetUserTagsQueryVariables = Exact<{ [key: string]: never }>; @@ -5137,12 +5146,14 @@ export const GetUserRelationshipsMatchingDocument = gql` limit: $limit after: $after ) { - user { - username - id + relationships { + toUser { + username + id + } + toUserFollows + toUserIsFollowedBy } - follows - following } } `; diff --git a/src/operations/user.gql b/src/operations/user.gql index adeb183..c79ae20 100644 --- a/src/operations/user.gql +++ b/src/operations/user.gql @@ -69,12 +69,14 @@ query getUserRelationshipsMatching( limit: $limit after: $after ) { - user { - username - id + relationships { + toUser { + username + id + } + toUserFollows + toUserIsFollowedBy } - follows - following } } diff --git a/src/schema.gql b/src/schema.gql index 3e03b03..870938c 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -40,7 +40,7 @@ type Query { matchString: String = null limit: Int = 100 after: String = null - ): [UserRelationship!]! + ): UserRelationshipsResult! getPlayTime(userId: Int!): UserPlayTimeGQL! getUserVideos( userId: Int = null @@ -554,10 +554,15 @@ input CreatedAfter @oneOf { createdAt: DateTime } +type UserRelationshipsResult { + inquiringUser: UserGQL! + relationships: [UserRelationship!]! +} + type UserRelationship { - user: UserGQL! - follows: Boolean! - following: Boolean! + toUser: UserGQL! + toUserFollows: Boolean! + toUserIsFollowedBy: Boolean! } type UserPlayTimeGQL {