({
squadId,
user,
limit,
}: {
squadId: string;
user?: Pick<LoggedUser, 'id'>;
limit: number;
})
| 531 | `; |
| 532 | |
| 533 | export const similarSquadsQueryOptions = ({ |
| 534 | squadId, |
| 535 | user, |
| 536 | limit, |
| 537 | }: { |
| 538 | squadId: string; |
| 539 | user?: Pick<LoggedUser, 'id'>; |
| 540 | limit: number; |
| 541 | }) => ({ |
| 542 | queryKey: generateQueryKey(RequestKey.SimilarSquads, user, squadId, limit), |
| 543 | queryFn: async (): Promise<Squad[]> => { |
| 544 | const res = await gqlBatchRequest<{ similarSquads: Squad[] }>( |
| 545 | SIMILAR_SQUADS_QUERY, |
| 546 | { sourceId: squadId, limit }, |
| 547 | ); |
| 548 | |
| 549 | return res.similarSquads; |
| 550 | }, |
| 551 | staleTime: StaleTime.OneHour, |
| 552 | }); |
| 553 | |
| 554 | // Boot carries the viewer's squads without their member counts, to stay small, |
| 555 | // so My Squads fetches just the counts on top of it. |
no test coverage detected