-
-
Notifications
You must be signed in to change notification settings - Fork 534
feat(openapi-react-query): Add the ability to bring queryClient as argument #1814
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
Conversation
🦋 Changeset detectedLatest commit: a678749 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hey! That looks really great, thanks a lot for your contrib! Then it will only needs the changesets and it will be ready to merge! |
…stom queryClient`
Thank you for the review!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Really nice idea to check for react-query actual tests for that.
One more thing left, add yourself to the contributors list in docs/scripts/update-contributors.js
ref: #1805
Changes
Added the ability to pass
queryClient
as an argument in theopenapi-react-query
.This enhancement allows users to directly pass queryClient to the
useQuery
,useMutation
,useSuspenseQuery
hooks.The sample code in the issue is as follows:
In my understanding,
$api.useQuery
currently accepts method, path, options, and queryOptions, and with the addition of queryClient, the correct format should be:If I am mistaken in my understanding, please let me know. Your feedback would be greatly appreciated.
How to Review
I don’t think it is necessary to add tests for this change, but what do you think?
Checklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)