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