Skip to content

Commit

Permalink
Merge pull request #34 from mhart/remove-double-stringify
Browse files Browse the repository at this point in the history
Remove double JSON.stringify calls around variables
  • Loading branch information
yungsters committed Aug 13, 2015
2 parents df902c1 + b34e3e8 commit 9fcd018
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/network-layer/default/RelayDefaultNetworkLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class RelayDefaultNetworkLayer {
init = {
body: JSON.stringify({
query: request.getQueryString(),
variables: JSON.stringify(request.getVariables()),
variables: request.getVariables(),
}),
headers: {'Content-Type': 'application/json'},
method: 'POST',
Expand All @@ -142,7 +142,7 @@ class RelayDefaultNetworkLayer {
return fetchWithRetries(this._uri, {
body: JSON.stringify({
query: request.getQueryString(),
variables: JSON.stringify(request.getVariables()),
variables: request.getVariables(),
}),
fetchTimeout: this._timeout,
headers: {'Content-Type': 'application/json'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('RelayDefaultNetworkLayer', () => {
});
expect(body).toEqual(JSON.stringify({
query: request.getQueryString(),
variables: JSON.stringify(variables),
variables: variables,
}));
});

Expand Down Expand Up @@ -195,7 +195,7 @@ describe('RelayDefaultNetworkLayer', () => {
var {body, fetchTimeout, method, retryDelays} = call[1];
expect(body).toBe(JSON.stringify({
query: requestA.getQueryString(),
variables: JSON.stringify(queryA.getVariables()),
variables: queryA.getVariables(),
}));
expect(fetchTimeout).toBe(networkConfig.timeout);
expect(method).toBe('POST');
Expand Down

0 comments on commit 9fcd018

Please sign in to comment.