I'd like to be able to define computed fields in nested types:
export const Item = defineNestedType(() => ({
name: "Item",
fields: {
name: { type: "string", required: true },
},
computedFields: {
slug: {
type: "string",
resolve: ({ name }) => slugify(name),
},
},
}))
It seems that computed fields are currently only available in document types though. I think supporting computed fields also in nested types would be a great enhancement of this awesome project.
I'd like to be able to define computed fields in nested types:
It seems that computed fields are currently only available in document types though. I think supporting computed fields also in nested types would be a great enhancement of this awesome project.