After I execute multiple mutations in one request ...
# prisma-whats-new
a
After I execute multiple mutations in one request as result I have
Copy code
{
  "data": {
    "ph1": {
      "id": "cj2ktugdns3gp01126sb40uc1"
    },
    "ph2": {
      "id": "cj2ktuge9s3kt0112yivor283"
    }
  }
}
Is there is a way to add all these ids to other object as one-to-many relation in one go? Or I need also create multiple mutation for this?
n
@andrius could you maybe do this in the previous mutation as well? How does it look like?
a
now I have
Copy code
mutation {
  ph1 : createPhoto(
				   w: 1080
				   h: 720
				   credits: "zxc"
				   ext:"jpg"
				   portrait:false
				   publicIdx:"weddingsuppliers/venue/eeaXqR9Rgl/pzakl5arroic8wnlzwb0"
					supplierId:"cj2kngwjci4x50189yrbmsy1o"
				) {
					id
				}
  ph2: createPhoto(
				   w: 1080
				   h: 720
				   credits: "zxc"
				   ext:"jpg"
				   portrait:false
				   publicIdx:"weddingsuppliers/venue/eeaXqR9Rgl/pzakl5arroic8wnlzwb0"
					supplierId:"cj2kngwjci4x50189yrbmsy1o"
				) {
					id
				}
}
n
do you have the id of the "one" side already?
a
yes, supplierId:"cj2kngwjci4x50189yrbmsy1o"
n
oh so you already are doing it then
do you want to connect the photos to another object than the supplier as well?
a
ah, really, I don't need to run addToSupplierOnPhoto(photosPhotoId: ID!supplierSupplierId: ID!) ?
n
no, that's what happens with the
supplierId
argument already
a
o, thank you!
n
🙂
a
kool! 🙂
n
you're welcome!