-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
After using the CLI tool to generate a new Keystone 6 project, I went to create a post and was met with the error in the screenshot below. I was able to generate a post through the GraphQL API, but trying to edit it in the Admin UI results in the same error.
package.json dependencies:
"dependencies": {
"@keystone-6/auth": "^8.0.0",
"@keystone-6/core": "^6.0.0",
"@keystone-6/fields-document": "^9.0.0",
"typescript": "^5.5.0"
},Post part of the schema (I added one relation, but the error was happening before I added it):
Post: list({
// WARNING
// for this starter project, anyone can create, query, update and delete anything
// if you want to prevent random people on the internet from accessing your data,
// you can find out more at https://keystonejs.com/docs/guides/auth-and-access-control
access: allowAll,
// this is the fields for our Post list
fields: {
title: text({ validation: { isRequired: true } }),
// the document field can be used for making rich editable content
// you can find out more at https://keystonejs.com/docs/guides/document-fields
content: document({
formatting: true,
layouts: [
[1, 1],
[1, 1, 1],
[2, 1],
[1, 2],
[1, 2, 1],
],
links: true,
dividers: true,
// relationships: {
// mention: {
// listKey: 'Post',
// label: 'Mention',
// selection: 'id title',
// },
// },
}),
// with this field, you can set a User as the author for a Post
author: relationship({
// we could have used 'User', but then the relationship would only be 1-way
ref: 'User.posts',
// this is some customisations for changing how this will look in the AdminUI
ui: {
displayMode: 'cards',
cardFields: ['name', 'email'],
inlineEdit: { fields: ['name', 'email'] },
linkToItem: true,
inlineConnect: true,
},
many: false,
}),
sport: relationship({
ref: 'Sport.posts',
ui: {
displayMode: 'select',
},
many: false,
}),
// with this field, you can add some Tags to Posts
tags: relationship({
// we could have used 'Tag', but then the relationship would only be 1-way
ref: 'Tag.posts',
// a Post can have many Tags, not just one
many: true,
// this is some customisations for changing how this will look in the AdminUI
ui: {
displayMode: 'cards',
cardFields: ['name'],
inlineEdit: { fields: ['name'] },
linkToItem: true,
inlineConnect: true,
inlineCreate: { fields: ['name'] },
},
}),
},
}),Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels