mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Minor tweak
This commit is contained in:
parent
0c48d0027d
commit
00deb967c5
@ -175,7 +175,6 @@ class GraphQLEditor extends React.PureComponent<Props, State> {
|
||||
|
||||
_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<Props, State> {
|
||||
body.variables = variables;
|
||||
}
|
||||
|
||||
if (firstName) {
|
||||
body.operationName = firstName;
|
||||
if (operationNames.length) {
|
||||
body.operationName = operationNames[0];
|
||||
}
|
||||
|
||||
this.setState({variablesSyntaxError: '', body});
|
||||
|
Loading…
Reference in New Issue
Block a user