-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow no variables to be passed at all to useActions which don't requ…
…ire variables Antoine and I both created param-less actions recently, and went to run them using `mutate()` as returned by the react hook. Before this change, that fails with an internal error inside the hook, where we assumed that the variables were present. If you pass `mutate({})`, things work fine, but that seems superfluous. The types should have caught this if we were working in TS, but since we were in the Gadget editor, the type check is off. So, this changes the types and the runtime code to allow passing nothing at all to the mutate function returned by the hook if there are no required variables. We're still just the client here, so the server will still validate that any really required params are present and return an error if they aren't passed.
- Loading branch information
Showing
5 changed files
with
78 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters