Skip to content

Commit 36374fa

Browse files
authored
Fix payload init (#45)
* fix payload init * update version * fix
1 parent 4efc82e commit 36374fa

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A NodeRed node to execute GraphQL Queries.
1111

1212
| Vers | Changes |
1313
| ----- | -------------------------------------------------------- |
14-
| 2.1.1 | Fix payload init issue |
14+
| 2.1.2 | Fix payload init issue |
1515
| 2.1.0 | Bearer Token Authentication |
1616
| 2.0.1 | Update dependencies (`axios` & `mustache`), fix node-red scorecard issues |
1717
| 2.0.0 | GraphQL response is now on `payload.graphql` instead of replacing `payload`. This is a breaking change. Addresses #32 |

graphql.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = function(RED) {
33
var axios = require("axios");
44
var mustache = require("mustache");
55

6-
var vers = "2.1.1";
6+
var vers = "2.1.2";
77

88
function isReadable(value) {
99
return typeof value === 'object' && typeof value._read === 'function' && typeof value._readableState === 'object'
@@ -151,6 +151,7 @@ module.exports = function(RED) {
151151
shape: "dot",
152152
text: RED._("graphql.status.success")
153153
});
154+
if (!node.msg.payload) node.msg.payload = {};
154155
node.msg.payload.graphql = response.data.data; // remove .data to see entire response
155156
if (node.showDebug){
156157
node.msg.debugInfo = {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-graphql",
3-
"version": "2.1.1",
3+
"version": "2.1.2",
44
"description": "A Node-RED node to make GraphQL calls",
55
"dependencies": {
66
"axios": "~1.2.1",

0 commit comments

Comments
 (0)