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

Function postAnalyticsHistoryQuery

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

Source from the content-addressed store, hash-verified

1520};
1521
1522export const postAnalyticsHistoryQuery = ({
1523 id,
1524 first = postAnalyticsHistoryLimit,
1525}: {
1526 id?: string;
1527 first?: number;
1528}) => {
1529 const postId = id ?? '';
1530
1531 return {
1532 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory],
1533 queryFn: async () => {
1534 const result = await gqlClient.request<{
1535 postAnalyticsHistory: Connection<PostAnalyticsHistory>;
1536 }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId });
1537
1538 return result.postAnalyticsHistory;
1539 },
1540 enabled: !!id,
1541 staleTime: StaleTime.Default,
1542 };
1543};

Callers 1

ImpressionsChartFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected