Hi, is it possible to do transactional writes with...
# prisma-whats-new
p
Hi, is it possible to do transactional writes with prisma?
p
and that's the only way?
what if I already have
connect
in my mutation?
a
What do you mean by “already have `connect`” in my mutation? Do you have an example?
p
yes
Copy code
return db.mutation.createProjectRecommendation(
        {
          data: {
            project: { connect: { id: args.projectId } } },
          },
        },
        info
      );
and in this case I want to connect to
project
and update its status
a
Ah okay, I see. So the project is already there, right?
p
yes, project is already created
a
Okay, that is not possible:
a create mutation only exposes nested create and connect mutations
This would work, if you have access to
upsert
which is not the case here.
p
ok, so I have different question, if
project
has many
projectRecomendations
is it possible to do nested mutation and append one recommendation?
n
yes just use
connect
and provide id of
projectRecomendations