nosykretts
05/22/2017, 1:30 PMyergi
05/22/2017, 1:39 PMyergi
05/22/2017, 1:39 PMnosykretts
05/22/2017, 1:40 PMyergi
05/22/2017, 1:41 PMnosykretts
05/22/2017, 1:45 PMyergi
05/22/2017, 1:48 PMtype Patient implements Node {
exams: [Exam!]! @relation(name: "ExamOnPatient")
name: String!
etc.
}
type Exam implements Node {
price: Int!
branchTypes: [BranchType!]! @relation(name: "BranchTypeOnExam")
patient: Patient! @relation(name: "ExamOnPatient")
etc.
}
type BranchType implements Node {
name: String!
exams: [Exam!]! @relation(name: "BranchTypeOnExam")
etc.
}nosykretts
05/22/2017, 1:51 PMyergi
05/22/2017, 1:51 PMyergi
05/22/2017, 1:52 PMyergi
05/22/2017, 1:53 PMprice field would live in Exam, not BranchType, so that you could have the different prices.nosykretts
05/22/2017, 1:55 PMyergi
05/22/2017, 1:56 PMnosykretts
05/22/2017, 2:21 PMyergi
05/22/2017, 2:26 PMnosykretts
05/22/2017, 2:28 PMyergi
05/22/2017, 2:29 PMprice is a field of Exam, whatever your system is where you’re creating the mutation calls to create new data should be able to set the price field based on the branches you’re relating the new data to.nosykretts
05/22/2017, 2:30 PMyergi
05/22/2017, 2:31 PMnosykretts
05/22/2017, 2:31 PMyergi
05/22/2017, 2:31 PMyergi
05/22/2017, 2:33 PMyergi
05/22/2017, 2:34 PMnosykretts
05/22/2017, 2:36 PMyergi
05/22/2017, 2:36 PMyergi
05/22/2017, 2:37 PMyergi
05/22/2017, 2:38 PMExamPrice node, that has the price field, and that joins on a one-to-many relationship to BranchType.yergi
05/22/2017, 2:38 PMExam to ExamPrice.yergi
05/22/2017, 2:39 PMExam would have multiple prices, but each ExamPrice would belong to a single exam.nosykretts
05/22/2017, 2:40 PMyergi
05/22/2017, 2:42 PMnosykretts
05/22/2017, 2:43 PMnilan
05/23/2017, 8:51 AM