windkomo
04/16/2018, 8:57 PMChecklistItem
that’s part of another another model. The input has this form:
input ChecklistItemUpsertWithWhereUniqueWithoutRequestInput {
where: ChecklistItemWhereUniqueInput!
update: ChecklistItemUpdateWithoutRequestDataInput!
create: ChecklistItemCreateWithoutRequestInput!
}
What data do I need to provide for the upserts to be successful? I don’t understand why the where
field is needed in the case of a “create” upserthuv1k
04/16/2018, 8:59 PMwhere
is used to determine if it should create new record or update already created onewindkomo
04/16/2018, 9:00 PMnull
or undefined
}?huv1k
04/16/2018, 9:01 PMid
and if you don't provide it you create new one. So you can pass there null or undefined but its extra workwindkomo
04/16/2018, 9:03 PMwindkomo
04/16/2018, 9:03 PMid
sometimes they don’twindkomo
04/16/2018, 9:04 PMnull
and undefined
but I’m getting the error You provided an invalid argument for the where selector on ChecklistItem.
huv1k
04/16/2018, 9:05 PMhuv1k
04/16/2018, 9:05 PMwhere: { id: itemId }
windkomo
04/16/2018, 9:07 PMtype ChecklistItem {
checked: Boolean!
code: ACTIVITY_CODE!
createdAt: DateTime!
id: ID! @unique
request: Request @relation(name: "RequestChecklist")
subcode: CHECKLIST_CODE!
updatedAt: DateTime!
}
type Request {
budget: Int
checklist: [ChecklistItem!]! @relation(name: "RequestChecklist")
createdAt: DateTime!
description: String!
id: ID! @unique
}
something like thiswindkomo
04/16/2018, 9:07 PMrequest
huv1k
04/16/2018, 9:08 PMwindkomo
04/16/2018, 9:09 PMupdateRequest
resolver?windkomo
04/16/2018, 9:09 PMhuv1k
04/16/2018, 9:09 PMwindkomo
04/16/2018, 9:12 PM