orval icon indicating copy to clipboard operation
orval copied to clipboard

Feature Request: support react-query v4

Open mainfraame opened this issue 3 years ago • 12 comments

react-query recently released an update to v4. Orvel will need to be modified to adjust for the differences in v3 and v4. Here is the guide to do that.

mainfraame avatar Jul 19 '22 13:07 mainfraame

+1 for this just ran into this today trying to upgrade!

melloware avatar Jul 19 '22 16:07 melloware

If I am not wrong it just replacing the import. Will be in the next release in the coming days

anymaniax avatar Jul 19 '22 17:07 anymaniax

I'm not quite sure it's going to be that straightforward (even though I hope it will), i had some issues with types when i upgraded to v4, mainly with UseQueryOptions.

maciej-skyfi avatar Jul 20 '22 20:07 maciej-skyfi

Just did the update by just changing the npm package and everything seems to work fine. @maciej-skyfi do you have more info on the issue?

anymaniax avatar Jul 21 '22 16:07 anymaniax

I did the update like this I didn't find any issue just by changing the package. We do a release asap

anymaniax avatar Jul 21 '22 17:07 anymaniax

Released with 6.9.1 don't hesitate if you have any trouble

anymaniax avatar Jul 21 '22 17:07 anymaniax

upgrading import from 'react-query' to @tenstack/react-query seems to be a breaking change? would that be possible to control react-version by a config flag?

missing1984 avatar Jul 22 '22 00:07 missing1984

I would remain on 6.9.0 until you are ready for query 4. It doesn't seem worth supporting both and query 4 comes with automatic update tools to fix your code for you

melloware avatar Jul 22 '22 00:07 melloware

Ran into https://github.com/anymaniax/orval/issues/494 that needs the upgrade :( I think a breaking change is a breaking change

missing1984 avatar Jul 22 '22 04:07 missing1984

It’s controlled with your package.json. If you still have the old package installed and not the new one it’s take the old version. You can check the implementation here. So normally no breaking changes and that's why it's a fix because I already planned the v4 beforehand but didn't notice they changed the package name.

anymaniax avatar Jul 22 '22 10:07 anymaniax

Ran this today and works like a charm all updated to React Query 4 in about 5 minutes!

melloware avatar Jul 22 '22 14:07 melloware

ah needed different package name

maapteh avatar Jul 28 '22 08:07 maapteh

@anymaniax I think this issue can be closed

reichhartd avatar Aug 14 '22 14:08 reichhartd