Can I create and link a relationship at the same t...
# prisma-whats-new
p
Can I create and link a relationship at the same time like I can with userId but for an one to many?
d
I'm not sure exactly what scenario you are asking about but you can:
- Use a nested create mutation to create multiple nodes and link them with relationships at the same time
-Use a nested connect mutation to connect to connect multiple nodes while creating a node
Key thing is that at the to-many end of a 1-many relationship, the xIds field will be an array of strings rather than a string
Exactly what you need to do depends on whether the nodes on either or both ends of the relationship already exist
p
got it working, thanks so much!!