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

Function postAnalyticsHistoryQuery

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

Source from the content-addressed store, hash-verified

1726 };
1727
1728export const postAnalyticsHistoryQuery = ({
1729 id,
1730 first = postAnalyticsHistoryLimit,
1731}: {
1732 id?: string;
1733 first?: number;
1734}) => {
1735 const postId = id ?? '';
1736
1737 return {
1738 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory],
1739 queryFn: async () => {
1740 const result = await gqlClient.request<{
1741 postAnalyticsHistory: Connection<PostAnalyticsHistory>;
1742 }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId });
1743
1744 return result.postAnalyticsHistory;
1745 },
1746 enabled: !!id,
1747 staleTime: StaleTime.Default,
1748 };
1749};
1750
1751/**
1752 * 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