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

Function similarSquadsQueryOptions

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

Source from the content-addressed store, hash-verified

543`;
544
545export 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.

Callers 1

useSimilarSquadsFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected