does null get overlooked during prisma update
Example
So basically my questions are
1) if age already has a value and input.age doesn't have any value will this override what's there and put null or prisma will skip the update of age because null was provided
2) if undefined or null is provided will this trigger an update or prisma is smart enough to skip it?
4 Replies
3) during prisma create if an empty string is provided will that crate an empty field or prisma is smart enough to put null?
I was testing this today and as far as I've seen Prisma will put null.
For Prisma null is a value, so it will override. Check this: https://www.prisma.io/docs/concepts/components/prisma-client/null-and-undefined
Prisma
Null and undefined (Reference)
How Prisma Client handles null and undefined, including a GraphQL use case.
1) Yes, it will override.
null
is a proper value accepted by Prisma so it will override. Use undefined
if you want Prisma to ignore it.
2) If it's undefined then the query engine will ignore it, yes
3) An empty string means a very different thing to Prisma and your db than null
, so it will put that empty string as the value