Skip to content

Commit

Permalink
fix(GraphQL Node): Fix issue with return items (#4016)
Browse files Browse the repository at this point in the history
* fix graphql return items

* ⚡ Remove not used code

Co-authored-by: Jan Oberhauser <[email protected]>
  • Loading branch information
2 people authored and ivov committed Sep 6, 2022
1 parent 9c1cf74 commit 5bfa2a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/nodes-base/nodes/GraphQL/GraphQL.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
},
Expand All @@ -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);
Expand Down

0 comments on commit 5bfa2a9

Please sign in to comment.