【发布时间】:2022-06-20 23:56:04
【问题描述】:
使用示例here,如果我随后将图像字段添加到帖子:
// schema.ts
import { list } from '@keystone-6/core';
import { select, relationship, text, timestamp } from '@keystone-6/core/fields';
export const lists = {
Post: list({
fields: {
featureImage: image(),
}),
/* ... */
},
/* ... */
});
然后如何调整seed/index.ts 文件以从本地驱动器上传图像?
// seed/index.ts
await context.query.Post.createOne({
data: {
...postData,
featureImage: { /* ??? What goes here ??? */ }
},
query: 'id',
});
否则,我如何以编程方式添加图像以便 keystonejs 知道它们?
【问题讨论】:
标签: javascript graphql keystonejs