Is there a way to create extra resources when doin...
# prisma-whats-new
m
Is there a way to create extra resources when doing a single create? For example: creating default relations when the parent object is created, without the client needing to pass in the nested mutation params
a
You could do that in an
operationAfter
hook
m
Would I then just chain mutations using graphql-lib? I’m curious how to handle errors in this case, as I’m assuming this won’t be within a transaction
e.g The parent is created, but in the operationAfter the relation fails
a
No that won't be in a transaction
You could in theory delete the parent if one of the mutations in the after hook fails, like a kind of rollback