({
user,
listId,
status = BookmarkStatus.All,
reminderOnly = false,
}: BookmarkFacetsQueryOptionsProps)
| 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. |
| 149 | export 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 | |
| 173 | export interface BookmarkFolder { |
| 174 | id: string; |
no test coverage detected