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

ReactQuery: params not convert case. #1657

Open
Bill-Park opened this issue Oct 6, 2024 · 1 comment
Open

ReactQuery: params not convert case. #1657

Bill-Park opened this issue Oct 6, 2024 · 1 comment
Assignees
Labels
tanstack-query TanStack Query related issue workaround A workaround has been provided

Comments

@Bill-Park
Copy link

What are the steps to reproduce this issue?

  1. My openapi input is json type and use snake_case.
  2. When create react-query, I got params with snake_case.

What happens?

Typescript use variables as camelCase.
My API server need snake_case but I concider to set customInstance with axios-case-converter.

Are there any solution or update for this?

What were you expecting to happen?

Add case-convert option for configuration and step for params case convert.

Any logs, error output, etc?

image

What versions are you using?

  System:
    OS: macOS 14.6.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 57.17 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  npmPackages:
    @tanstack/react-query: ^5.56.2 => 5.56.2 
    axios: ^1.7.2 => 1.7.2 
    msw: ^2.3.1 => 2.3.1 
    orval: ^7.1.1 => 7.1.1 
    react: ^18.2.0 => 18.2.0 
@melloware melloware added the tanstack-query TanStack Query related issue label Oct 6, 2024
@pedsm
Copy link

pedsm commented Oct 25, 2024

There are ways to handle this with a custom client,

In the example here https://orval.dev/guides/custom-client you can find some of it.

If you combine this with ts-case-convert you can get a pretty solid, solution. Can't quite produce an example of it now but if you. can't figure it out let me know and I can probably put something together

@melloware melloware added the workaround A workaround has been provided label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tanstack-query TanStack Query related issue workaround A workaround has been provided
Projects
None yet
Development

No branches or pull requests

3 participants