I have a graphql node that I’m using to do an insert. But the service I’m using has capacity limits (60 ops per minute) and I want to insert ~ 500 nested objects.
What I’ve tried is this in a function node to aggregate the objects that I want to pass to the gql node as a single list:
I have created an example workflow that might help. The Function node in the example workflow is to create the mock data. In the GraphQL node I am first converting the array into a string using the JSON.stringify() method. Next I am replacing the "name" with name (removing the quotes), since that is the value of the key and in GraphQL we don’t use quotes for the key. I hope this helps.
Actually another thought @harshil1712 - is there a string template library I can use in n8n nodes? I think it would make sense to construct the payload in the function node…
@commandodev I am referring the Function node as in the example as that is more of a convenient way. If you have multiple data sources then it would create an issue. Specifying which node I want to use the data from makes it less complicated.
As a temporary workaround is the same already possible in the Function-Node. If you start n8n with the following environment variable to make sure that handlebars can be used: