Git Product home page Git Product logo

Comments (9)

anymaniax avatar anymaniax commented on May 13, 2024 2

you now have a new option with the 5.3.0. You can add this option in the override to only have the queryOptions
Screenshot 2021-05-17 at 21 05 07

from orval.

anymaniax avatar anymaniax commented on May 13, 2024 1

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.

yjose avatar yjose commented on May 13, 2024 1

Great
+1 for this approach

from orval.

anymaniax avatar anymaniax commented on May 13, 2024

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.

anymaniax avatar anymaniax commented on May 13, 2024

If you have an other idea or option I am really open to discuss about it

from orval.

yjose avatar yjose commented on May 13, 2024

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.

anymaniax avatar anymaniax commented on May 13, 2024

Something like this? And if you set false we don't add the config globally or per operation.
Screenshot 2021-05-12 at 10 08 10

from orval.

yjose avatar yjose commented on May 13, 2024

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.

anymaniax avatar anymaniax commented on May 13, 2024

sure! You will just not have the possibility to pass a second argument to your custom instance

from orval.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.