Is it possible to use next-urql & @urql/next while incrementally adopting the app router? #3438
Replies: 3 comments 1 reply
-
If you aren't using the We should think a bit more about this I reckon, the issue for which we need In theory it should be possible to use |
Beta Was this translation helpful? Give feedback.
-
In one of my projects we are also undertaking a migration to app router. The way we have decided to do it is to separate the entire component trees for both routers. It's not really feasible to mix them, because of the reasons explained above. But as long as your tree is clean for each of app/some-route, and pages/some-route - you can build 2 apps successfully (internally, if you have both routers in your next project, you'll essentially get 2 bundles - or really, 2 sets of bundles). (In my case, the pages router will continue to use the bloated apollo-client, while the new app router will use @urql/nextjs. I've found the process of migrating components to a new separate components folder for the app router, to be VERY useful for cleaning out cruft that has accumulated over many years in this particular app.) |
Beta Was this translation helpful? Give feedback.
-
The way we're currently working around this is by adding a |
Beta Was this translation helpful? Give feedback.
-
Hello,
We have some Next.js applications using the pages router and
next-urql
and we're looking to start migrating to the app router. I was curious if it should be possible to incrementally adopt the app router with urql such that we have some routes that usenext-urql
and others that use@next/urql
as well as share queries?While working on adding a new route under the app router, one of our existing components got into a infinite loop calling
useQuery
. When I updated the component toimport { useQuery } from '@next/urql';
that seemed to have resolved that issue, but then I started getting aERR_MODULE_NOT_FOUND
error when testing whether my changes work with the pages router.While searching around I came across this discussion where one of the answers was to update the codegen config to have
Which had me wondering whether what I'm trying to do is even feasible and how best to incrementally adopt the app router when using urql.
Beta Was this translation helpful? Give feedback.
All reactions