Skip to content

getBookmarks By UserId dont work #14

@YanirMidler24

Description

@YanirMidler24

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
OR?: List
NOT?: BookmarkWhereInput | List
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions