refactor: 각 도메인별 쿼리키 분리#330
Conversation
There was a problem hiding this comment.
Code Review
This pull request centralizes authentication-related React Query keys by introducing a shared authQueryKeys constant, replacing hardcoded strings across the application. The review feedback suggests restructuring these keys into a hierarchical domain-based format for better scalability and using path aliases for imports to ensure consistency with the project's coding standards.
| const AUTH_QUERY_BASE_KEY = ["me"] as const; | ||
|
|
||
| export const authQueryKeys = { | ||
| me: AUTH_QUERY_BASE_KEY, | ||
| } as const; |
There was a problem hiding this comment.
쿼리 키를 관리할 때 도메인(예: auth)을 베이스 키로 사용하고, 세부 항목을 하위 계층으로 구성하는 것이 확장성과 가독성 측면에서 좋습니다. 현재 AUTH_QUERY_BASE_KEY가 ["me"]로 되어 있는데, 이를 ["auth"]로 변경하고 me 키를 ["auth", "me"]와 같이 구성하는 것을 권장합니다. 또한, 현재 구조에서 AUTH_QUERY_BASE_KEY 상수는 authQueryKeys 객체 내부에서 직접 정의해도 충분하므로 중복을 줄일 수 있습니다. (참고: 이 변경은 기존 브라우저 캐시 키를 변경하므로 배포 시 유의가 필요합니다.)
export const authQueryKeys = {
all: ["auth"] as const,
me: ["auth", "me"] as const,
} as const;|
🧷 Preview: https://reboot-gbunpuji3-code-base.vercel.app |
|
🧷 Preview: https://reboot-alnutq6p4-code-base.vercel.app |
|
🧷 Preview: https://reboot-8i5l8qw7k-code-base.vercel.app |
|
🧷 Preview: https://reboot-csl9tyfip-code-base.vercel.app |
|
🧷 Preview: https://reboot-ms9xezw1w-code-base.vercel.app |
|
🧷 Preview: https://reboot-e6cgvqgds-code-base.vercel.app |
Resolve: #330
- 경로 수정
|
🧷 Preview: https://reboot-gxif5vc6o-code-base.vercel.app |
🛠️ 설명 (Description)
features/<도메인> 경로에서 관리하던 queryKeys를
features/shared/queryKeys 폴더에 쿼리키파일을 생성하여 관리합니다
🔗 관련 이슈 (Related Issues)
☑️ 체크리스트 (Checklist)