Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions modules/ROOT/pages/mutations/update.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,10 @@ type Mutation {
updatePosts(
where: PostWhere
update: PostUpdateInput
connect: PostConnectInput
disconnect: PostDisconnectInput
create: PostCreateInput
delete: PostDeleteInput
): UpdatePostsMutationResponse!
updateUsers(
where: UserWhere
update: UserUpdateInput
connect: UserConnectInput
disconnect: UserDisconnectInput
create: UserCreateInput
delete: UserDeleteInput
): UpdateUsersMutationResponse!
}
----
Expand Down Expand Up @@ -91,10 +83,12 @@ Instead of creating a `Post` with the `create` mutation and then connecting it t
mutation {
updateUsers(
where: { name: "John Doe" }
create: {
posts: [
{ node: { content: "An interesting way of adding a new Post!" } }
]
update: {
posts: {
create: [
{ node: { content: "An interesting way of adding a new Post!" } }
]
}
}
) {
users {
Expand Down Expand Up @@ -137,10 +131,12 @@ For `update` operations, `connectOrCreate` can also be used as a top-level input
----
mutation {
updateActors(
connectOrCreate: {
update: {
movies: {
where: { node: { id: "1234" } }
onCreate: { node: { title: "Forrest Gump" } }
connectOrCreate: {
where: { node: { id: "1234" } }
onCreate: { node: { title: "Forrest Gump" } }
}
}
},
where: { name: "Tom Hanks" }
Expand Down