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

Function latestBriefingQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 1

BriefingWidgetFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected