({ id }: { id?: string })
| 1653 | }; |
| 1654 | |
| 1655 | export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => { |
| 1656 | const postId = id ?? ''; |
| 1657 | |
| 1658 | return { |
| 1659 | queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics], |
| 1660 | queryFn: async () => { |
| 1661 | const result = await gqlClient.request<{ |
| 1662 | postAnalytics: PostAnalytics; |
| 1663 | }>(POST_ANALYTICS_QUERY, { id: postId }); |
| 1664 | |
| 1665 | return result.postAnalytics; |
| 1666 | }, |
| 1667 | enabled: !!id, |
| 1668 | staleTime: StaleTime.Default, |
| 1669 | }; |
| 1670 | }; |
| 1671 | |
| 1672 | export const postAnalyticsHistoryLimit = 45; |
| 1673 |
no test coverage detected