Type for fields with default value #2580
Unanswered
dawidmachon
asked this question in
Q&A
Replies: 1 comment 1 reply
-
That is a good question. If you're reading that Since we don't have permutations for types such as CreateProduct vs ReadProduct, we just have to always mark them optional. I don't think this is a good direction to go. I'm interested in knowing if you have another solution to this problem. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have created collection
Product
with field:type which is generated for it by payload:
Product.price?: number | undefined
I would ask if there is any config option to check and enforce strong typing. When you have a default value, then it will always be defined, but now payload thinks differently.
Beta Was this translation helpful? Give feedback.
All reactions