-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
support fetch
client
#1387
Comments
I think the main benefit of using Axios in this context is the easy creation of a custom instance with interceptors. The most common use case is adding an Auth header in a request interceptor. Do you see this as possible with the Fetch API? If so, could you provide an example as part of this effort? If that is a no-brainer, I would happily replace Axios with Fetch UPDATE |
Thank you for give feed back 🙌 |
Axios doesn't run on winter runtimes like Cloudflare, Vercel Edge and Deno. This is why the fetch adapter would be super useful. |
Neat! Thank you @soartec-lab for your implementation. We've already switched to this instead of our own I've a question regarding handling different
But this probably isn't the intended way to implement this, do you have any suggestions regarding this? |
Hi, @n2k3
That's certainly works. And as far as I know, this is currently the only workaround for switching variables for each environment. This issue is independent of the |
@soartec-lab we could have a standalone object that could be overridable like axios is doing. Like here https://gist.github.com/anymaniax/44c1331a5643081a82da070e45f405f0#file-http-instance-ts-L34 |
It`s great, I would like to implement this when creating a custom instance 👍 |
Hey, @anymaniax Could you please tell me how to use the https://gist.github.com/anymaniax/44c1331a5643081a82da070e45f405f0#file-http-instance-ts-L34 I would like to implement something like an |
The https://github.com/anymaniax/orval/blob/master/samples/next-app-with-fetch/custom-fetch.ts#L16-L29 I'm still looking for feedback, so please let me know if you find anything. |
@oferitz @davidysoards |
wonderful! thank you for all your hard work on this feature @soartec-lab 🙏 |
@soartec-lab have you set a release date for version Thank you for this feature - it will help me a lot! |
@xmd5a i just pinged @anymaniax about doing a 6.32.0 release. |
Thanks for the great work on the fetch client - I noticed that formdata openapi specifications do not generate as expected:
The formData does not exist in this case and as such this generated code will not work. Is this a known limitation at the moment? |
Thank you for let me know. |
@soartec-lab you are amazing - thanks for such a quick fix! sent you some beer money 🍺 |
@jamesleeht |
7.0 is released lets close this ticket and let people open new individual bug tickets for fetch against 7.0 |
👍 |
Because we had a lot of new feature and refactor lately. And we will completely remove some old api already mark as legacy. Also we moved the repository to an organization so it’s also to start a new era for the project |
Is there plans to push 7.0 to the npm registry? It seems like installing from the release tarball causes it to be installed as |
It’s already on npm you can install it with orval@next |
Going to test! Currently working on a CRM and this lib will speed up the development a lot. Where can I leave feedback about this version? |
@koka0012 |
Thank you so much for adding this feature! I have one question regarding the error handler; I see that What I see in
as a result, this line will fail if we get an error response (404 for example) from BE: is there a way to explicitly throw a custom error without manually modifying the code from |
Thanks for comment! setting orval.config: using: |
perfect! thank you so much @soartec-lab 🖤 |
I'm opening this issue to clarify the support status of the
fetch
client.Description
I added a new
fetch
client.Becouse, since the
fetch
API is mature, it has the advantage of reducing the bundle size of the application compared to usingAxios
, and I feel that this is sufficient in some cases.Furthermore, we think it can be used to select an
HTTP
client withtanstack query
orswr
, or when calling anAPI
from aserver-side
framework.Ref: https://developer.mozilla.org/en-US/docs/Web/API/fetch
Todo
fetch
client usingfetch
API.fetch
client withNext.js
.fetch
client.fetch
client.fetch
ashttp fetcher
in theswr
client.fetch
ashttp fetcher
in thequery
client.The text was updated successfully, but these errors were encountered: