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

Function postAnalyticsQueryOptions

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

Source from the content-addressed store, hash-verified

1653};
1654
1655export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => {
1656 const postId = id ?? '';
1657
1658 return {
1659 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics],
1660 queryFn: async () => {
1661 const result = await gqlClient.request<{
1662 postAnalytics: PostAnalytics;
1663 }>(POST_ANALYTICS_QUERY, { id: postId });
1664
1665 return result.postAnalytics;
1666 },
1667 enabled: !!id,
1668 staleTime: StaleTime.Default,
1669 };
1670};
1671
1672export const postAnalyticsHistoryLimit = 45;
1673

Callers 1

PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected