urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.63k stars 451 forks source link

Saving a component in Next.js development mode casues infinite requests #3448

Closed lswinblad closed 10 months ago

lswinblad commented 10 months ago

Describe the bug

I'm not sure if I'm implementing this correctly, but saving a component when using the Next.js development mode causes queries to be made in an infinite loop.

It seems to be caused by having different URLs for server / client side. The only reference I could find to having different URLs depending on the context is in the old repository.

To reproduce

  1. npm run dev
  2. Open devtools in e.g. chrome
  3. Save a file after e.g. inserting a newline somewhere
  4. Observe infinite requests being made

Reproduction

https://stackblitz.com/edit/github-unakrx?file=app%2Furql-provider.tsx

Urql version

See package.json in reproduction

Validations

JoviDeCroock commented 10 months ago

Same as https://github.com/urql-graphql/urql/issues/3408, misses a Suspense boundary