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

Function postAnalyticsQueryOptions

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

Source from the content-addressed store, hash-verified

1463};
1464
1465export const postAnalyticsQueryOptions = ({ id }: { id?: string }) => {
1466 const postId = id ?? '';
1467
1468 return {
1469 queryKey: [...getPostByIdKey(postId), RequestKey.PostAnalytics],
1470 queryFn: async () => {
1471 const result = await gqlClient.request<{
1472 postAnalytics: PostAnalytics;
1473 }>(POST_ANALYTICS_QUERY, { id: postId });
1474
1475 return result.postAnalytics;
1476 },
1477 enabled: !!id,
1478 staleTime: StaleTime.Default,
1479 };
1480};
1481
1482export const postAnalyticsHistoryLimit = 45;
1483

Callers 1

PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected