Closed pauldesmondparker closed 1 week ago
Hi! I'd love if you could open a PR to document it <3
I'm not sure that it deserves documentation. This is a case of me abusing the usage of Prisma
. Writes are done with objects that conform to Prisma.JsonValue
, and typescript will emit an error if it does not. However, I was passing in a string (the stringified object) and that technically conforms (RFC7159).
This issue is just for anyone else who happens to implement this particular comedy of errors.
Raising this issue as documentation, in case it helps someone else in the future.
My LSP was recognizing my prisma field as the type I declared, but at runtime it was still a string.
My relevant
schema.prisma
:This was producing the desired result in my LSP.
However, due to a mistake whereby I was still seeding the database with records saved with output from
JSON.stringify
, the whole process seemed to be short-circuited for the tests (vitest) that I was running.The resolution was to apply the
{lat: 22.2344, lng: 103.2564}
object directly to thegeo_point
field in the seed.