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

Function similarSquadsQueryOptions

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

Source from the content-addressed store, hash-verified

534`;
535
536export 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.

Callers 1

useSimilarSquadsFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected