Hi @all, Prisma should be transactional on nested ...
# orm-help
g
Hi @all, Prisma should be transactional on nested creates right? But unfortunately it isn't ☹️. In the following mutation the connection of the inner object "Order" throws an Authorization error. BUT: A new product is still created. It this correct behavior? Is it possible to abort the creation of the product? mutation createProductMutation { createProduct(data: { name: "test36", orders:{ create: { customer: { connect: { id: "81c9cb84-6b9e-4b61-b067-33d83d813043" } } } } }) { name } }
r
@Georg Wagner 👋 Nested creates are transactional by default. Could you share the actual error that it throws? Authorisation error is probably coming from GraphQL Shield and that hides the original error. Also if you could share your schema with the data you just passed, I could reproduce and check (just the Prisma schema and data that you passed, the GraphQL part isn’t required).
g
Error: I am not using Graphql-Shield. I applied some graphql directive which visits all field resolvers of order model. I will try to find some easier to reproduce way
💯 1
r
Adding
try/catch
and a console.log in
catch
should give you something.