Skip to content

Conversation

@ff1451
Copy link
Collaborator

@ff1451 ff1451 commented Jan 19, 2026

No description provided.

@ff1451 ff1451 requested a review from Copilot January 19, 2026 20:56
@ff1451 ff1451 self-assigned this Jan 19, 2026
@ff1451 ff1451 linked an issue Jan 19, 2026 that may be closed by this pull request
Copy link

Copilot AI left a 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) => {
Copy link

Copilot AI Jan 19, 2026

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.

Suggested change
queryClient.setQueriesData<InfiniteData<NoticeResponse>>({ queryKey: councilQueryKeys.all }, (old) => {
queryClient.setQueriesData<InfiniteData<NoticeResponse>>({ queryKey: councilQueryKeys.notices() }, (old) => {

Copilot uses AI. Check for mistakes.
@ff1451 ff1451 merged commit ad3dffa into develop Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] 쿼리 키 분리

2 participants