Prisma client extension support #965
Replies: 1 comment
-
This would require a big refactor of how the Prisma plugin derives it's types. Currently Pothos uses a generator based in your prisma schema to generate the needed type-information, and so it can't be aware of the type-information available from these client extensions. Getting this all to work well together is likely more effort than it's worth. You can very easily achieve something similar doing this at the GraphQL level rather than the prisma level: builder.prismaNode("Person", {
select: { id: true },
id: { field: "id" },
fields: (t) => ({
first: t.exposeString("first"),
last: t.exposeString("last"),
fullname: t.string('fullname', {
select: { first: true, last: true },
resolve: ({ first, last }) => `${first} ${last}`,
})
}),
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello 👋
Since Prisma client extensions are now generally available, I was curious as to how it would be possible to expose extended result fields.
Let's say I have the following model:
... with the following result extension:
... it's not currently possible to do this:
Is there a workaround for this ATM or any plan to support extended result fields ?
Beta Was this translation helpful? Give feedback.
All reactions