Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
현재 '좋아요'한 사진 목록을 무효화하는 방식은 서버로부터 데이터를 다시 가져오게 만들어 약간의 지연을 유발할 수 있습니다. 사용자 경험을 향상시키기 위해,
album.photos쿼리에 대해updateCacheAlbumPhotosLike에서 수행하는 것처럼album.likedPhotos쿼리에 대해서도 낙관적 업데이트(optimistic update)를 적용하는 것을 고려해 보세요. 사진을 '좋아요'하면 목록에 추가하고, '좋아요'를 취소하면 목록에서 제거하는 방식으로 즉각적인 UI 피드백을 줄 수 있습니다. 이를 구현하려면 현재 사진의 전체 데이터가 필요할 수 있는데,album.photos쿼리 캐시에서 해당 데이터를 찾아 활용할 수 있습니다.