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

Function postAnalyticsQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 1

PostAnalyticsPageFunction · 0.90

Calls 1

getPostByIdKeyFunction · 0.90

Tested by

no test coverage detected