From 6216132ae2f3b908aacf266f4a34143bb8a74f0a Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Sat, 3 Sep 2022 12:20:25 +0100 Subject: [PATCH] fix(GraphQL Node): Fix issue with return items (#4016) * fix graphql return items * :zap: Remove not used code Co-authored-by: Jan Oberhauser --- packages/nodes-base/nodes/GraphQL/GraphQL.node.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/GraphQL/GraphQL.node.ts b/packages/nodes-base/nodes/GraphQL/GraphQL.node.ts index 116fd1c35..8bc816036 100644 --- a/packages/nodes-base/nodes/GraphQL/GraphQL.node.ts +++ b/packages/nodes-base/nodes/GraphQL/GraphQL.node.ts @@ -324,7 +324,6 @@ export class GraphQL implements INodeType { let requestOptions: OptionsWithUri & RequestPromiseOptions; const returnItems: INodeExecutionData[] = []; - const responseData: IDataObject | IDataObject[] = []; for (let itemIndex = 0; itemIndex < items.length; itemIndex++) { try { const requestMethod = this.getNodeParameter('requestMethod', itemIndex, 'POST') as string; @@ -433,7 +432,7 @@ export class GraphQL implements INodeType { } if (responseFormat === 'string') { const dataPropertyName = this.getNodeParameter('dataPropertyName', 0) as string; - responseData.push({ + returnItems.push({ json: { [dataPropertyName]: response, }, @@ -458,7 +457,7 @@ export class GraphQL implements INodeType { throw new NodeApiError(this.getNode(), response.errors, { message }); } const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray(responseData), + this.helpers.returnJsonArray(response), { itemData: { item: itemIndex } }, ); returnItems.push(...executionData);