Skip to content
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

openapi-react-query: Add the ability to bring queryClient as argument #1805

Closed
iffa opened this issue Aug 2, 2024 · 2 comments
Closed

openapi-react-query: Add the ability to bring queryClient as argument #1805

iffa opened this issue Aug 2, 2024 · 2 comments
Labels
enhancement New feature or request openapi-react-query Relevant to openapi-react-query PRs welcome PRs are welcome to solve this issue!

Comments

@iffa
Copy link

iffa commented Aug 2, 2024

Noticed that this wasn't possible yet and was a TODO in the code too.

@kerwanp kerwanp added enhancement New feature or request openapi-react-query Relevant to openapi-react-query labels Aug 2, 2024
@kerwanp
Copy link
Contributor

kerwanp commented Aug 2, 2024

Temporarily, it is possible to wrap inside a QueryClientProvider. But in the future we should be able to pass the queryClient as an argument.

@tanstack/react-query

const query = useQuery({
  queryKey: [],
  queryFn: () => {},
}, queryClient);

openapi-react-query

const query = $api.useQuery('get', '/api/posts', {}, queryClient);

Feel free to open a pull request! This should be pretty straight forward.

@kerwanp kerwanp added the PRs welcome PRs are welcome to solve this issue! label Aug 2, 2024
@kerwanp
Copy link
Contributor

kerwanp commented Aug 7, 2024

Closing this issue as this is resolved in #1814 thanks to @yoshi2no !

@kerwanp kerwanp closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi-react-query Relevant to openapi-react-query PRs welcome PRs are welcome to solve this issue!
Projects
None yet
Development

No branches or pull requests

2 participants