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
Documentation claimsuseSWRMutationkey parameter to be "same as mutate's key".
However, useSWRMutation in fact does not accept a filter function as the global mutate does.
As I understand, this means that in order to implement partial keys revalidation when using useSWRMutation hook, one must call the global mutate() API inside an onSuccess callback.
This in turn leads to another issue when trying to build a custom wrapper hook around useSWRMutation: injecting revalidation behavior in options.onSuccess is not possible, because the callback is getting overwritten by one provided in the parameters of the trigger() call.
Please provide clarification for useSWRMutation API in the docs, and explain what is the proper way to revalidate array keys while using mutation hook and knowing only a part of the key.
The text was updated successfully, but these errors were encountered:
Documentation claims
useSWRMutation
key
parameter to be "same as mutate's key".However,
useSWRMutation
in fact does not accept a filter function as the globalmutate
does.As I understand, this means that in order to implement partial keys revalidation when using
useSWRMutation
hook, one must call the globalmutate()
API inside anonSuccess
callback.This in turn leads to another issue when trying to build a custom wrapper hook around
useSWRMutation
: injecting revalidation behavior inoptions.onSuccess
is not possible, because the callback is getting overwritten by one provided in the parameters of thetrigger()
call.Please provide clarification for
useSWRMutation
API in the docs, and explain what is the proper way to revalidate array keys while using mutation hook and knowing only a part of the key.The text was updated successfully, but these errors were encountered: