Ashiqur Rahman
06/29/2020, 12:53 PMError in Prisma Client request:
Error:
Invalid `prisma.order.findMany()` invocation:
PANIC: Application logic invariant error: received null value for field post which may not be null
at PrismaClientFetcher.request (/home/ashik/.cache/prisma/studio/home-ashik-exp-prisma2-react-boilerplate-packages-backend/runtime/index.js:1:86042)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
can anyone tell, why I am getting the above error in prisma studio?
when order is created, I saw post is connected,
you can see from the output of playground, there is a postId, no doubt post is connected. party postgresSamrith Shankar
06/29/2020, 1:22 PMSamrith Shankar
06/29/2020, 1:22 PMAshiqur Rahman
06/29/2020, 1:40 PMmodel Order {
id Int @default(autoincrement()) @id
customer User @relation(fields: [customerId], references: [id])
customerId Int
post Post @relation(fields: [postId], references: [id])
postId Int
Charge Charge[]
}Ashiqur Rahman
06/29/2020, 1:40 PMcreateOrder mutation where I connect post:
https://gist.github.com/ashiqdev/fdd48ea00d740c6eeeb6c4dce8be0626#file-createorder-js-L39Samrith Shankar
06/29/2020, 1:41 PMnull?Ashiqur Rahman
06/29/2020, 1:43 PMSamrith Shankar
06/29/2020, 1:44 PMAshiqur Rahman
06/29/2020, 1:47 PMmodel Post {
id Int @default(autoincrement()) @id
title String
cost Float?
body Json
published Boolean
author User @relation(fields: [authorId], references: [id])
authorId Int
comments Comment[]
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
Order Order[]
}Samrith Shankar
06/29/2020, 1:48 PMAshiqur Rahman
06/29/2020, 1:51 PMSamrith Shankar
06/29/2020, 1:51 PMAshiqur Rahman
06/29/2020, 2:17 PMAshiqur Rahman
06/29/2020, 2:23 PMAshiqur Rahman
06/29/2020, 2:52 PMSamrith Shankar
06/29/2020, 2:53 PMAshiqur Rahman
06/29/2020, 2:57 PM"@prisma/client": "^2.1.3",
"@prisma/cli": "^2.0.0-beta.5",Samrith Shankar
06/29/2020, 2:58 PMnpx prisma --versionAshiqur Rahman
06/29/2020, 3:06 PMSamrith Shankar
06/29/2020, 4:02 PMAshiqur Rahman
06/30/2020, 3:39 AM