joao.santos
11/14/2017, 12:15 PMtype PatientProfile @model {
createdAt: DateTime!
id: ID! @isUnique
updatedAt: DateTime!
name: String!
number: Int! @isUnique
lastName: String
lastViewed: String
patientDocumentation: PatientDocumentation @relation(name: "DocumentationOnPatient")
}
type PatientDocumentation @model {
hours12: String
id: ID! @isUnique
natural: String
patientProfile: PatientProfile @relation(name: "DocumentationOnPatient")
profile: String
video: String
withdrawn: String
xray: String
}
Maslov
11/14/2017, 1:13 PMMaslov
11/14/2017, 1:14 PMMaslov
11/14/2017, 1:15 PMtaikn
11/14/2017, 1:16 PMpatientDocumentationId
to your mutation payload:
mutation {
createPatientProfile( ... patientDocumentationId: <id goes here>) {
id
}
}
this will create the connection, check the docs on Relation Mutations for more info: https://docs-next.graph.cool/docs/reference/graphql-api/mutation-api-ol0yuoz6go#relation-mutationsjoao.santos
11/14/2017, 3:48 PMMaslov
11/14/2017, 3:50 PMjoao.santos
11/14/2017, 3:56 PMtaikn
11/14/2017, 4:41 PMmutation {
createPatientProfile( ...
patientDocumentation: {
hours12: "hours value"
natural: "natural value"
profile: "profile value"
video: "video value"
withdrawn: "withdrawn value"
xray: "xray value"
}
...) {
id
}
}
taikn
11/14/2017, 4:41 PMjoao.santos
11/14/2017, 5:20 PMjoao.santos
11/14/2017, 5:21 PMjoao.santos
11/14/2017, 5:21 PMmutation createPatientProfileAndDocumentation {
createPatientProfile(
name: "name"
lastName: "lastName"
number: 6
patientDocumentation: {
profile: "profile"
natural: "natural"
}
) {
id
patientDocumentation{
id
}
}
}
joao.santos
11/14/2017, 5:21 PMjoao.santos
11/14/2017, 5:21 PMjoao.santos
11/14/2017, 5:21 PMjoao.santos
11/14/2017, 5:21 PM