prisma-client-extensions
prisma-client-extensions copied to clipboard
Accessing related entities on the extended client
The extended client doesn't provide access to the related fields.
I modified this doc example's script.ts file to illustrate the problem:
The extended client (extension is empty) doesn't have the password property on the user model entity although it's present in the original (non-extended) one.
According to the schema, the password is a foreign entity relation:
Same issue here!
I don't have a good mental model for how this is working, but seeing two issues:
-
password
is a relation, so it needs to explicitly included or selected - the query needs to be
await
ed before its data is accessible