diff --git a/src/lib/queryKeys.ts b/src/lib/queryKeys.ts new file mode 100644 index 0000000..cc25c56 --- /dev/null +++ b/src/lib/queryKeys.ts @@ -0,0 +1,18 @@ +export const queryKeys = { + boards: { + all: ["boards"] as const, + }, + posts: { + list: (params: { page: number; pageSize: number; boardId?: string; q?: string }) => + ["posts", "list", params] as const, + detail: (id: string) => ["posts", "detail", id] as const, + }, + comments: { + list: (postId: string) => ["comments", "list", postId] as const, + }, + auth: { + permissions: ["auth", "permissions"] as const, + }, +}; + + diff --git a/todolist.txt b/todolist.txt index 570a9c3..fdd3b61 100644 --- a/todolist.txt +++ b/todolist.txt @@ -23,7 +23,7 @@ [상태관리/데이터] 4.1 React Query 설치 및 Provider 구성 o 4.2 공통 fetcher/에러 형식/재시도·백오프 설정 o -4.3 캐시 키/무효화 전략 수립 및 적용 +4.3 캐시 키/무효화 전략 수립 및 적용 o 4.4 낙관적 업데이트 패턴 적용(작성/수정) [공통/레이아웃]