pasa
04/10/2018, 8:42 PMpasa
04/10/2018, 8:43 PMtype List {
id: ID! @unique
listEntries: [ListEntry!]! @relation(name: "ListentriesOnLists", cascadeDelete: true)
name: String!
site: Site
toDelete: Boolean! @default(value: false)
}
type ListEntry {
createdAt: DateTime!
updatedAt: DateTime!
description: String @default(value: "")
id: ID! @unique
isCompleted: Boolean! @default(value: false)
list: List! @relation(name: "ListentriesOnLists", cascadeDelete: false)
position: Int! @default(value: 1)
starred: Boolean! @default(value: false)
task: String!
person: Person
category: Category
}
pasa
04/10/2018, 8:43 PMdeleteList(parent, { id }, ctx, info) {
return ctx.db.mutation.deleteList({ where: { id } }, info)
},
... in schema.graphql:
deleteList(id: ID!): List
pasa
04/10/2018, 8:46 PMUncaught (in promise) Error: GraphQL error: The change you are trying to make would violate the required relation '_ListentriesOnLists' between List and ListEntry
nilan
04/10/2018, 9:08 PMharmony
04/10/2018, 9:11 PMonDelete="CASCADE"
?harmony
04/10/2018, 9:12 PMonDelete: CASCADE
harmony
04/10/2018, 9:12 PMListEntry
nilan
04/10/2018, 9:17 PMpasa
04/10/2018, 10:05 PMcascadeDelete: true
an earlier syntax, or was it just the syntax from the proposal?
I definitively read that syntax somewhere. I haven't made it up...harmony
04/10/2018, 10:06 PM