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

Function postAnalyticsQueryOptions

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

Source from the content-addressed store, hash-verified

1469};
1470
1471export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => {
1472 const postId = id ?? '';
1473
1474 return {
1475 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics],
1476 queryFn: async () => {
1477 const result = await gqlClient.request<{
1478 postAnalytics: PostAnalytics;
1479 }>(POST_ANALYTICS_QUERY, { id: postId });
1480
1481 return result.postAnalytics;
1482 },
1483 enabled: !!id,
1484 staleTime: StaleTime.Default,
1485 };
1486};
1487
1488export const postAnalyticsHistoryLimit = 45;
1489

Callers 1

PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected