MCPcopy Create free account
hub / github.com/dailydotdev/apps / similarSquadsQueryOptions

Function similarSquadsQueryOptions

packages/shared/src/graphql/squads.ts:533–552  ·  view source on GitHub ↗
({
  squadId,
  user,
  limit,
}: {
  squadId: string;
  user?: Pick<LoggedUser, 'id'>;
  limit: number;
})

Source from the content-addressed store, hash-verified

531`;
532
533export 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.

Callers 1

useSimilarSquadsFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected