Is there a pattern for sending an array of objects...
# prisma-whats-new
a
Is there a pattern for sending an array of objects via a mutation to create many nodes in graphql?
n
@amann hey, our nested mutations allow you to create many nodes on the other side of a relation when creating a new node
for example, you can create one post and many comments in one single mutation like this:
Copy code
mutation {
  createPost(
    title: "My Post"
    comments: [{
      title: "First comment"
    }, {
      title" "Second comment"
    }]
  ) {
    id
  }
}
a
How would I go about creating multiple posts?
n
calling the same mutation multiple times in one request
Copy code
{
  first: createPost(
    title: "My Post"
  ) {
    id
  }

  second: createPost(
    title: "My second Post"
  ) {
    id
  }
}