Skip to content

Commit f35bed9

Browse files
authored
packages/openapi-react-query: Update createClient documentation
Update createClient documentation in openapi-react-query to point out incompatibility between `@tanstack/react-query`'s `QueryClient` and the generated `OpenapiQueryClient`. The current documentation assumes that the user has constructed a `QueryClient` already, the updated documentation explicitly brings forward the same assumption
1 parent f96290b commit f35bed9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/openapi-react-query/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ npx openapi-typescript ./path/to/api/v1.yaml -o ./src/lib/api/v1.d.ts
2929

3030
Once your types have been generated from your schema, you can create a [fetch client](../openapi-fetch), a react-query client and start querying your API.
3131

32+
Note that the returned `OpenapiQueryClient` is not a react-query client, you still need to construct a `QueryClient` and pass it to `<QueryClientProvider queryClient={...}>`. The returned `OpenapiQueryClient` only provides type-inferred wrappers over the actual `useQuery` / `useMutation` / etc. hooks.
33+
3234
```tsx
3335
import createFetchClient from "openapi-fetch";
3436
import createClient from "openapi-react-query";

0 commit comments

Comments
 (0)