Skip to content

Commit

Permalink
add deep copy to mergeConnections
Browse files Browse the repository at this point in the history
  • Loading branch information
guoliu committed Apr 30, 2019
1 parent b39a7cc commit 071bc77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/utils/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ export const mergeConnections = ({
const { edges: newEdges, pageInfo: newPageInfo } = _get(newData, path)

const result = oldData

if (newPageInfo.endCursor !== oldPageInfo.endCursor) {
_set(result, path, {
const copy = JSON.parse(JSON.stringify(result))
return _set(copy, path, {
...rest,
pageInfo: newPageInfo,
edges: [...oldEdges, ...newEdges]
Expand Down

0 comments on commit 071bc77

Please sign in to comment.