Matija Sosic
09/27/2021, 2:34 PMList
which has one more Card
s (imagine Trello). If for a particular card I want to change ownership (make it owned by another list), how I can do that?
export const updateCard = async ({ cardId, data }, context) => {
return context.entities.Card.update({
where: { id: cardId },
data: {
// What should I write below? A failed attempt:
list: { connect: { id: data.listId } }
}
})
}
Ryan
09/27/2021, 2:52 PMMatija Sosic
09/27/2021, 2:55 PMUnknown arg `list` in data.list for type CardUncheckedUpdateInput
I am actually dealing with Card
and List
entities -> List can contain one or more cards (imagine Trello)Matija Sosic
09/27/2021, 2:56 PMMatija Sosic
09/27/2021, 2:59 PMMatija Sosic
09/27/2021, 3:00 PMentity List {=psl
id Int @id @default(autoincrement())
name String
pos Float
// List has a single author.
user User @relation(fields: [userId], references: [id])
userId Int
cards Card[]
psl=}
entity Card {=psl
id Int @id @default(autoincrement())
title String
pos Float
// Card belongs to a single list.
list List @relation(fields: [listId], references: [id])
listId Int
// Card has a single author.
author User @relation(fields: [authorId], references: [id])
authorId Int
psl=}
Matija Sosic
09/27/2021, 3:00 PMRyan
09/27/2021, 3:01 PMdata
for update apart from list
?Matija Sosic
09/27/2021, 3:04 PMRyan
09/27/2021, 3:17 PMprisma generate
and check again?Matija Sosic
09/27/2021, 6:02 PMMatija Sosic
09/27/2021, 6:02 PMRyan
09/28/2021, 5:53 AMRyan
09/28/2021, 5:54 AMMatija Sosic
09/28/2021, 8:30 AMRyan
09/28/2021, 8:37 AM