Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @Unique Directive Back #206

Closed
fordneild opened this issue May 14, 2021 · 2 comments · Fixed by #547
Closed

Add @Unique Directive Back #206

fordneild opened this issue May 14, 2021 · 2 comments · Fixed by #547
Labels
feature request New feature or request neo4j-graphql.js regression Feature which was available in neo4j-graphql.js but is currently missing from @neo4j/graphql

Comments

@fordneild
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I would like to enforce the uniqueness of certain fields, which I was able to do using neoj4-graphql-js.
Describe the solution you'd like
A clear and concise description of what you want to happen.
@unique directive should give the nodes property a unique constraint
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Otherwise, I have to rely on developers not writing bugging code

Additional context
Add any other context or screenshots about the feature request here.

@fordneild fordneild added feature request New feature or request inbox labels May 14, 2021
@manonthemat
Copy link

100% agree. I'm utterly confused why it's not in the library.

@darrellwarde darrellwarde added the neo4j-graphql.js regression Feature which was available in neo4j-graphql.js but is currently missing from @neo4j/graphql label Jul 1, 2021
@lfritsche
Copy link

I'm using apoc.schema.assert right after the connection has been verified (driver.verifyConnectivity()).
e.g.: CALL apoc.schema.assert(null,{Product:['id']}) to prevent duplicate product IDs.
This works quiete well and gets executed every time I redeploy/restart the ApolloServer.

Would @Unique work in a similar way? Does this approach conflict with your internal index management or future @Unique implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request neo4j-graphql.js regression Feature which was available in neo4j-graphql.js but is currently missing from @neo4j/graphql
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants