Compare commits

...

3 Commits

Author SHA1 Message Date
de9d47c289 Merge branch 'master' into loewy/annotations-return
All checks were successful
Tests / Tests (pull_request) Successful in 8s
2024-10-24 10:53:02 -06:00
39b1808cab Merge pull request 'Create get usernames and followers operation' (#85) from kat/add-get-usernames-following-operation into master
Reviewed-on: #85
2024-10-24 09:19:38 -06:00
f573026853 Create get usernames and followers operation
All checks were successful
Tests / Tests (pull_request) Successful in 15s
2024-10-23 17:04:25 -06:00
2 changed files with 123 additions and 0 deletions

View File

@ -3131,6 +3131,23 @@ export type GetUsernamesQuery = {
getUsernames: Array<string>;
};
export type GetUsernamesAndFollowingQueryVariables = Exact<{
userId: Scalars["Int"]["input"];
matchString: Scalars["String"]["input"];
limit?: InputMaybe<Scalars["Int"]["input"]>;
after?: InputMaybe<Scalars["String"]["input"]>;
}>;
export type GetUsernamesAndFollowingQuery = {
__typename?: "Query";
getUsernamesAndFollowing: {
__typename?: "UsernamesAndFollowingResponse";
followers: Array<number>;
following: Array<number>;
usernames: Array<string>;
};
};
export type GetUserTagsQueryVariables = Exact<{ [key: string]: never }>;
export type GetUserTagsQuery = {
@ -5102,6 +5119,94 @@ export type GetUsernamesQueryResult = Apollo.QueryResult<
GetUsernamesQuery,
GetUsernamesQueryVariables
>;
export const GetUsernamesAndFollowingDocument = gql`
query getUsernamesAndFollowing(
$userId: Int!
$matchString: String!
$limit: Int = null
$after: String = null
) {
getUsernamesAndFollowing(
userId: $userId
matchString: $matchString
limit: $limit
after: $after
) {
followers
following
usernames
}
}
`;
/**
* __useGetUsernamesAndFollowingQuery__
*
* To run a query within a React component, call `useGetUsernamesAndFollowingQuery` and pass it any options that fit your needs.
* When your component renders, `useGetUsernamesAndFollowingQuery` 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 } = useGetUsernamesAndFollowingQuery({
* variables: {
* userId: // value for 'userId'
* matchString: // value for 'matchString'
* limit: // value for 'limit'
* after: // value for 'after'
* },
* });
*/
export function useGetUsernamesAndFollowingQuery(
baseOptions: Apollo.QueryHookOptions<
GetUsernamesAndFollowingQuery,
GetUsernamesAndFollowingQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetUsernamesAndFollowingQuery,
GetUsernamesAndFollowingQueryVariables
>(GetUsernamesAndFollowingDocument, options);
}
export function useGetUsernamesAndFollowingLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetUsernamesAndFollowingQuery,
GetUsernamesAndFollowingQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetUsernamesAndFollowingQuery,
GetUsernamesAndFollowingQueryVariables
>(GetUsernamesAndFollowingDocument, options);
}
export function useGetUsernamesAndFollowingSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetUsernamesAndFollowingQuery,
GetUsernamesAndFollowingQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetUsernamesAndFollowingQuery,
GetUsernamesAndFollowingQueryVariables
>(GetUsernamesAndFollowingDocument, options);
}
export type GetUsernamesAndFollowingQueryHookResult = ReturnType<
typeof useGetUsernamesAndFollowingQuery
>;
export type GetUsernamesAndFollowingLazyQueryHookResult = ReturnType<
typeof useGetUsernamesAndFollowingLazyQuery
>;
export type GetUsernamesAndFollowingSuspenseQueryHookResult = ReturnType<
typeof useGetUsernamesAndFollowingSuspenseQuery
>;
export type GetUsernamesAndFollowingQueryResult = Apollo.QueryResult<
GetUsernamesAndFollowingQuery,
GetUsernamesAndFollowingQueryVariables
>;
export const GetUserTagsDocument = gql`
query GetUserTags {
getUserTags {

View File

@ -57,6 +57,24 @@ query getUsernames(
getUsernames(matchString: $matchString, limit: $limit, after: $after)
}
query getUsernamesAndFollowing(
$userId: Int!
$matchString: String!
$limit: Int = null
$after: String = null
) {
getUsernamesAndFollowing(
userId: $userId
matchString: $matchString
limit: $limit
after: $after
) {
followers
following
usernames
}
}
query GetUserTags {
getUserTags {
id