Skip to content

Commit

Permalink
modified result to response to properly update this.state.response
Browse files Browse the repository at this point in the history
  • Loading branch information
asiandrummer committed Nov 4, 2015
1 parent 5603e3d commit ccfe7f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/GraphiQL.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,20 @@ export class GraphiQL extends React.Component {
componentWillReceiveProps(nextProps) {
var nextQuery = this.state.query;
var nextVariables = this.state.variables;
var nextResult = this.state.result;
var nextResponse = this.state.response;
if (nextProps.query && nextProps.query !== nextQuery) {
nextQuery = nextProps.query;
}
if (nextProps.variables && nextProps.variables !== nextVariables) {
nextVariables = nextProps.variables;
}
if (nextProps.result && nextProps.result !== nextResult) {
nextResult = nextProps.result;
if (nextProps.response && nextProps.response !== nextResponse) {
nextResponse = nextProps.response;
}
this.setState({
query: nextQuery,
variables: nextVariables,
result: nextResult,
response: nextResponse,
});
}

Expand Down

0 comments on commit ccfe7f8

Please sign in to comment.