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

Function postAnalyticsHistoryQuery

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

Source from the content-addressed store, hash-verified

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

Callers 1

ImpressionsChartFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected