Hi !! Is there an official way to specify the type...
# orm-help
y
Hi !! Is there an official way to specify the type for the prisma json type ? we are currently using type assertion.
const _user_ = _await prisma.user.findUnique_({
_where_:
{
_id_:
1,
},
})
_const userJson_ = _user.json as UserJson_
type UserJson = {
name: string
age: number
}
d
@YeonHoPark check
Copy code
import { User } from "@prisma/client";
It says your type
y
@Dante thank to your reply, but..
Copy code
model User {
  id     String   @id @default(cuid())
  name   String
  json   Json
}
what i say above is User.json type
d
@YeonHoPark check your
@node_modules/.prisma/client/index.d.ts
. It says all the types of your model in schema. that’s what I refer to.
r
@YeonHoPark 👋 Unfortunately this isn’t possible at the moment. It would be great if you could add a 👍 to this feature request so that we can know the priority for this.
😃 1
y
Hopefully this feature will be added soon !!
🙌 1
r
hey @Ryan following up on this. looked through documentation but haven’t seen anything. is this possible?