Skip to content

removed connectOrCreate #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2025
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
48 changes: 0 additions & 48 deletions modules/ROOT/pages/mutations/update.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,54 +103,6 @@ mutation {
}
----

== `connectOrCreate` relationships

Consider the example provided in the xref:mutations/create.adoc#_connectorcreate_relationships[`create`] page:

[source, graphql, indent=0]
----
mutation {
createActors(input: {
name: "Tom Hanks",
movies: {
connectOrCreate: {
where: { node: { id_EQ: "1234" } }
onCreate: { node: { title: "Forrest Gump" } }
}
}
}) {
info {
nodesCreated
}
}
}
----

`connectOrCreate` is also available in `update` operations:

[source, graphql, indent=0]
----
mutation {
updateActors(
update: {
movies: {
connectOrCreate: {
where: { node: { id_EQ: "1234" } }
onCreate: { node: { title: "Forrest Gump" } }
}
}
},
where: { name_EQ: "Tom Hanks" }
) {
info {
nodesCreated
}
}
}
----

This operation is equivalent to the previous example.

== Array methods

Array methods allow the modification of existing property arrays in `update` mutations within these entities:
Expand Down