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

Function postAnalyticsQueryOptions

packages/shared/src/graphql/posts.ts:1480–1495  ·  view source on GitHub ↗
({ id }: { id?: string })

Source from the content-addressed store, hash-verified

1478};
1479
1480export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => {
1481 const postId = id ?? '';
1482
1483 return {
1484 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics],
1485 queryFn: async () => {
1486 const result = await gqlClient.request<{
1487 postAnalytics: PostAnalytics;
1488 }>(POST_ANALYTICS_QUERY, { id: postId });
1489
1490 return result.postAnalytics;
1491 },
1492 enabled: !!id,
1493 staleTime: StaleTime.Default,
1494 };
1495};
1496
1497export const postAnalyticsHistoryLimit = 45;
1498

Callers 1

PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected