Skip to content

Commit

Permalink
Fix payload init (rgstephens#45)
Browse files Browse the repository at this point in the history
* fix payload init

* update version

* fix
  • Loading branch information
rgstephens committed Jan 4, 2023
1 parent 4efc82e commit 36374fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A NodeRed node to execute GraphQL Queries.

| Vers | Changes |
| ----- | -------------------------------------------------------- |
| 2.1.1 | Fix payload init issue |
| 2.1.2 | Fix payload init issue |
| 2.1.0 | Bearer Token Authentication |
| 2.0.1 | Update dependencies (`axios` & `mustache`), fix node-red scorecard issues |
| 2.0.0 | GraphQL response is now on `payload.graphql` instead of replacing `payload`. This is a breaking change. Addresses #32 |
Expand Down
3 changes: 2 additions & 1 deletion graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = function(RED) {
var axios = require("axios");
var mustache = require("mustache");

var vers = "2.1.1";
var vers = "2.1.2";

function isReadable(value) {
return typeof value === 'object' && typeof value._read === 'function' && typeof value._readableState === 'object'
Expand Down Expand Up @@ -151,6 +151,7 @@ module.exports = function(RED) {
shape: "dot",
text: RED._("graphql.status.success")
});
if (!node.msg.payload) node.msg.payload = {};
node.msg.payload.graphql = response.data.data; // remove .data to see entire response
if (node.showDebug){
node.msg.debugInfo = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-graphql",
"version": "2.1.1",
"version": "2.1.2",
"description": "A Node-RED node to make GraphQL calls",
"dependencies": {
"axios": "~1.2.1",
Expand Down

0 comments on commit 36374fa

Please sign in to comment.