From a26c8d660d400ff409980aa29b6f80d01ae4d017 Mon Sep 17 00:00:00 2001 From: brendanlaschke Date: Sat, 16 Sep 2023 22:03:46 +0300 Subject: [PATCH] Fix teleporting board cards on drag drop (#1613) - fix teleporting board cards on drag drop --- .../ui/board/components/EntityBoard.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/front/src/modules/ui/board/components/EntityBoard.tsx b/front/src/modules/ui/board/components/EntityBoard.tsx index 6d81cc218..6fb55e8a1 100644 --- a/front/src/modules/ui/board/components/EntityBoard.tsx +++ b/front/src/modules/ui/board/components/EntityBoard.tsx @@ -72,6 +72,24 @@ export const EntityBoard = ({ id: pipelineProgressId, pipelineStageId, }, + optimisticResponse: { + __typename: 'Mutation', + updateOnePipelineProgress: { + __typename: 'PipelineProgress', + id: pipelineProgressId, + }, + }, + update: (cache) => { + cache.modify({ + id: cache.identify({ + id: pipelineProgressId, + __typename: 'PipelineProgress', + }), + fields: { + pipelineStageId: () => pipelineStageId, + }, + }); + }, refetchQueries: [getOperationName(GET_PIPELINE_PROGRESS) ?? ''], }); },