Bro
03/26/2018, 6:26 PMDaniel K.
03/26/2018, 6:42 PMDaniel K.
03/26/2018, 6:42 PMBro
03/26/2018, 6:43 PMDaniel K.
03/26/2018, 6:43 PMBro
03/26/2018, 6:49 PMBro
03/26/2018, 8:21 PMmutation{
a: updatePlayer(
where:{name:"p1"}
data:{totalCoins:2})
{
name
totalCoins
}
b: updatePlayer(
where:{name:"no-exist"}
data:{totalCoins:3}
)
{
name
totalCoins
}
}
"a" goes through even if "b" fails.nilan
03/27/2018, 4:58 PMBro
03/27/2018, 5:02 PMBro
03/27/2018, 5:20 PMnilan
03/27/2018, 6:12 PMBro
03/27/2018, 8:40 PMwhere: PlayerWhereUniqueInput!
like an optional andWhere: [PlayerWhereInput!]
you would be able to check some other conditions. The same would hold true for transactions across multiple top level mutations.nilan
03/28/2018, 9:18 AMBro
03/29/2018, 5:37 PMlastState: someUUID
property to the player type, that would be changed on every update. That way, the where: PlayerWhereUniqueInput
would verify the last known state returned from the preceding query and nested mutation transactions would take care of the rest. I'm not sure if this was the type of pattern the Prisma developers had in mind or not.