Skip to content

Commit

Permalink
Merge pull request #393 from dahjelle/removeRefsFromStore
Browse files Browse the repository at this point in the history
WIP: Fix map function returning undefined.
  • Loading branch information
Sashko Stubailo authored Jul 13, 2016
2 parents 17e4bfb + 4371e7f commit 16a49d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Expect active development and potentially significant breaking changes in the `0

### vNEXT

- Fix map function returning `undefined` in `removeRefsFromStoreObj`. [PR #393](https://github.com/apollostack/apollo-client/pull/393)

### v0.4.1

- Allow `client.mutate` to accept an `optimisticResponse` argument to update the cache immediately, then after the server responds replace the `optimisticResponse` with the real response. [Issue #287](https://github.com/apollostack/apollo-client/issues/287) [PR #336](https://github.com/apollostack/apollo-client/pull/336)
Expand Down
6 changes: 3 additions & 3 deletions src/data/mutationResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ function removeRefsFromStoreObj(storeObj, dataId) {
affected = true;
return filteredArray;
}

// If not modified, return the original value
return value;
}

// If not modified, return the original value
return value;
});

if (affected) {
Expand Down
2 changes: 2 additions & 0 deletions test/mutationResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ describe('mutation results', () => {

// The item shouldn't be in the store anymore
assert.notProperty(client.queryManager.getApolloState().data, 'Todo3');
// shouldn't have affected other data elements
assert.notEqual(client.queryManager.getApolloState().data['TodoList5']['__typename'], undefined);
});
});
});
Expand Down

0 comments on commit 16a49d9

Please sign in to comment.