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

Function postAnalyticsHistoryQuery

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

Source from the content-addressed store, hash-verified

1544};
1545
1546export const postAnalyticsHistoryQuery = ({
1547 id,
1548 first = postAnalyticsHistoryLimit,
1549}: {
1550 id?: string;
1551 first?: number;
1552}) => {
1553 const postId = id ?? '';
1554
1555 return {
1556 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory],
1557 queryFn: async () => {
1558 const result = await gqlClient.request<{
1559 postAnalyticsHistory: Connection<PostAnalyticsHistory>;
1560 }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId });
1561
1562 return result.postAnalyticsHistory;
1563 },
1564 enabled: !!id,
1565 staleTime: StaleTime.Default,
1566 };
1567};

Callers 1

ImpressionsChartFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected