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