({ id }: { id?: string })
| 1500 | }; |
| 1501 | |
| 1502 | export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => { |
| 1503 | const postId = id ?? ''; |
| 1504 | |
| 1505 | return { |
| 1506 | queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics], |
| 1507 | queryFn: async () => { |
| 1508 | const result = await gqlClient.request<{ |
| 1509 | postAnalytics: PostAnalytics; |
| 1510 | }>(POST_ANALYTICS_QUERY, { id: postId }); |
| 1511 | |
| 1512 | return result.postAnalytics; |
| 1513 | }, |
| 1514 | enabled: !!id, |
| 1515 | staleTime: StaleTime.Default, |
| 1516 | }; |
| 1517 | }; |
| 1518 | |
| 1519 | export const postAnalyticsHistoryLimit = 45; |
| 1520 |
no test coverage detected