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