openapi-react-query-codegen icon indicating copy to clipboard operation
openapi-react-query-codegen copied to clipboard

`client` not exported?

Open lindesvard opened this issue 7 months ago • 1 comments

Describe the bug Im probably stupid but client is not exported from services.gen.ts

From docs

import { client } from "../openapi/requests/services.gen";

client.setConfig({
  baseUrl: "YOUR_BASE_URL",
  throwOnError: true, // If you want to handle errors on `onError` callback of `useQuery` and `useMutation`, set this to `true`
});

client.interceptors.request.use((config) => {
  // Add your request interceptor logic here
  return config;
});

client.interceptors.response.use((response) => {
  // Add your response interceptor logic here
  return response;
});

To Reproduce Just added "codegen": "openapi-rq -i https://raw.githubusercontent.com/7nohe/openapi-react-query-codegen/refs/heads/main/examples/petstore.yaml --client axios", to scripts and run it.

Do not have any client in the generated files.

OpenAPI spec file Have tried our own but also petstore.yaml same result

Expected behavior That client is exported or update documentation

  • OS: macos
  • Version: "@7nohe/openapi-react-query-codegen": "^1.6.2",

lindesvard avatar May 22 '25 09:05 lindesvard

hmm, looks like the documentation is for the beta package since it has the exported client

lindesvard avatar May 22 '25 09:05 lindesvard