neo4j-graphql-js
neo4j-graphql-js copied to clipboard
Need uniqueness schema constraint with @unique directive
The library needs a way of implementing all Neo4j database constraints in order for the GraphQL schema to correctly function as the definitive 'schema' for a project.
Uniqueness is the best place to start, and the @unique schema directive is a quite common idiom.
ref: https://neo4j.com/docs/cypher-manual/current/schema/constraints/#query-constraint-unique-nodes
I would like to implement node property uniqueness in a GraphQL schema via the @unique directive at the end of a property definition.
e.g.
type Book {
isbn: ISBN! @unique
title: String!
...
}
The @unique directive here should be equivalent to CREATE CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE
@johnymontana Any suggestions on how to best implement this?
Duplicate of #137
https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608