Unique constraint in DQL


is there any way to have unique fields using DQL?

Hi can u explain what do you mean in “unique”?
If you want a predicate (field) to have unique values in each node you can use the @upsert directive and use the upsert mutation instead of regular mutation to insert unique data each time.

1 Like

Thank you for replying.
for example, I want usernames to be unique in my application

So yes the upsert directive + upsert mutations are what you need here.
Follow the link in my last message.
If you need more guidence let me know…

Have a good day

1 Like