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

Function postAnalyticsHistoryQuery

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

Source from the content-addressed store, hash-verified

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

Callers 1

ImpressionsChartFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected