From 4efc82e3a39170f048e609988b47bd18abd6a429 Mon Sep 17 00:00:00 2001 From: Greg Stephens Date: Tue, 3 Jan 2023 14:18:29 -0800 Subject: [PATCH] Fix payload init issue (#44) * fix payload init * update version --- README.md | 23 ++++++++++++----------- graphql.js | 3 +-- package.json | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a70af1c..dc449fe 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,19 @@ A NodeRed node to execute GraphQL Queries. ## Change Log -| Vers | Changes | -| ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 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 | -| 1.4.1 | Bump `follow-redirects` to 1.14.8 | -| 1.4.0 | improve debug, bump `follow-redirects` | -| 1.3.0 | bump axios to address CVE-2021-3749 | -| 1.2.0 | [Fix node not showing in palette](https://github.com/rgstephens/node-red-contrib-graphql/pull/24), bump axios | +| Vers | Changes | +| ----- | -------------------------------------------------------- | +| 2.1.1 | 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 | +| 1.4.1 | Bump `follow-redirects` to 1.14.8 | +| 1.4.0 | improve debug, bump `follow-redirects` | +| 1.3.0 | bump axios to address CVE-2021-3749 | +| 1.2.0 | [Fix node not showing in palette](https://github.com/rgstephens/node-red-contrib-graphql/pull/24), bump axios | | 1.1.0 | [Error Handling & Config Templates](https://github.com/rgstephens/node-red-contrib-graphql/pull/11/), [showDebug & customHeaders](https://github.com/rgstephens/node-red-contrib-graphql/pull/22/conflicts), [Bump axios](https://github.com/rgstephens/node-red-contrib-graphql/pull/20) | -| 1.0.0 | pass Authorization via msg.authorization, [PR #21](https://github.com/rgstephens/node-red-contrib-graphql/pull/21) | -| 0.0.6 | Initial Release | +| 1.0.0 | pass Authorization via msg.authorization, [PR #21](https://github.com/rgstephens/node-red-contrib-graphql/pull/21)| +| 0.0.6 | Initial Release | ## GraphQL Nodes diff --git a/graphql.js b/graphql.js index b07fc92..fbb6061 100644 --- a/graphql.js +++ b/graphql.js @@ -3,7 +3,7 @@ module.exports = function(RED) { var axios = require("axios"); var mustache = require("mustache"); - var vers = "2.1.0"; + var vers = "2.1.1"; function isReadable(value) { return typeof value === 'object' && typeof value._read === 'function' && typeof value._readableState === 'object' @@ -151,7 +151,6 @@ module.exports = function(RED) { shape: "dot", text: RED._("graphql.status.success") }); - node.msg.payload = {} node.msg.payload.graphql = response.data.data; // remove .data to see entire response if (node.showDebug){ node.msg.debugInfo = { diff --git a/package.json b/package.json index b0ec0da..f5278d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-graphql", - "version": "2.1.0", + "version": "2.1.1", "description": "A Node-RED node to make GraphQL calls", "dependencies": { "axios": "~1.2.1",