This is an issue with Typescript's structural typi...
# community-help
f
This is an issue with Typescript's structural typing, rather than with the interface itself. Since the new schema object isn't hinted to be an array of
CollectionFieldSchema
, the resulting type of update schema isn't sure to be matching that of
CollectionUpdateSchema
. A solution to this would be to just guard the constant with the
CollectionFieldSchema
type, or just guard the update schema object and define any change in there i.e
Copy code
const update_schema: CollectionUpdateSchema = {
  fields: [
    {
      name: "title",
      type: "string",
      optional: false,
    },
  ],
};
1