MCPcopy Create free account
hub / github.com/dailydotdev/apps / postAnalyticsQueryOptions

Function postAnalyticsQueryOptions

packages/shared/src/graphql/posts.ts:1502–1517  ·  view source on GitHub ↗
({ id }: { id?: string })

Source from the content-addressed store, hash-verified

1500};
1501
1502export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => {
1503 const postId = id ?? '';
1504
1505 return {
1506 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics],
1507 queryFn: async () => {
1508 const result = await gqlClient.request<{
1509 postAnalytics: PostAnalytics;
1510 }>(POST_ANALYTICS_QUERY, { id: postId });
1511
1512 return result.postAnalytics;
1513 },
1514 enabled: !!id,
1515 staleTime: StaleTime.Default,
1516 };
1517};
1518
1519export const postAnalyticsHistoryLimit = 45;
1520

Callers 1

PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected