-
Notifications
You must be signed in to change notification settings - Fork 0
[refactor] 쿼리키 분리 #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "59-refactor-\uCFFC\uB9AC-\uD0A4-\uBD84\uB9AC"
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors query keys across the application by extracting them into centralized query key factory objects, improving maintainability and consistency in cache management.
Changes:
- Introduced query key factory objects for each domain (user, studyTime, schedule, council, club, chat, university)
- Replaced hardcoded query key strings with factory method calls
- Updated cache invalidation and query matching to use the new centralized keys
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/pages/User/Profile/hooks/useMyInfo.ts | Added userQueryKeys factory and updated myInfo query and mutation |
| src/pages/Timer/hooks/useStudyTimeRanking.ts | Updated to use studyTimeQueryKeys for ranking and myRanking queries |
| src/pages/Timer/hooks/useStudyTime.ts | Added studyTimeQueryKeys factory with summary, ranking, and myRanking keys |
| src/pages/Schedule/hooks/useGetSchedules.ts | Extended scheduleQueryKeys with upcoming key |
| src/pages/Home/hooks/useGetUpComingSchedule.ts | Updated to use scheduleQueryKeys.upcoming() |
| src/pages/Home/hooks/useGetScheduleList.ts | Updated to use scheduleQueryKeys.monthly() |
| src/pages/Home/hooks/useGetJoinedClubs.ts | Updated to use clubQueryKeys.joined() |
| src/pages/Council/CouncilNotice/hooks/useCouncilNoticeDetail.ts | Updated to use councilQueryKeys, but with incorrect usage of councilQueryKeys.all |
| src/pages/Council/CouncilDetail/hooks/useGetCouncilInfo.ts | Added councilQueryKeys factory with info, notices, and noticeDetail keys |
| src/pages/Club/ClubList/hooks/useGetClubs.ts | Added comprehensive clubQueryKeys factory with multiple sub-keys |
| src/pages/Club/ClubDetail/hooks/useGetClubRecruitment.ts | Updated to use clubQueryKeys.recruitment() |
| src/pages/Club/ClubDetail/hooks/useGetClubMembers.ts | Updated to use clubQueryKeys.members() |
| src/pages/Club/ClubDetail/hooks/useGetClubDetail.ts | Updated to use clubQueryKeys.detail() |
| src/pages/Club/ClubDetail/hooks/useCouncilNotices.ts | Updated to use councilQueryKeys.notices() |
| src/pages/Club/Application/hooks/useGetClubFee.ts | Updated to use clubQueryKeys.fee() |
| src/pages/Club/Application/hooks/useClubApply.ts | Updated to use clubQueryKeys for questions and detail queries |
| src/pages/Chat/hooks/useChat.ts | Added chatQueryKeys factory and updated all chat-related queries |
| src/pages/Auth/SignUp/hooks/useUniversity.ts | Added universityQueryKeys factory and updated university list query |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| patchedRef.current = noticeId; | ||
|
|
||
| queryClient.setQueriesData<InfiniteData<NoticeResponse>>({ queryKey: ['councilNotice'] }, (old) => { | ||
| queryClient.setQueriesData<InfiniteData<NoticeResponse>>({ queryKey: councilQueryKeys.all }, (old) => { |
Copilot
AI
Jan 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The query key pattern is inconsistent here. The queryKey should be councilQueryKeys.notices() or similar, not councilQueryKeys.all. The setQueriesData method is meant to match multiple queries that start with ['council', 'notices'] to update cached notice data, but councilQueryKeys.all only returns ['council'] which would match all council-related queries including info and notice details, not just the notice list queries. This could lead to unintended cache updates.
| queryClient.setQueriesData<InfiniteData<NoticeResponse>>({ queryKey: councilQueryKeys.all }, (old) => { | |
| queryClient.setQueriesData<InfiniteData<NoticeResponse>>({ queryKey: councilQueryKeys.notices() }, (old) => { |
No description provided.