mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(GraphQL Node): Fix issue with return items (#4016)
* fix graphql return items
* ⚡ Remove not used code
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
parent
73c5210294
commit
6216132ae2
|
@ -324,7 +324,6 @@ export class GraphQL implements INodeType {
|
||||||
let requestOptions: OptionsWithUri & RequestPromiseOptions;
|
let requestOptions: OptionsWithUri & RequestPromiseOptions;
|
||||||
|
|
||||||
const returnItems: INodeExecutionData[] = [];
|
const returnItems: INodeExecutionData[] = [];
|
||||||
const responseData: IDataObject | IDataObject[] = [];
|
|
||||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||||
try {
|
try {
|
||||||
const requestMethod = this.getNodeParameter('requestMethod', itemIndex, 'POST') as string;
|
const requestMethod = this.getNodeParameter('requestMethod', itemIndex, 'POST') as string;
|
||||||
|
@ -433,7 +432,7 @@ export class GraphQL implements INodeType {
|
||||||
}
|
}
|
||||||
if (responseFormat === 'string') {
|
if (responseFormat === 'string') {
|
||||||
const dataPropertyName = this.getNodeParameter('dataPropertyName', 0) as string;
|
const dataPropertyName = this.getNodeParameter('dataPropertyName', 0) as string;
|
||||||
responseData.push({
|
returnItems.push({
|
||||||
json: {
|
json: {
|
||||||
[dataPropertyName]: response,
|
[dataPropertyName]: response,
|
||||||
},
|
},
|
||||||
|
@ -458,7 +457,7 @@ export class GraphQL implements INodeType {
|
||||||
throw new NodeApiError(this.getNode(), response.errors, { message });
|
throw new NodeApiError(this.getNode(), response.errors, { message });
|
||||||
}
|
}
|
||||||
const executionData = this.helpers.constructExecutionMetaData(
|
const executionData = this.helpers.constructExecutionMetaData(
|
||||||
this.helpers.returnJsonArray(responseData),
|
this.helpers.returnJsonArray(response),
|
||||||
{ itemData: { item: itemIndex } },
|
{ itemData: { item: itemIndex } },
|
||||||
);
|
);
|
||||||
returnItems.push(...executionData);
|
returnItems.push(...executionData);
|
||||||
|
|
Loading…
Reference in a new issue