Closed panda7789 closed 1 year ago
Personally I'm not using mutations that often.
I mean, I almost never send GET requests directly (always work with useQuery
), but for POST/PUT/DELETE requests, in over 60% of the cases I send them via Client methods just as you shown.
So for me it feels ok (at least I'm doing the same thing) :)
Hi, I have question about mutations.
I have this backend controller:
React-query-swagger generates this:
![image](https://user-images.githubusercontent.com/6593380/234266672-13393ea1-af66-4176-8598-d9ce4701962a.png)
And now, because I have ID in url, it is needed while initializing useUsersPUTMutation. So I cannot use useMutation for multiple users. Or sometimes I dont know ID on initialization. So I'm doing workaround and using Client.usersPUT(id, body) directly when I know ID.
But I'm wondering if it is good practice to using usersPUT directly, and if I'm not loosing any of features that useUsersPUTMutation adds.
Thank you in advance for your time :)