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

Function postAnalyticsQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 2

useSquadFreeBoostFunction · 0.90
PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected