prisma-client-extensions icon indicating copy to clipboard operation
prisma-client-extensions copied to clipboard

Accessing related entities on the extended client

Open picasocro1 opened this issue 1 year ago • 2 comments

The extended client doesn't provide access to the related fields.

I modified this doc example's script.ts file to illustrate the problem:

image

image

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:

image

picasocro1 avatar Jun 27 '23 22:06 picasocro1

Same issue here!

PiotrekPKP avatar Jun 28 '23 16:06 PiotrekPKP

I don't have a good mental model for how this is working, but seeing two issues:

  1. password is a relation, so it needs to explicitly included or selected
  2. the query needs to be awaited before its data is accessible

Screen Shot 2023-07-19 at 1 57 10 PM

phil-loops avatar Jul 19 '23 18:07 phil-loops