({ id }: { id?: string })
| 1478 | }; |
| 1479 | |
| 1480 | export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => { |
| 1481 | const postId = id ?? ''; |
| 1482 | |
| 1483 | return { |
| 1484 | queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics], |
| 1485 | queryFn: async () => { |
| 1486 | const result = await gqlClient.request<{ |
| 1487 | postAnalytics: PostAnalytics; |
| 1488 | }>(POST_ANALYTICS_QUERY, { id: postId }); |
| 1489 | |
| 1490 | return result.postAnalytics; |
| 1491 | }, |
| 1492 | enabled: !!id, |
| 1493 | staleTime: StaleTime.Default, |
| 1494 | }; |
| 1495 | }; |
| 1496 | |
| 1497 | export const postAnalyticsHistoryLimit = 45; |
| 1498 |
no test coverage detected