({
id,
first = postAnalyticsHistoryLimit,
}: {
id?: string;
first?: number;
})
| 1544 | }; |
| 1545 | |
| 1546 | export const postAnalyticsHistoryQuery = ({ |
| 1547 | id, |
| 1548 | first = postAnalyticsHistoryLimit, |
| 1549 | }: { |
| 1550 | id?: string; |
| 1551 | first?: number; |
| 1552 | }) => { |
| 1553 | const postId = id ?? ''; |
| 1554 | |
| 1555 | return { |
| 1556 | queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory], |
| 1557 | queryFn: async () => { |
| 1558 | const result = await gqlClient.request<{ |
| 1559 | postAnalyticsHistory: Connection<PostAnalyticsHistory>; |
| 1560 | }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId }); |
| 1561 | |
| 1562 | return result.postAnalyticsHistory; |
| 1563 | }, |
| 1564 | enabled: !!id, |
| 1565 | staleTime: StaleTime.Default, |
| 1566 | }; |
| 1567 | }; |
no test coverage detected