({
id,
first = postAnalyticsHistoryLimit,
}: {
id?: string;
first?: number;
})
| 1550 | }; |
| 1551 | |
| 1552 | export 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 | }; |
no test coverage detected