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
8 changes: 4 additions & 4 deletions modules/ROOT/pages/mutations/create.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ Read about xref:mutations/update.adoc#_connectorcreate_relationships[`update`] f

== `connectOrCreate` relationships

If a related node has a `@unique` or `@id` directive defined, `connectOrCreate` can be used in a nested `create` to perform a `MERGE` operation on the related node.
This should create a new relationship and the related node if it doesn't exist yet.
If a related node has the `@unique` directive defined, `connectOrCreate` can be used in a nested `create` to perform a `MERGE` operation on the related node.
This will create a new relationship and the related node if it doesn't exist yet.

Consider the following type definitions:

Expand All @@ -125,7 +125,7 @@ type Actor {

type Movie {
title: String
id: ID! @id
id: ID! @id @unique
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN)
}
----
Expand Down Expand Up @@ -163,4 +163,4 @@ The Neo4j GraphQL Library contains an optimization feature designed to mitigate

* A field is populated using the directive `@populated_by`.
* The `connect` or `connectOrCreate` operation is used.
* Interface and union types are present in the mutation.
* Interface and union types are present in the mutation.