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

Function latestBriefingQueryOptions

packages/shared/src/graphql/posts.ts:1527–1538  ·  view source on GitHub ↗
(user?: Pick<LoggedUser, 'id'>)

Source from the content-addressed store, hash-verified

1525 * one, which removes that feed's queries, drops this too.
1526 */
1527export const latestBriefingQueryOptions = (user?: Pick<LoggedUser, 'id'>) => ({
1528 queryKey: generateQueryKey(RequestKey.Feeds, user, 'briefing', 'latest'),
1529 queryFn: async (): Promise<LatestBriefing | null> => {
1530 const { briefingPosts } = await gqlBatchRequest<{
1531 briefingPosts: Connection<LatestBriefing>;
1532 }>(LATEST_BRIEFING_QUERY);
1533
1534 return briefingPosts.edges[0]?.node ?? null;
1535 },
1536 staleTime: StaleTime.Default,
1537 enabled: !!user?.id,
1538});
1539
1540export enum BriefingType {
1541 Daily = 'daily',

Callers 1

BriefingWidgetFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected