({
id,
first = postAnalyticsHistoryLimit,
}: {
id?: string;
first?: number;
})
| 1726 | }; |
| 1727 | |
| 1728 | export const postAnalyticsHistoryQuery = ({ |
| 1729 | id, |
| 1730 | first = postAnalyticsHistoryLimit, |
| 1731 | }: { |
| 1732 | id?: string; |
| 1733 | first?: number; |
| 1734 | }) => { |
| 1735 | const postId = id ?? ''; |
| 1736 | |
| 1737 | return { |
| 1738 | queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory], |
| 1739 | queryFn: async () => { |
| 1740 | const result = await gqlClient.request<{ |
| 1741 | postAnalyticsHistory: Connection<PostAnalyticsHistory>; |
| 1742 | }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId }); |
| 1743 | |
| 1744 | return result.postAnalyticsHistory; |
| 1745 | }, |
| 1746 | enabled: !!id, |
| 1747 | staleTime: StaleTime.Default, |
| 1748 | }; |
| 1749 | }; |
| 1750 | |
| 1751 | /** |
| 1752 | * A bookmarked post follows its bookmark's read state, so marking it read or |
no test coverage detected