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