nestjs-api-tutorial icon indicating copy to clipboard operation
nestjs-api-tutorial copied to clipboard

getBookmarks By UserId dont work

Open YanirMidler24 opened this issue 2 years ago • 0 comments

When i try to run the test for getBookmarks i get an error :

Unknown arg userId in where.userId for type BookmarkWhereInput. Did you mean id? Available args: type BookmarkWhereInput { AND?: BookmarkWhereInput | List<BookmarkWhereInput> OR?: List<BookmarkWhereInput> NOT?: BookmarkWhereInput | List<BookmarkWhereInput> id?: IntFilter | Int createdAt?: DateTimeFilter | DateTime updatedAt?: DateTimeFilter | DateTime title?: StringFilter | String description?: StringNullableFilter | String | Null link?: StringFilter | String }

this is my prisma model :

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model User {
  id        Int      @id @default(autoincrement())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  email String @unique
  hash  String

  firstName String?
  lastName  String?

  bookmarks Bookmark[]

  @@map("users")
}

model Bookmark {
  id        Int      @id @default(autoincrement())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  title       String
  description String?
  link        String

  userId Int
  user   User @relation(fields: [userId], references: [id])

  @@map("bookmarks")
}

why i got this error?

YanirMidler24 avatar Jun 07 '23 14:06 YanirMidler24