-
Lets assume the following schema type Work {
id: ID
title: String
student: Student
}
type Student {
id: ID
works: [Work!]
} When I now insert a new student and I want to already connect a work to it, I would need to do something like mutation {
createStudent(data: {
works: {
create: [{title: 'foo', student: {connect: {id: ???}}]
}
}) |
Beta Was this translation helpful? Give feedback.
Answered by
emmatown
Mar 10, 2022
Replies: 1 comment
-
By creating You do not need explicitly provide a |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
emmatown
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By creating
work
on aStudent
like that, eachwork
item will in thecreate
array will automatically be connected as this is relationship field.You do not need explicitly provide a
connect
field.