From 26198d30e515247e0264ebdf477c2f58ebb633d8 Mon Sep 17 00:00:00 2001 From: viktorstrate Date: Fri, 19 Jun 2020 15:56:04 +0200 Subject: [PATCH] Add optimistic response for markFavorite --- ui/src/components/photoGallery/Photo.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/src/components/photoGallery/Photo.js b/ui/src/components/photoGallery/Photo.js index b6bfe5f..7710105 100644 --- a/ui/src/components/photoGallery/Photo.js +++ b/ui/src/components/photoGallery/Photo.js @@ -139,6 +139,13 @@ export const Photo = ({ photoId: photo.id, favorite: !photo.favorite, }, + optimisticResponse: { + favoritePhoto: { + id: photo.id, + favorite: !photo.favorite, + __typename: 'Photo', + }, + }, }) }} />