-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
bug?: react-query implementation when POST is used it always transforms into useMutation
while for some cases its a useQuery
for us!
#515
Comments
useMutation
while for some cases its a useQuery
for us!
Hey @maapteh it's not possible for now. I would it to add an option for it. But you can use the function generate and use it in a useMutation at the moment |
I think you can also use override to create a import { defineConfig } from 'orval';
import openApiSpec from './apiSpecs/swagger.json';
export default defineConfig({
[openApiSpec.info.title]: {
output: {
clean: true,
client: 'react-query',
headers: true,
mode: 'tags-split',
override: {
operations: {
FindUsers: {
query: {
useQuery: true,
},
},
},
},
target: 'src/services/generated/api.ts',
tsconfig: 'tsconfig.json',
},
input: {
target: 'apiSpecs/swagger.json',
},
},
}); |
Thanks, @reichhartd. Completely forgot that I did that 😅 |
sorry if I poke everyone watching this thread but I wonder if there is a way to generate both useQuery, useMutation with custom name as right now overriding with both useMutation and useQuery are true give out hook with same name |
@landtee i suggest opening a Discussion in the Discussion area and provide your example config and what its generating and what you would like it to generate. |
Hi, i noticed when my endpoint is POST the tooling generates a
useMutation
implementation, while for us it's really auseQuery
.Since we can't dictate how the api's should be setup (POST has been chosen as a security measurement for this particular case), I was wondering if there is a way to tell the tooling which implementation to use for specific endpoints/methods?
The text was updated successfully, but these errors were encountered: