You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
URQL is working perfectly and is a joy to use. What I'm interested is having an app run completely from cache for "Trial" or "Free Tier" users. It seems like it's possible – I see the IndexedDB created and works as expected, but trying requestPolicy: "cache-only", I just get null for the data, even when I've been online and the cache has been populated first.
I don't mind writing my own resolvers or updates. Is there a way to offlineExchange without any network requests? I've searched through the forums and haven't found a specific answer.
offlineExchange is for persistence/offline-first behavior; it is not a global “never hit the network” switch. If you want a tier that runs only from local data, use requestPolicy: 'cache-only' for those operations, or build that client without fetchExchange at all.
The null result usually means Graphcache cannot fully satisfy that exact query from the normalized cache. Being “online once” is not enough unless the previous operations wrote all requested entities/fields and Graphcache can resolve the query shape. For a local-only tier, make the cache schema-aware, add keys/resolvers for non-id objects, and add mutation updates/optimistic writes so every offline query can be answered from the cache.
So the shape is: offlineExchange({ schema, storage, keys, resolvers, updates, optimistic }), then cache-only queries for the free/trial mode. If a query still returns null, inspect which field/entity is missing from the normalized cache rather than expecting offlineExchange to synthesize it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
URQL is working perfectly and is a joy to use. What I'm interested is having an app run completely from cache for "Trial" or "Free Tier" users. It seems like it's possible – I see the IndexedDB created and works as expected, but trying requestPolicy: "cache-only", I just get null for the data, even when I've been online and the cache has been populated first.
I don't mind writing my own resolvers or updates. Is there a way to offlineExchange without any network requests? I've searched through the forums and haven't found a specific answer.
Cheers!
Mike Austin
All reactions