Skip to content

Commit

Permalink
Merge pull request #1648 from borisnieuwenhuis/fix-more-object-assign
Browse files Browse the repository at this point in the history
fix more object assign
  • Loading branch information
helfer authored May 3, 2017
2 parents d6b287c + d8e5f38 commit 2bd0d17
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change log

### vNEXT
- Fix: Replace more usage of Object.assign with util.assign to make it work in IE, previous fix was not complete [PR #1648](https://github.com/apollographql/apollo-client/pull/1648)

### 1.1.2
- Feature+Fix: Introduce "standby" fetchPolicy to mark queries that are not currently active, but should be available for refetchQueries and updateQueries [PR #1636](https://github.com/apollographql/apollo-client/pull/1636)
Expand Down
6 changes: 5 additions & 1 deletion src/data/readFromStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import {
isEqual,
} from '../util/isEqual';

import {
assign,
} from '../util/assign';

import {
isTest,
} from '../util/environment';
Expand Down Expand Up @@ -205,7 +209,7 @@ export function diffQueryAgainstStore({
// Throw the right validation error by trying to find a query in the document
const queryDefinition = getQueryDefinition(query);

variables = Object.assign(getDefaultValues(queryDefinition), variables);
variables = assign({}, getDefaultValues(queryDefinition), variables);

const context: ReadStoreContext = {
// Global settings
Expand Down
8 changes: 6 additions & 2 deletions src/data/writeToStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ import {
shouldInclude,
} from '../queries/directives';

import {
assign,
} from '../util/assign';

/**
* Writes the result of a query to the store.
*
Expand Down Expand Up @@ -74,7 +78,7 @@ export function writeQueryToStore({
}): NormalizedCache {
const queryDefinition: OperationDefinitionNode = getQueryDefinition(query);

variables = Object.assign(getDefaultValues(queryDefinition), variables);
variables = assign({}, getDefaultValues(queryDefinition), variables);

return writeSelectionSetToStore({
dataId: 'ROOT_QUERY',
Expand Down Expand Up @@ -117,7 +121,7 @@ export function writeResultToStore({
const selectionSet = operationDefinition.selectionSet;
const fragmentMap = createFragmentMap(getFragmentDefinitions(document));

variables = Object.assign(getDefaultValues(operationDefinition), variables);
variables = assign({}, getDefaultValues(operationDefinition), variables);

return writeSelectionSetToStore({
result,
Expand Down

0 comments on commit 2bd0d17

Please sign in to comment.