({ id }: { id?: string })
| 1469 | }; |
| 1470 | |
| 1471 | export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => { |
| 1472 | const postId = id ?? ''; |
| 1473 | |
| 1474 | return { |
| 1475 | queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics], |
| 1476 | queryFn: async () => { |
| 1477 | const result = await gqlClient.request<{ |
| 1478 | postAnalytics: PostAnalytics; |
| 1479 | }>(POST_ANALYTICS_QUERY, { id: postId }); |
| 1480 | |
| 1481 | return result.postAnalytics; |
| 1482 | }, |
| 1483 | enabled: !!id, |
| 1484 | staleTime: StaleTime.Default, |
| 1485 | }; |
| 1486 | }; |
| 1487 | |
| 1488 | export const postAnalyticsHistoryLimit = 45; |
| 1489 |
no test coverage detected