-
Notifications
You must be signed in to change notification settings - Fork 28
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
Pass mutation variables when calling executeMutation #103
Comments
You have to pass the variables during the request creation, and pass that to the hook. Here's an example: https://gist.github.com/gugahoa/b959b7d0b98b87cc1822b6754b85fa34 |
Thank you for the example. Could you show how its possible with reformality: https://github.com/MinimaHQ/re-formality/blob/master/README.md It seems super inconvenient to handle it way you show because you have to define your hook earlier than callback where you don’t have the data yet if you don’t control your state manually. |
In this case it's better to use https://github.com/FormidableLabs/reason-urql/blob/v1.2.0/src/UrqlClient.re#L319 |
That's what I was looking for. Thanks! |
As shown in this example, mutation variables are passed when hook is created. https://github.com/FormidableLabs/reason-urql/blob/master/examples/3-mutation/src/Dog.re#L66
In my use case I want to create mutation hook at top of the component but pass variables later (for example from form submission callback function). Does
reason-urql
support it. I cannot find any documentation or example about such case.The text was updated successfully, but these errors were encountered: