Replies: 4 comments 1 reply
|
Hello @diericx 👋 Thank you for creating the GitHub Issue. 🙏 I was able to reproduce the issue with your repository. It looks like a bug to me. I can see that our engineering team has triaged the issue, so they should be able to get back to you on the GitHub Issue. I'll share it internally with the team to verify if this indeed is a bug and to make sure that there is not anything obvious that might be missing. |
|
Hi there, To keep our discussions organized and focused on the most relevant topics, we’re reviewing and tidying up our backlog. As part of this process, we’re closing discussions that haven’t had any recent activity and appear to be outdated. If this discussion is still important to you or unresolved, we’d love to hear from you! Feel free to reopen it or start a new one with updated details. For more details about our priorities and vision for the future of Prisma ORM, check out our latest blog post: https://www.prisma.io/blog/prisma-orm-manifesto. Thank you for your understanding and being part of the community! |
|
I was able to work around this by getting the type from the Prisma query function. async function getUsers() {
return prisma.users.findMany({
// What ever is in here will represent the type `User` below.
})
}
type Users = Awaited<ReturnType<typeof getUsers>>You can also set it up like this: // types.ts
export const COMPANY_INCLUDE = {
accounts: {
orderBy: [
{
type: "asc" as const,
},
{
name: "asc" as const,
},
],
include: {
credits: true,
debits: {
select: { id: true },
},
},
},
};
export type Company = Awaited<
ReturnType<
typeof prisma.company.findFirst<{
include: typeof COMPANY_INCLUDE;
}>
>
>;// actions.ts
export async function getCompany() {
return prisma.company.findFirst({
include: COMPANY_INCLUDE,
});
}// CompanyComponent.tsx
export default async function Page() {
const company = await getCompany();
return <CompanyComponent company={company} />
}
function CompanyComponent({ company }: { company: Company }) {
return <span>{company?.accounts[0].debits[0].id}</span>
} |
|
Adding a comment to say that this problem is still there. |
Uh oh!
There was an error while loading. Please reload this page.
Question
Hey guys, just wanted to open a discussion for this issue I created the other day. I am sort of blocked on this right now and am having trouble debugging. I have found that typescript compilation seems to stop at a given depth when using
GetPayloadas well as a finalselect.Here is the full description of the issue:
#21264
I'm worried this may be user error so I just wanted to see if anyone else has run into anything like this.
How to reproduce (optional)
No response
Expected behavior (optional)
No response
Information about Prisma Schema, Client Queries and Environment (optional)
No response
All reactions