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

Function postAnalyticsHistoryQuery

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

Source from the content-addressed store, hash-verified

1505};
1506
1507export const postAnalyticsHistoryQuery = ({
1508 id,
1509 first = postAnalyticsHistoryLimit,
1510}: {
1511 id?: string;
1512 first?: number;
1513}) => {
1514 const postId = id ?? '';
1515
1516 return {
1517 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory],
1518 queryFn: async () => {
1519 const result = await gqlClient.request<{
1520 postAnalyticsHistory: Connection<PostAnalyticsHistory>;
1521 }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId });
1522
1523 return result.postAnalyticsHistory;
1524 },
1525 enabled: !!id,
1526 staleTime: StaleTime.Default,
1527 };
1528};

Callers 1

ImpressionsChartFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected