I feel really dumb asking this but I couldn't find...
# prisma-whats-new
k
I feel really dumb asking this but I couldn't find a clear answer from any of the docs – is there a simple way to create a batch of new node at once? I'm assuming this needs a custom Prisma (
graphq-yoga
?) resolver that loops over an array and sends
create
mutations one by one?
s
Great question @kuldar. There should definitely be a resource which explains this (cc @nikolasburk). While there is no explicit API for this (yet) you can basically map your array of things you want to create to an array of Promises by calling the
create
mutation in each map call. The result of the map you
await Promise.all(myPromises)