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

Function postAnalyticsQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 1

PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected