Skip to content

Instantly share code, notes, and snippets.

@socialwell-demos
Last active June 9, 2022 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save socialwell-demos/0bb3d8484a2ec177fadc1f09f0507de6 to your computer and use it in GitHub Desktop.
Save socialwell-demos/0bb3d8484a2ec177fadc1f09f0507de6 to your computer and use it in GitHub Desktop.
Keystone Schema User
import { list } from '@keystone-6/core';
import { password, select, text } from '@keystone-6/core/fields';
export const User = list({
fields: {
name: text({ validation: { isRequired: true } }),
email: text({
validation: { isRequired: true },
isIndexed: 'unique',
isFilterable: true,
}),
password: password(),
designation: select({
options: [
{ label: 'User', value: 'user' },
{ label: 'Admin', value: 'admin' }
],
})
},
ui: {
listView: {
initialColumns: ['name', 'email'],
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment