Replies: 3 comments 4 replies
-
I know a user that needed this and used zodios v11 beta sucessfully for this : |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. I did try the above but unfortunately it didn't work. In case it is helpful to others, this is my setup and what I tried and what worked/didn't work. First, for some context there is a NestJS backend and NextJS app directory frontend. This basically works and I end up with something like the screenshot: Inside of a const accountUser: AccountUserType = await api.AccountUserController_findMe() And inside of a client component I will have something like: const { mutate, error, isLoading } = apiHook.useClientActionsController_create(...) Again this works, and it's typed and everything. My issue is if I have a In Zodios v10 by default it uses Axios, however I tried with the fetch plugin. I can get this to work on server components if I replace the above line with: const accountUser = await getUser() and
And in theory with the |
Beta Was this translation helpful? Give feedback.
-
@ecyrbe is there any barrier to use zodios with the new app directory? when I try to fetch any endpoint i've got a 405 and the following log:
I've tried to do that, but it didn't work
|
Beta Was this translation helpful? Give feedback.
-
Hi all,
I"m using Zodios with my NextJS project and it works well. On the server components I use the generated api and on the client side components I use Zodios Hooks (thin later on React Query).
My question/observation is that the requests in my server components are not getting deduped. I looked at possibly caching (https://nextjs.org/docs/app/building-your-application/data-fetching/caching) however I'm struggling to get this to work as well.
Has anyone progressed further on this?
Beta Was this translation helpful? Give feedback.
All reactions