Closed samrith-s closed 4 years ago
Thank you for creating this issue 👍
So indeed UserGetSelectPayload
was exported before and documented here but disappeared after the dynamic client changes by @timsuchanek
Now there is indeed UserGetPayload
I don't know any replacement or workaround yet, @timsuchanek will be the best person for that but he's on holiday at the moment. We'll get back as soon as possible 😃
Hey @samrith-s, thanks for opening this issue. I just updated the docs. This is how the new type UserGetPayload
can be used:
import { UserGetPayload } from "@prisma/client";
// Define a type that includes the relation to `Post`
type UserWithPosts = UserGetPayload<{
include: { posts: true }
}>
// Define a type that only contains a subset of the scalar fields
type UserPersonalData = UserGetPayload<{
select: { email: true; name: true }
}>
Gotcha, thanks! 😄
Hey,
Before installing
@prisma/client@2.0.0-alpha.904
andprisma2@2.0.0-alpha.904
, I used to get a<Collection>GetSelectPayload
for every model.I used to use it to annotate the arguments to my functions like so:
Now,
@prisma/client
doesn't have any export calledUserGetSelectPayload
. So I tried this approach:But this doesn't work and I get the following errors, which are fairly understandable:
My question is, is there any replacement for
*GetSelectPayload
?