diff --git a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js index b841d21ecf..83591120c3 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js +++ b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js @@ -390,6 +390,8 @@ class GraphQLEditor extends React.PureComponent { } _handleBodyChange(query: string, variables: ?Object, operationName: ?string): void { + this._setDocumentAST(query); + const body: GraphQLBody = { query }; if (variables) { @@ -400,16 +402,6 @@ class GraphQLEditor extends React.PureComponent { body.operationName = operationName; } - const newContent = GraphQLEditor._graphQLToString(body); - - // This method gets called a lot so make sure we only do something if the - // new body has actually changed. - if (this.props.content === newContent) { - return; - } - - this._setDocumentAST(query); - // Find op if there isn't one yet if (!body.operationName) { const newOperationName = this._getCurrentOperation(); @@ -418,6 +410,8 @@ class GraphQLEditor extends React.PureComponent { } } + const newContent = GraphQLEditor._graphQLToString(body); + this.setState({ variablesSyntaxError: '', body,