Skip to content

Commit

Permalink
fix the run in graphiql button bug when localStorage has no data
Browse files Browse the repository at this point in the history
  • Loading branch information
daniman committed Dec 14, 2016
1 parent 7ebb2d0 commit bc84feb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions app/components/Explorer/Explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,21 @@ export default class Explorer extends Component {
}
}

clearDefaultQueryState() {
this.setState({ query: undefined, variables: undefined });
}

render() {
const { noFetch } = this.state;
const graphiql = (
<GraphiQL fetcher={this.graphQLFetcher} defaultQuery={this.state.query}
variables={this.state.variables}
ref={r => {this.graphiql = r}}>
<GraphiQL
fetcher={this.graphQLFetcher}
query={this.state.query}
onEditQuery={() => { this.clearDefaultQueryState() }}
onEditVariables={() => { this.clearDefaultQueryState() }}
variables={this.state.variables}
ref={r => {this.graphiql = r}}
>
<GraphiQL.Toolbar>
<label>
<input
Expand Down
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.1",
"version": "1.0.2",
"name": "Apollo Client Developer Tools",
"short_name": "Apollo DevTools",

Expand Down

0 comments on commit bc84feb

Please sign in to comment.