Neo4j GraphQL @unique constraint composite key (uniqueness defined by multiple fields)

Having a great time with Neo4j and GraphQL. One question I had:

Is it possible using a graphql type and directives to create a composite unique key? say I have the following type

type myType {
  id: String!
  version: String! 

And I want each node of myType to be unique when it has the same id AND version such that

[ { id: '123', version: '1'}, {id: '123', version: '2'} ]

would be valid. Is this currently possible?


You can add constrain on NODE KEY