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
The following example currently throws a typescript error:
constdeleteOrg=useMutation({
...deleteOrganizationByName.useMutation(),onSuccess: (_,{ name })=>{showToast(`Successfully deleted organization "${name??""}"`);},});
Because it's assumed params is optional. We can work around this via something like:
constdeleteOrg=useMutation({
...deleteOrganizationByName.useMutation(),onSuccess: (_,input)=>{if(input===undefined){return;}const{ name }=input;showToast(`Successfully deleted organization "${name??""}"`);},});
But given that most mutation should have some kind of input, this feels unnecessary. We already have to default name to "" because we can't assume validation but that's a larger protobuf-es thing to tackle.
The text was updated successfully, but these errors were encountered:
In retrospect, this is fine. There are certainly cases where a mutations might not have parameters, and currently protobuf objects default to all properties being optional.
The following example currently throws a typescript error:
Because it's assumed params is optional. We can work around this via something like:
But given that most mutation should have some kind of input, this feels unnecessary. We already have to default name to "" because we can't assume validation but that's a larger protobuf-es thing to tackle.
The text was updated successfully, but these errors were encountered: