From d669dba320863a62ea3111862691777f6ff0efd8 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 14 Jul 2024 00:16:02 -0600 Subject: [PATCH] Add getUsernames operation --- src/index.tsx | 88 +++++++++++++++++++++++++++++++++++++++++ src/operations/user.gql | 8 ++++ 2 files changed, 96 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 7abcbaa..a007ee3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1384,6 +1384,17 @@ export type GetUserPlayTimeQuery = { getPlayTime: { __typename?: "UserPlayTimeGQL"; totalSeconds: number }; }; +export type GetUsernamesQueryVariables = Exact<{ + matchString: Scalars["String"]["input"]; + limit?: InputMaybe; + after?: InputMaybe; +}>; + +export type GetUsernamesQuery = { + __typename?: "Query"; + getUsernames: Array; +}; + export type GetStreamMonitoringDetailsQueryVariables = Exact<{ videoId: Scalars["Int"]["input"]; }>; @@ -2397,6 +2408,83 @@ export type GetUserPlayTimeQueryResult = Apollo.QueryResult< GetUserPlayTimeQuery, GetUserPlayTimeQueryVariables >; +export const GetUsernamesDocument = gql` + query getUsernames( + $matchString: String! + $limit: Int = null + $after: String = null + ) { + getUsernames(matchString: $matchString, limit: $limit, after: $after) + } +`; + +/** + * __useGetUsernamesQuery__ + * + * To run a query within a React component, call `useGetUsernamesQuery` and pass it any options that fit your needs. + * When your component renders, `useGetUsernamesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetUsernamesQuery({ + * variables: { + * matchString: // value for 'matchString' + * limit: // value for 'limit' + * after: // value for 'after' + * }, + * }); + */ +export function useGetUsernamesQuery( + baseOptions: Apollo.QueryHookOptions< + GetUsernamesQuery, + GetUsernamesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GetUsernamesDocument, + options, + ); +} +export function useGetUsernamesLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetUsernamesQuery, + GetUsernamesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + GetUsernamesDocument, + options, + ); +} +export function useGetUsernamesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetUsernamesQuery, + GetUsernamesQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + GetUsernamesDocument, + options, + ); +} +export type GetUsernamesQueryHookResult = ReturnType< + typeof useGetUsernamesQuery +>; +export type GetUsernamesLazyQueryHookResult = ReturnType< + typeof useGetUsernamesLazyQuery +>; +export type GetUsernamesSuspenseQueryHookResult = ReturnType< + typeof useGetUsernamesSuspenseQuery +>; +export type GetUsernamesQueryResult = Apollo.QueryResult< + GetUsernamesQuery, + GetUsernamesQueryVariables +>; export const GetStreamMonitoringDetailsDocument = gql` query GetStreamMonitoringDetails($videoId: Int!) { getVideo(videoId: $videoId) { diff --git a/src/operations/user.gql b/src/operations/user.gql index b63b767..841767f 100644 --- a/src/operations/user.gql +++ b/src/operations/user.gql @@ -37,3 +37,11 @@ query GetUserPlayTime($userId: Int!) { totalSeconds } } + +query getUsernames( + $matchString: String! + $limit: Int = null + $after: String = null +) { + getUsernames(matchString: $matchString, limit: $limit, after: $after) +}