Comments (9)
you now have a new option with the 5.3.0
. You can add this option in the override to only have the queryOptions
from orval.
check this issue #115. Personally, I use 90% of the time the global config but that's not the case for everyone. A solution would be to add an option in the orval config for that but I have no idea how to name it 😀
from orval.
Great
+1 for this approach
from orval.
Depending of the endpoints you can already have multiple arguments (all params, query params, body). The query config is optional and always the last argument. If I don't do this breaking change we will be force to pass undefined to the query config argument to pass an axios config. Same if we do it the other way around. That way I thought that an object where you can pass all options will be a better fit and will also help if we want to add other feature later on.
from orval.
If you have an other idea or option I am really open to discuss about it
from orval.
Yeah, i get your point, but During my experience with react-query with Axios, I nearly find myself passing Axios config with hooks, and I usually use them globally to Axios instance such headers.
Not sure if its the same for you
so for me, I would prefer to make my custom query hook identic as a simple react-query hook (same API), and should be ok to pass query configs as undefined in case I want to add Axios config.
from orval.
Something like this? And if you set false we don't add the config globally or per operation.
from orval.
i think this should work, and we can make it false by default to prevent breaking changes 👍
we still can pass a custom Axios instance when httpConfig: false
correct ?
from orval.
sure! You will just not have the possibility to pass a second argument to your custom instance
from orval.
Related Issues (20)
- msw generation does not import used models HOT 1
- Mock generation doesn't guarantee the required property mocking
- Is possible ignore the changes in the line of OpenAPI spec version ? HOT 2
- Another duplicate export edge case
- Specify mock property overrides for a specific schema HOT 2
- Support replacing types with custom ones when transforming the input HOT 5
- React Query: Regression in 6.25.0 caused by #1207 HOT 5
- Is possible ignore the changes in the line of OpenAPI spec version ?
- Orval generates wrong import paths in ESM-only package HOT 3
- Pass an additional option object in fetcher function when using custom axios instance HOT 4
- usePrefetch+useSuspenseQuery incorrectly generates prefetchSuspenseQuery calls
- bug: readonly fields missing from mutation function input types
- Regression when updating from 6.21 to 6.22.0 HOT 2
- Add a react-query default mutationKey that is the name of the mutation function (e.g. useCreateUser)
- allOf with nullable: true does not generate nullable type
- type: 'null' generates invalid zod client
- `target="es6"` or newer in `tsconfig.json` results in `Your mutator file doesn't have the default exported function` HOT 2
- Unknown error type when using duplicate reference
- Vue: variable for path parameter was converted wrong
- Is it possible to disable mock generation for a specific endpoint? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orval.