-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prisma client error #21
Comments
Select Category And user from category table : click the gray color category and user from the select the category and user |
give all the essential details to prisma for ex-define all foreign keys first an restart ur prisma |
Try adding all the fields, I was getting the exact same error for like an hour but then somehow it got fixed make sure the category and the user email matches the previously added one |
yes i found it just select all the required fields like users,
categories and tick over them then the issue will be reso
lved
…On Sat, Oct 14, 2023 at 9:53 PM AatifxShaikh ***@***.***> wrote:
i am getting the exact same error. Did you found any solution
—
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A744SA45SDJLWEHKLCMUJATX7K7PRAVCNFSM6AAAAAA5MYMOYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRTGAZTQMRTGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Failed to commit changes. Invalid prisma.post.create() Select the user ✅ category ✅ then save. |
This comment was marked as duplicate.
This comment was marked as duplicate.
thanks bro. i have the same error. and this is very helpful. |
when im putting the data of post in a prisma studio , it gives me this error , Type: undefined
Message:
Invalid
prisma.post.create()
invocation:{
data: {
slug: "1",
title: "1",
desc: "klad",
img: "/fashion.png",
views: 0,
cat: {
connect: {
? id?: String,
? slug?: String,
? AND?: CategoryWhereInput | CategoryWhereInput[],
? OR?: CategoryWhereInput[],
? NOT?: CategoryWhereInput | CategoryWhereInput[],
? title?: StringFilter | String,
? img?: StringNullableFilter | String | Null,
? Posts?: PostListRelationFilter
}
},
user: {
connect: {}
},
comments: {}
},
select: {
id: true,
createdAt: true,
slug: true,
title: true,
desc: true,
img: true,
views: true,
catSlug: true,
cat: true,
userEmail: true,
user: true,
comments: true
}
}
Argument
connect
of type CategoryWhereUniqueInput needs at least one ofid
orslug
arguments. Available options are listed in green.Code: undefined
Query:
[object Object]
however ! i have read and change the code , but still i am getting this error while creating posts in prisma studio ,
The text was updated successfully, but these errors were encountered: