quick question about how prisma-connect works: if ...
# orm-help
h
quick question about how prisma-connect works: if I have a custom resolver to update a record... and that custom resolver uses a prisma-connect mutation under the hood to update that record with the arguments supplied.... ...if one of the possibilities is creating a relationship between this record and the next, but that's optional, can I still use
connect
in this way?
Copy code
return await db.mutation.updateFoo(
        { data: {
          ...args,
          ...{ bar: {connect: { id: args.bar.id } } },
        },
      })
    }
What does this do, if I don't pass a
bar
? What if I passed a
bar
on a previous update, but not on a later update?
Basically: do I need to check for the presence of a
bar
first, and then conditionally proceed to one of two mutations, or can I just have the one?