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