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

Function getReadingStreak30Days

packages/shared/src/graphql/users.ts:738–750  ·  view source on GitHub ↗
(
  id: string,
  start: Date = subDays(new Date(), 30),
)

Source from the content-addressed store, hash-verified

736}
737
738export const getReadingStreak30Days = async (
739 id: string,
740 start: Date = subDays(new Date(), 30),
741): Promise<ReadingDay[]> => {
742 const today = new Date();
743 const res = await gqlClient.request(USER_STREAK_HISTORY, {
744 after: start.toISOString(),
745 before: today.toISOString(),
746 id,
747 });
748
749 return res.userReadHistory;
750};
751
752export const USER_STREAK_QUERY = gql`
753 query UserStreak {

Callers 1

useReadingStreak30DaysFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected