openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

feat(openapi-react-query): Add query client to create client

Open arnaud9145 opened this issue 9 months ago • 4 comments

Changes

This PR is similar to https://github.com/openapi-ts/openapi-typescript/pull/1814, but instead of adding the query client each time we call useQuery/useMutation/useSuspenseQuery/useInfiniteQuery, we pass the queryClient to the createClient once and for all. It is still possible to pass an other queryClient to those methods to override the default one if needed.

How to Review

Create a client by passing a queryClient, check that it is this client that is used instead of the default one.

Checklist

  • [X] Unit tests updated
  • [X] docs/ updated (if necessary)
  • [X] pnpm run update:examples run (only applicable for openapi-typescript)

arnaud9145 avatar May 05 '25 13:05 arnaud9145