support v4 callbacks in v5
one of the most used features in react query v4 was callbacks (onSuccess, onError, onSettled) I recreated this functions and add the functionality inside getRequest function this feature is easy to implement with promise callbacks
Hello Mohammad,
I hope you're doing well. Now, let me share the history of React-Query. There were numerous misunderstandings among developers regarding certain events, leading the React-Query team to make the decision to remove them. In my view, it would be prudent to align with React-Query's choice and replace the use of onSuccess with useEffect. Introducing those events might inadvertently plunge us into a complex and challenging pool of bugs.
following the standards is a good approach and we will try to adopt to it in our project as well however there was a bug with useInfiniteQuery generator where in the options object it requires 3 properties : getNextPageParam, initialPageParam, queryKey
this should be optional since we are generating these properties on the package I would be thankful if you fix that bug or if you want I can make another pull request for this problem (I created a separated type named SwaggerTypescriptUseInfiniteQueryOptions and omitted those properties )
Feel free to open a PR, I will wait to your PR. Thank you.