Open Rabeet-5 opened 11 months ago
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 https://github.com/safak/next-blog/issues/21#issuecomment-1763038236, 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 error occur ..when you writing manually on category and post..DON'T DO THIS. just click on category select to mark a category do same thing for user and save. it will works
@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.
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 ,