
[vue-query] query key 관련 공식문서 정리

·
🤓 기술 학습 & 공부 기록/프론트엔드
📍Query Key의 형태- 직렬화가 가능한 값들의 배열이어야 함- 직렬화가 가능하다 => json.stringify()를 적용할 수 있고, 적용하면 항상 동일한 문자열로 변환된다// 일반적인 배열const userQueryKey = ["user", 1];// JSON.stringify(usersQueryKey) // '["user",1]'// 객체const postQueryKey = ["user", { id: 42 }];// JSON.stringify(postQueryKey) // '["post",{"id":42}]'// An individual todouseQuery({ queryKey: ['todo', 5], ... })// An individual todo in a "preview" format..