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

Function postAnalyticsHistoryQuery

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

Source from the content-addressed store, hash-verified

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

Callers 1

ImpressionsChartFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected