cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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

Hi!
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?

Thanks!

1 REPLY 1

You can add constrain on NODE KEY