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