Fix GraphQL Bug

This commit is contained in:
Jan Oberhauser 2020-11-20 16:51:46 +01:00
parent f558616376
commit 8214a7f22a

View file

@ -240,7 +240,7 @@ export class GraphQL implements INodeType {
};
if (typeof requestOptions.body.variables === 'string') {
try {
requestOptions.body.variables = JSON.parse(requestOptions.body.variables);
requestOptions.body.variables = JSON.parse(requestOptions.body.variables || '{}');
} catch (e) {
throw new Error('Using variables failed:\n' + requestOptions.body.variables + '\n\nWith error message:\n' + e);
}