orval-labs / orval

orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats. 🍺
https://orval.dev
MIT License
3.01k stars 329 forks source link

Unable to Configure placeholderData Option for React Query in Orval Config #1579

Open ekhishigee opened 2 months ago

ekhishigee commented 2 months ago

What are the steps to reproduce this issue?

  1. Set up a React project using React Query and Orval for API generation.
  2. Try to configure the placeholderData option for React Query in the Orval config.
  3. Notice that there is no clear documentation or option in Orval's config for setting placeholderData.

What happens?

I am unable to configure the placeholderData option for React Query through the Orval configuration file. The generated hooks do not include placeholderData, and there is no option available in the Orval configuration to add it.

What were you expecting to happen?

I expected to find an option in the Orval configuration that allows me to define placeholderData for React Query hooks so that it can be automatically included in the generated hooks.

Any logs, error output, etc?

No error output, just missing configuration in the generated code.

Any other comments?

It would be helpful to have documentation or an example showing how to set up placeholderData within the Orval config for React Query.

What versions are you using?

System:
    OS: macOS 14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 40.27 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  npmPackages:
    @tanstack/react-query: 5.51.21 => 5.51.21 
    axios: 1.7.3 => 1.7.3 
    orval: 7.0.1 => 7.0.1 
    react: 18.3.1 => 18.3.1 
melloware commented 2 months ago

i dont remember seeing placeholderData before I wonder if that is a newer TanStack Query feature and it was just never implemented in Orval. PR is welcome!