Hello,
the updatedAt system field do not update anymore on field change in v1.8.3.
Steps to reproduce :
1: prisma init
2: Change model to add createdAt and updatedAt
type User {
id: ID! @unique
name: String!
createdAt: DateTime!
updatedAt: DateTime!
}
3: Deploy on prisma cloud eu1
4: Create a user
mutation{createUser(data:{name:"test2"}){id, createdAt, updatedAt}}
Result :
{
"data": {
"createUser": {
"id": "cjht72uyjvrx50b75k7vy5rnf",
"createdAt": "2018-05-30T14:17:07.389Z",
"updatedAt": "2018-05-30T14:17:07.389Z"
}
}
}
5: update the user :
mutation{updateUser(data:{name:"BBB"}, where:{id:"cjht72uyjvrx50b75k7vy5rnf"}){id, name,createdAt, updatedAt }}
Result:
{
"data": {
"updateUser": {
"id": "cjht72uyjvrx50b75k7vy5rnf",
"name": "BBB",
"createdAt": "2018-05-30T14:17:07.389Z",
**"updatedAt": "2018-05-30T14:17:07.389Z"**
}
}
}
Expected:
updatedAt should have changed to reflect the date/time of previous update
This plays out the same way on a local cluster.
I have this example on accessible from prisma cloud. Here is the link to the playground : https://graphqlbin.com/v2/yrA0Ty
Thanks for any help on this !
Regards,
Nicolas Signes
Hey @nsignes, thanks for reporting this. I can reproduce this on MySql and will fix it.
Hi do4g,
We're using the MySQL connector, and migrations left unspecified in the docker-compose.yaml (which means it's turned on by default, according to the documentation).
The bug occurs on a test service deployed to Prisma Cloud EU1, but I don't know how this one is configured.
Read your edit: Thanks !
The fix is now available in the stable channel.
@do4gr Still seeing this as an issue. What version was this fixed in?
Most helpful comment
Hey @nsignes, thanks for reporting this. I can reproduce this on MySql and will fix it.