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

Function userStreakPauseQueryOptions

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

Source from the content-addressed store, hash-verified

50// so streak invalidations on every read don't refetch it; only the pause
51// mutations change it, and they invalidate it.
52export const userStreakPauseQueryOptions = (user?: Pick<LoggedUser, 'id'>) => ({
53 queryKey: generateQueryKey(RequestKey.StreakPause, user),
54 queryFn: async (): Promise<UserStreakPause | null> => {
55 const result = await gqlClient.request<{
56 streakPause: UserStreakPause | null;
57 }>(STREAK_PAUSE_QUERY);
58
59 return result.streakPause;
60 },
61 staleTime: StaleTime.OneHour,
62 retry: false,
63});
64
65export const cancelStreakPause = async (): Promise<boolean> => {
66 const result = await gqlClient.request<{ cancelStreakPause: boolean }>(

Callers 4

renderBannerFunction · 0.90
renderSettingsFunction · 0.90
useUserStreakPauseFunction · 0.90
useStreakPauseFunction · 0.90

Calls 1

generateQueryKeyFunction · 0.90

Tested by 2

renderBannerFunction · 0.72
renderSettingsFunction · 0.72