({
id,
first = postAnalyticsHistoryLimit,
}: {
id?: string;
first?: number;
})
| 1520 | }; |
| 1521 | |
| 1522 | export const postAnalyticsHistoryQuery = ({ |
| 1523 | id, |
| 1524 | first = postAnalyticsHistoryLimit, |
| 1525 | }: { |
| 1526 | id?: string; |
| 1527 | first?: number; |
| 1528 | }) => { |
| 1529 | const postId = id ?? ''; |
| 1530 | |
| 1531 | return { |
| 1532 | queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory], |
| 1533 | queryFn: async () => { |
| 1534 | const result = await gqlClient.request<{ |
| 1535 | postAnalyticsHistory: Connection<PostAnalyticsHistory>; |
| 1536 | }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId }); |
| 1537 | |
| 1538 | return result.postAnalyticsHistory; |
| 1539 | }, |
| 1540 | enabled: !!id, |
| 1541 | staleTime: StaleTime.Default, |
| 1542 | }; |
| 1543 | }; |
no test coverage detected