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

Function squadCategoryPreviewQueryOptions

packages/shared/src/graphql/squads.ts:613–628  ·  view source on GitHub ↗
(categoryId: string)

Source from the content-addressed store, hash-verified

611`;
612
613export const squadCategoryPreviewQueryOptions = (categoryId: string) => ({
614 queryKey: generateQueryKey(
615 RequestKey.Source,
616 undefined,
617 'category-preview',
618 categoryId,
619 ),
620 queryFn: async (): Promise<Pick<Squad, 'id' | 'name' | 'image'>[]> => {
621 const res = await gqlBatchRequest<{
622 sources: Connection<Pick<Squad, 'id' | 'name' | 'image'>>;
623 }>(SQUAD_CATEGORY_PREVIEW_QUERY, { categoryId, first: 3 });
624
625 return res.sources.edges.map(({ node }) => node);
626 },
627 staleTime: StaleTime.OneHour,
628});
629
630export const SQUAD_ANALYTICS_QUERY = gql`
631 query SquadAnalytics($sourceId: ID!) {

Callers 1

TopicTileFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected