First of all thanks a lot for your work on this project!
The docs for request policies on document cache mention that cache-only should return the cached data or null.
When using useQuery in a next.js app and setting the request policy to cache-only everything looks as expected in dev mode. However when trying to create a production build with npm run build I get this error: TypeError: Cannot read properties of undefined (reading 'operation').
The expected behaviour would be no build errors and the same result as in dev mode.
Maybe for context why this is an issue for my use case: I tried to leverage the ssr prefetching of queries and want to only display data that has been prefetched server side. This worked fine with the graphCache, but I recently had to move back to document caching. So I'm not sure with which version this bug got introduced.
Describe the bug
First of all thanks a lot for your work on this project!
The docs for request policies on document cache mention that cache-only should return the cached data or null.
When using useQuery in a next.js app and setting the request policy to cache-only everything looks as expected in dev mode. However when trying to create a production build with
npm run build
I get this error:TypeError: Cannot read properties of undefined (reading 'operation')
.The expected behaviour would be no build errors and the same result as in dev mode.
Maybe for context why this is an issue for my use case: I tried to leverage the ssr prefetching of queries and want to only display data that has been prefetched server side. This worked fine with the graphCache, but I recently had to move back to document caching. So I'm not sure with which version this bug got introduced.
Reproduction
https://github.com/Thoud/urql-cache-only-issue-demo
Urql version
4.0.6
Validations