Add getUsernames operation

This commit is contained in:
Ivan Malison 2024-07-14 00:16:02 -06:00
parent 235f4a58e9
commit d669dba320
2 changed files with 96 additions and 0 deletions

View File

@ -1384,6 +1384,17 @@ export type GetUserPlayTimeQuery = {
getPlayTime: { __typename?: "UserPlayTimeGQL"; totalSeconds: number }; getPlayTime: { __typename?: "UserPlayTimeGQL"; totalSeconds: number };
}; };
export type GetUsernamesQueryVariables = Exact<{
matchString: Scalars["String"]["input"];
limit?: InputMaybe<Scalars["Int"]["input"]>;
after?: InputMaybe<Scalars["String"]["input"]>;
}>;
export type GetUsernamesQuery = {
__typename?: "Query";
getUsernames: Array<string>;
};
export type GetStreamMonitoringDetailsQueryVariables = Exact<{ export type GetStreamMonitoringDetailsQueryVariables = Exact<{
videoId: Scalars["Int"]["input"]; videoId: Scalars["Int"]["input"];
}>; }>;
@ -2397,6 +2408,83 @@ export type GetUserPlayTimeQueryResult = Apollo.QueryResult<
GetUserPlayTimeQuery, GetUserPlayTimeQuery,
GetUserPlayTimeQueryVariables 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<GetUsernamesQuery, GetUsernamesQueryVariables>(
GetUsernamesDocument,
options,
);
}
export function useGetUsernamesLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetUsernamesQuery,
GetUsernamesQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<GetUsernamesQuery, GetUsernamesQueryVariables>(
GetUsernamesDocument,
options,
);
}
export function useGetUsernamesSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetUsernamesQuery,
GetUsernamesQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<GetUsernamesQuery, GetUsernamesQueryVariables>(
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` export const GetStreamMonitoringDetailsDocument = gql`
query GetStreamMonitoringDetails($videoId: Int!) { query GetStreamMonitoringDetails($videoId: Int!) {
getVideo(videoId: $videoId) { getVideo(videoId: $videoId) {

View File

@ -37,3 +37,11 @@ query GetUserPlayTime($userId: Int!) {
totalSeconds totalSeconds
} }
} }
query getUsernames(
$matchString: String!
$limit: Int = null
$after: String = null
) {
getUsernames(matchString: $matchString, limit: $limit, after: $after)
}