question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to pass axios options per query

See original GitHub issue

I haven’t found a possibility to add an options parameter for each generated query. From my point of view it shoul looks like this:

const myApiCall = (queryParameter: string, options?: AxiosRequestConfig) => customAxiosInstance({ url: '/some_url', method: 'get', ...options })

There is a similar issue but I didn’t get why there should be an extra parameter in mutator. From docs:

The second argument is only provided for the Angular client and give an instance of HttpClient

Also I tried to use an undocumented parameter override.requestOptions but had no luck 😦

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
anymaniaxcommented, Dec 15, 2021

@yekver if you have the mutator warning that’s why it doesn’t work for you. Because orval cannot know that you have a second argument since it cannot parse it

0reactions
yekvercommented, Feb 20, 2022

Yeah, I think the solution is described clearly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to post query parameters with Axios? - Stack Overflow
So I don't know how to pass Query Parameters with Axios in my request (because right now, it's passing data: { mail: "lol@lol.com", ......
Read more >
GET Request Query Params with Axios - Mastering JS
The easiest way to make a GET request with Axios is the axios.get() function. The 2nd parameter to axios.get() is the Axios options:...
Read more >
How to Perform HTTP Requests with Axios – A Complete Guide
Sending asynchronous HTTP queries to REST endpoints and performing CRUD operations is simple using Axios POST request and GET request.
Read more >
Request Config | Axios Docs
These are the available config options for making requests. Only the url is required. Requests will default to GET if method is not...
Read more >
Complete Guide to Axios HTTP Client - Reflectoring
Then we are passing a configuration argument to the axios instance ... Instead of appending the request query parameter in the URL in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found