We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I have the following in a Stackbit model definition:
export const ModelName = { // ... fields: [ { name: 'fieldName', type: 'string', hidden: true, required: false, } ] }
The type that is generated is:
type ModeName = { // ... fieldName?: string | undefined }
Great. Works like I would expect. Now if I add a default (initial value for Stackbit):
export const ModelName = { // ... fields: [ { name: 'fieldName', type: 'string', hidden: true, required: false, default: '', } ] }
type ModeName = { // ... fieldName: string }
Contentlayer assumes this is now a required field for some reason.
Note that this would be fine if I could override it. The problem is that I also can't just override a type. If I were to do something like this:
const documentTypes = stackbitConfigToDocumentTypes(stackbitConfig as any, { documentTypes: { ModelName: { fields: { fieldName: { ...stackbitConfig.models.ModelName.fields[0], required: false } } } } })
There are two problems here:
models
type
So there may be two issues in here.
cc @schickling @smnh
The text was updated successfully, but these errors were encountered:
This should be addressed with the 0.3.1 release. 🎉
0.3.1
Sorry, something went wrong.
No branches or pull requests
If I have the following in a Stackbit model definition:
The type that is generated is:
Great. Works like I would expect. Now if I add a default (initial value for Stackbit):
The type that is generated is:
Contentlayer assumes this is now a required field for some reason.
Note that this would be fine if I could override it. The problem is that I also can't just override a type. If I were to do something like this:
There are two problems here:
models
.type
property.So there may be two issues in here.
cc @schickling @smnh
The text was updated successfully, but these errors were encountered: