You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, line2 is properly identified as string | undefined | null, but the property itself is not properly marked as optional. Consequently, if I supply an object to createAddress.run that has an optional line2 property, the TypeScript compiler complains even though everything is fine at runtime.
The Solution
I think the simple fix would be to let TypeScript know that nullable parameters/properties are optional. The way to do that would be with a ? So ideally, the following would be generated for optional properties
/** 'CreateAddress' parameters type */exportinterfaceICreateAddressParams{address: {// ... Other Propertiesline2?: string|null|void,// notice the `?`};}
The text was updated successfully, but these errors were encountered:
The Problem
Currently, when generating TS files from SQL queries, the TS types require nullable parameters to be specified. For example
Generates the following type
Here,
line2
is properly identified asstring | undefined | null
, but the property itself is not properly marked as optional. Consequently, if I supply an object tocreateAddress.run
that has an optionalline2
property, the TypeScript compiler complains even though everything is fine at runtime.The Solution
I think the simple fix would be to let TypeScript know that nullable parameters/properties are optional. The way to do that would be with a
?
So ideally, the following would be generated for optional propertiesThe text was updated successfully, but these errors were encountered: