-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read variables from within the useMutation
's update
function
#128
Comments
Thanks for bringing this up! We try to map types 1:1 into ReScript, so the omission of options wasn't intentional, it probably just wasn't there when these bindings were written. So, yes, we should definitely add it. Sadly, inconsequential additions in javascript can create breaking changes here in ReScript, but not much we can do about it. Would you like to take a stab at it? |
@jeddeloh I tried, but it wasn't too successful. The link between |
The function inside of the module generated by the ppx to do this is |
I just had a situation where it would be useful to read variables passed to a mutation from its
update
function. The official TypeScript definitions state:https://github.com/apollographql/apollo-client/blob/main/src/core/types.ts#L170-L182
My use case is that I wanted to create a hook that uses
MySharedMutation.use()
under the hood, passing it theupdate
function, so that users of that custom hook do not need to think how to update cache for that specific mutation.Do you think it makes sense to add
options
param to ReScript bindings as well? I'm asking because it would be a breaking change in the sense that all users of theupdate
param would need to update their functions passed toupdate
to include the third param~options
.The text was updated successfully, but these errors were encountered: