Transactions with QueryService in Custom Resolver #234
-
Hello,
Tried using dataSource and entityManager but for whatever reason the transaction doesn't work. If I omit the check for existence of customer email and error gets thrown, the membership still gets created. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is not possible by using the query services, you would need to create a transactions with TypeORM itself and use that query runner with the query builder (or the manager) and directly insert it yourself. Since the |
Beta Was this translation helpful? Give feedback.
This is not possible by using the query services, you would need to create a transactions with TypeORM itself and use that query runner with the query builder (or the manager) and directly insert it yourself.
Since the
createOne
logic uses TypeORM.save
you could also try to pass it all down to the customers servicecreateOne
, I think if configured correctly TypeORM will create/save the relation correctly.