[BUG?] CreateMany with Relationships: create instead of Connect

Hi there! We’re having a problem trying to write a mutation.

We have a Message table which has a relationship with MessageThread. We’re trying to CreateMany Messages along with NEW Threads for each of those messages, but it seems that we can only use connect for the MessageThread relation.

In our scenario we want to create the Threads, because each one of our Messages are the first ones in the threads. Is there a way to do this in a single mutation using messageCreateMany? We want to avoid making a query for each Message (you CAN use create for Threads if you’re going the messageCreate route instead of the messageCreateMany one).

Hey @ariel.deagustini ! There’s limitations around creating associated records through a createMany mutation currently, as those requests could get pretty unwieldy!

That said, there’s a few tricks that I can think of by which you could accomplish this but they really depend on how:

  1. Are the Messages you want to create when creating a new MessageThread always the same, or different for each new Thread?
  2. How many Messages need to be created with a new Thread? 1, 5, 50, 500?