-
Notifications
You must be signed in to change notification settings - Fork 1.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
New id fields #5947
New id fields #5947
Conversation
🦋 Changeset detectedLatest commit: 61fa311 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/9gLvjGKny4Gkg3Z1A9TeRYnanpwb |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Can we have id field config globally in keystone config? I am thinking we would also want to map it for provider, once mongodb is there we can have mongoid or dbgenerated option. |
// isCuid is just "it's a string and it starts with c" | ||
// https://github.com/ericelliott/cuid/blob/215b27bdb78d3400d4225a4eeecb3b71891a5f6f/index.js#L69-L73 | ||
if (typeof val === 'string' && isCuid(val)) { | ||
return val; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note not lower-casing here is a difference from what we discussed. My thinking is that isCuid only accepts strings that with c
(as in only lower-case c
) so treating it as case insensitive seems strange.
Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 pending changeset update.
Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
* Id field experimenting * word * Try a different default to see what our tests do * Update things * snapshots * Update things * Remove a thing * field view * Fix ts errors * WIP * Fix a thing * Fix more tests * Fix things * Fix more things * More fixes * Reorder a thing so the failing output is easy to debug * Try a thing * Update schemas * Tests * Update docs * Add uuid dep * Changeset * Words * Add another changeset * Some more tests and cuid change * Update docs/pages/docs/apis/config.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs/pages/docs/apis/config.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update .changeset/eight-lions-stare.md Co-authored-by: Tim Leslie <timl@thinkmill.com.au> Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
* Id field experimenting * word * Try a different default to see what our tests do * Update things * snapshots * Update things * Remove a thing * field view * Fix ts errors * WIP * Fix a thing * Fix more tests * Fix things * Fix more things * More fixes * Reorder a thing so the failing output is easy to debug * Try a thing * Update schemas * Tests * Update docs * Add uuid dep * Changeset * Words * Add another changeset * Some more tests and cuid change * Update docs/pages/docs/apis/config.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs/pages/docs/apis/config.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update .changeset/eight-lions-stare.md Co-authored-by: Tim Leslie <timl@thinkmill.com.au> Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
* Id field experimenting * word * Try a different default to see what our tests do * Update things * snapshots * Update things * Remove a thing * field view * Fix ts errors * WIP * Fix a thing * Fix more tests * Fix things * Fix more things * More fixes * Reorder a thing so the failing output is easy to debug * Try a thing * Update schemas * Tests * Update docs * Add uuid dep * Changeset * Words * Add another changeset * Some more tests and cuid change * Update docs/pages/docs/apis/config.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs/pages/docs/apis/config.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update .changeset/eight-lions-stare.md Co-authored-by: Tim Leslie <timl@thinkmill.com.au> Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
* Id field experimenting * word * Try a different default to see what our tests do * Update things * snapshots * Update things * Remove a thing * field view * Fix ts errors * WIP * Fix a thing * Fix more tests * Fix things * Fix more things * More fixes * Reorder a thing so the failing output is easy to debug * Try a thing * Update schemas * Tests * Update docs * Add uuid dep * Changeset * Words * Add another changeset * Some more tests and cuid change * Update docs/pages/docs/apis/config.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update docs/pages/docs/apis/config.mdx Co-authored-by: Tim Leslie <timl@thinkmill.com.au> * Update .changeset/eight-lions-stare.md Co-authored-by: Tim Leslie <timl@thinkmill.com.au> Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
This replaces the idField option accepting regular field types to an object that can specify cuids, uuids or autoincrements. The default is now
cuid
instead ofautoincrement