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

Function squadCategoryPreviewQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 1

TopicTileFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected