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

Function bookmarkFacetsQueryOptions

packages/shared/src/graphql/bookmarks.ts:149–171  ·  view source on GitHub ↗
({
  user,
  listId,
  status = BookmarkStatus.All,
  reminderOnly = false,
}: BookmarkFacetsQueryOptionsProps)

Source from the content-addressed store, hash-verified

147// Scoped to the folder and read status, not to the tag or source filters, so
148// the chips keep their counts while the user clicks around.
149export const bookmarkFacetsQueryOptions = ({
150 user,
151 listId,
152 status = BookmarkStatus.All,
153 reminderOnly = false,
154}: BookmarkFacetsQueryOptionsProps) => ({
155 queryKey: generateQueryKey(RequestKey.BookmarkFacets, user, {
156 listId: listId ?? null,
157 status,
158 reminderOnly,
159 }),
160 queryFn: async (): Promise<BookmarkFacets> => {
161 const { bookmarkFacets } = await gqlBatchRequest<{
162 bookmarkFacets: BookmarkFacets;
163 }>(
164 reminderOnly ? BOOKMARK_REMINDER_FACETS_QUERY : BOOKMARK_FACETS_QUERY,
165 reminderOnly ? { status } : { listId, status },
166 );
167
168 return bookmarkFacets;
169 },
170 staleTime: StaleTime.Default,
171});
172
173export interface BookmarkFolder {
174 id: string;

Callers 1

BookmarkFeedLayoutFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by

no test coverage detected