Is it possible to create a nested mutation and to ...
# prisma-whats-new
t
Is it possible to create a nested mutation and to use the created id from the topest type as relation to the lower one?
something like that?
mutation createUser( $email: String!, $password: String!, $surname: String!, $lastname: String!, $phoneNumber: String!, $plan: Plan! ) { createUser(authProvider: {email: { email: $email, password: $password }}, surname: $surname, lastname: $lastname, phoneNumber:$phoneNumber, contractUser: { plan: $plan, ownerId: currentId }) { id } }
currentId should be the id from the created currentUser
a
If you create contractUser as a nested mutation, you don't have to specify ownerId, because that will be set automatically because of the relation