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

Function postAnalyticsHistoryQuery

packages/shared/src/graphql/posts.ts:1730–1751  ·  view source on GitHub ↗
({
  id,
  first = postAnalyticsHistoryLimit,
}: {
  id?: string;
  first?: number;
})

Source from the content-addressed store, hash-verified

1728 };
1729
1730export const postAnalyticsHistoryQuery = ({
1731 id,
1732 first = postAnalyticsHistoryLimit,
1733}: {
1734 id?: string;
1735 first?: number;
1736}) => {
1737 const postId = id ?? '';
1738
1739 return {
1740 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory],
1741 queryFn: async () => {
1742 const result = await gqlClient.request<{
1743 postAnalyticsHistory: Connection<PostAnalyticsHistory>;
1744 }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId });
1745
1746 return result.postAnalyticsHistory;
1747 },
1748 enabled: !!id,
1749 staleTime: StaleTime.Default,
1750 };
1751};
1752
1753/**
1754 * A bookmarked post follows its bookmark's read state, so marking it read or

Callers 2

ImpressionsChartFunction · 0.90
PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected