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

fix(dgraph): id generation overlap #10719

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

korzhanov
Copy link

@korzhanov korzhanov commented Apr 24, 2024

☕️ 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

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

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
@korzhanov korzhanov requested a review from ndom91 as a code owner April 24, 2024 21:23
Copy link

vercel bot commented Apr 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) Apr 24, 2024 9:24pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2024 9:24pm

@github-actions github-actions bot added adapters Changes related to the core code concerning database adapters dgraph @auth/dgraph-adapter labels Apr 24, 2024
@ndom91 ndom91 changed the title Fix createUser at DGraph Adapter fix(dgraph): id generation overlap Apr 28, 2024
@ndom91
Copy link
Member

ndom91 commented Apr 28, 2024

Just curious why the current tests pass and why this isn't necessary for createSession or createVerificationToken, for example, then? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters dgraph @auth/dgraph-adapter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants