( id: string, start: Date = subDays(new Date(), 30), )
| 736 | } |
| 737 | |
| 738 | export 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 | |
| 752 | export const USER_STREAK_QUERY = gql` |
| 753 | query UserStreak { |
no outgoing calls
no test coverage detected