Fix [object Object] issue in interface

This commit is contained in:
Frane Bandov 2019-10-30 14:02:14 +01:00
parent 8b04f1ff37
commit 971a134cc4

View file

@ -92,7 +92,7 @@ export class GraphQL implements INodeType {
displayName: 'Variables',
name: 'variables',
type: 'json',
default: {},
default: '',
description: 'Query variables',
displayOptions: {
show: {
@ -194,7 +194,11 @@ export class GraphQL implements INodeType {
operationName: this.getNodeParameter('operationName', itemIndex, null) as string,
};
if (typeof requestOptions.body.variables === "string") {
requestOptions.body.variables = {};
try {
requestOptions.body.variables = JSON.parse(requestOptions.body.variables)
} catch {
requestOptions.body.variables = {};
}
}
if (requestOptions.body.operationName === "") {
requestOptions.body.operation = null;