Skip to content
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

Open
Rabeet-5 opened this issue Sep 29, 2023 · 7 comments
Open

Prisma client error #21

Rabeet-5 opened this issue Sep 29, 2023 · 7 comments

Comments

@Rabeet-5
Copy link

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 of id or slug 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 ,

Untitled

@Indula-Perera
Copy link

Select Category And user from category table : click the gray color category and user from the select the category and user

@karshdev
Copy link

karshdev commented Oct 4, 2023

give all the essential details to prisma for ex-define all foreign keys first an restart ur prisma

@AatifxShaikh
Copy link

AatifxShaikh commented Oct 14, 2023

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

@Rabeet-5
Copy link
Author

Rabeet-5 commented Oct 14, 2023 via email

@allanmathenge
Copy link

Failed to commit changes. Invalid prisma.post.create()

Select the user ✅ category ✅ then save.

@rohitpatel0011

This comment was marked as duplicate.

@wayosu
Copy link

wayosu commented Dec 13, 2023

@Indula-Perera

Select Category And user from category table : click the gray color category and user from the select the category and user

thanks bro. i have the same error. and this is very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants