diff --git a/app/ui/components/editors/body/graph-ql-editor.js b/app/ui/components/editors/body/graph-ql-editor.js index dfe7e10b7..cb6fb72fc 100644 --- a/app/ui/components/editors/body/graph-ql-editor.js +++ b/app/ui/components/editors/body/graph-ql-editor.js @@ -175,7 +175,6 @@ class GraphQLEditor extends React.PureComponent { _handleBodyChange (query: string, variables?: Object): void { const operationNames = this._getOperationNames(); - const firstName = operationNames.length ? operationNames[0] : null; const body: GraphQLBody = {query}; @@ -183,8 +182,8 @@ class GraphQLEditor extends React.PureComponent { body.variables = variables; } - if (firstName) { - body.operationName = firstName; + if (operationNames.length) { + body.operationName = operationNames[0]; } this.setState({variablesSyntaxError: '', body});