Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fix map function returning undefined. #393

Merged
merged 1 commit into from
Jul 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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