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