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

Function squadCategoryPreviewQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 1

TopicTileFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected