Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion modules/ROOT/pages/errors/gql-errors/22NCC.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= 22NCC

== Status description
error: data exception - node element type specified incorrectly. The node element type `{ <<graphTypeElement>> }` identified by the label `{ <<label>> }` is different to the one specified in the query `{ <<graphTypeElement>> }`.
error: data exception - node element type specified incorrectly. The node element type `{ <<graphTypeElement>>1 }` identified by the label `{ <<label>> }` is different to the one specified in the query `{ <<graphTypeElement>>2 }`.

== Explanation
This error occurs when attempting to drop a node element type from the graph type, but the specified element type does not match the existing one for the given label.
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/errors/gql-errors/22NCD.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= 22NCD

== Status description
error: data exception - relationship element type specified incorrectly. The relationship element type `{ <<graphTypeElement>> }` identified by the relationship type `{ <<relType>> }` is different to the one specified in the query `{ <<graphTypeElement>> }`.
error: data exception - relationship element type specified incorrectly. The relationship element type `{ <<graphTypeElement>>1 }` identified by the relationship type `{ <<relType>> }` is different to the one specified in the query `{ <<graphTypeElement>>2 }`.

== Explanation
This error occurs when attempting to drop a relationship element type from the graph type, but the specified element type does not match the existing one for the given relationship type.
Expand Down
40 changes: 39 additions & 1 deletion modules/ROOT/pages/errors/gql-errors/22NCF.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This also applies to graph type constraints defined inline of the graph type ele

== Example scenario

=== ALTER
=== ALTER existing constraint

Given the existing graph type:

Expand Down Expand Up @@ -51,6 +51,44 @@ ALTER CURRENT GRAPH TYPE ADD {
}
----

=== Remove a KEY constraint using ALTER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're adding and not removing a KEY constraint 🤔


Given the existing graph type:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
( :Person => {name :: STRING })
}
----

Execute the query:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE ALTER {
( :Person => {name :: STRING IS KEY } )
}
----

The query returns an error with GQLSTATUS 22NCF and the status description:


[source]
----
error: data exception - graph type constraint not supported. Graph type constraint definitions are not supported in the `ALTER GRAPH TYPE ALTER` operation.
----

To fix this, change the query as follows:

[source, cypher]
----
ALTER CURRENT GRAPH TYPE ADD {
CONSTRAINT nameForKeyConstraint FOR (p:Person) REQUIRE p.name :: STRING IS KEY
}

----

=== DROP

In this example we attempt to drop an undesignated constraint with an ALTER CURRENT GRAPH TYPE DROP query.
Expand Down