required/defaultValue behavior unintuitive #11672
jancbeck
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say I set a default value to my collection field like so:
Because of
required: true
, whenever I useuser.subscriptionActive
I don't have to do nullchecks and instead can treat it as always being a boolean.Great! But now when I create a new user...
Typescript complains:
But that's why I defined a default value! So that I don't have to explicitly declare it every time...
I'd expect Local API types to know that
subscriptionActive
is optional once adefaultValue
is defined.Maybe someone can help me understand why this is not the current behavior.
Beta Was this translation helpful? Give feedback.
All reactions