({
id,
first = postAnalyticsHistoryLimit,
}: {
id?: string;
first?: number;
})
| 1505 | }; |
| 1506 | |
| 1507 | export const postAnalyticsHistoryQuery = ({ |
| 1508 | id, |
| 1509 | first = postAnalyticsHistoryLimit, |
| 1510 | }: { |
| 1511 | id?: string; |
| 1512 | first?: number; |
| 1513 | }) => { |
| 1514 | const postId = id ?? ''; |
| 1515 | |
| 1516 | return { |
| 1517 | queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalyticsHistory], |
| 1518 | queryFn: async () => { |
| 1519 | const result = await gqlClient.request<{ |
| 1520 | postAnalyticsHistory: Connection<PostAnalyticsHistory>; |
| 1521 | }>(POST_ANALYTICS_HISTORY_QUERY, { first, id: postId }); |
| 1522 | |
| 1523 | return result.postAnalyticsHistory; |
| 1524 | }, |
| 1525 | enabled: !!id, |
| 1526 | staleTime: StaleTime.Default, |
| 1527 | }; |
| 1528 | }; |
no test coverage detected