-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix(dgraph): id generation overlap #10719
base: main
Are you sure you want to change the base?
Conversation
Dgraph will generate the ID by itself. In Dgraph, every node has a unique 64-bit identifier that you can expose in GraphQL using the ID type. An ID is auto-generated, immutable and never reused. Each type can have at most one ID field. The ID type works great when you need to use an identifier on nodes and don’t need to set that identifier externally
fix dgraph adapter createUser
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Just curious why the current tests pass and why this isn't necessary for |
@ndom91 Sorry, I didn't see your comment in this thread without mention.
The test uses a predefined id value next-auth/packages/adapter-dgraph/test/index.test.ts Lines 22 to 43 in 770112c
And in reality, the random UUID is invalid, it doesn't match the DGraph UID conditions. Situation similar to the FaunaDB adapter next-auth/packages/adapter-fauna/test/index.test.ts Lines 17 to 26 in 770112c
And I think maybe |
☕️ Reasoning
Dgraph will generate the ID by itself. In Dgraph, every node has a unique 64-bit identifier that you can expose in GraphQL using the ID type. An ID is auto-generated, immutable and never reused. Each type can have at most one ID field.
The ID type works great when you need to use an identifier on nodes and don’t need to set that identifier externally
DGraph type docs
Since next-auth.js or auth.js creates a new user id, this causes an error and does not save the entry to dgraph
🧢 Checklist
🎫 Affected issues
📌 Resources